Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo Plugins Support › In app purchases on Android – completely lost

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #24275

    Jon-Paul

    I’m completely lost trying to add a single in-app product to my Felgo app on Android. I’m following the Android sections of: https://felgo.com/doc/plugin-soomla/

    In my Google Play Console I’ve created an ‘Internal Testing’ track and uploaded my APK. My APK has the standard permissions with the addition of ‘com.android.vending.BILLING’. I’ve generated a license key that includes the Soomla plugin.

    Under ‘Preparing Google Play In-App Purchases’ I think I’ve done the first 3 steps but step 4 says open ‘Services and APIs’ which I cannot find anywhere (also, step 2 mentions ‘distribution certificate, what is that?).

    That documentation links to https://developer.android.com/google/play/billing which then leads to https://developer.android.com/google/play/billing/getting-ready and I’ve followed those steps too. However, when I follow ‘Configure the Google Play Developer API’ steps I’ve ended up with two projects titled ‘Google Play Console Developer’ in the Google Cloud Platform section. Much of the information I’ve had to enter seems to be duplicated (project name, emails etc).

    This then takes me back to the Google Play Console ‘API Access’ where ‘OAuth brand is not detected’.

    I’m so lost I have no idea what my question is! Probably a few of these:
    1) What’s the difference between the Google Play Console and Google Cloud Platform?
    2) What’s the distribution certificate?
    3) What’s the keystore used for?

    Sorry, bit of a messy, vague, confused question there so any help is appreciated.

    #24277

    Jon-Paul

    It seems the documentation for Felgo and Android is out of date. In the Google Play Console, select your app and at the bottom of the left menu is ‘Monetization setup’ which is where I found the public license key. NOTE: Step 4 of ‘Preparing Google In-App Purchases’ says this should be in ‘Services and APIs’ so this should be updated.

    I’m still working through this, will add more info as I find it.

    #24279

    Jon-Paul

    Seems to build OK but now my app crashes on startup:

    E AndroidRuntime: FATAL EXCEPTION: main
    E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/vending/billing/IInAppBillingService$Stub;
    E AndroidRuntime: at com.soomla.store.billing.google.GoogleIabHelper$1.onServiceConnected(GoogleIabHelper.java:103)
    E AndroidRuntime: at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1741)
    E AndroidRuntime: at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1773)
    E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
    E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
    E AndroidRuntime: at android.os.Looper.loop(Looper.java:280)
    E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6706)
    E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
    E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.vending.billing.IInAppBillingService$Stub" on path: DexPathList[[zip file "/data/app/blah-p6_yxZFWJYITIJfQGPTfSg==/base.apk"],nativeLibraryDirectories=[/data/app/blah-p6_yxZFWJYITIJfQGPTfSg==/lib/arm64, /data/app/blah-p6_yxZFWJYITIJfQGPTfSg==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
    E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    E AndroidRuntime: ... 10 more

    The dependencies section of build.gradle is:

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
    
        implementation "com.android.support:support-core-utils:27.1.0"
        implementation "com.android.support:appcompat-v7:27.1.0"
    
        implementation 'net.vplay.plugins:plugin-soomla:3.+'
        def billing_version = "3.0.0"
        implementation "com.android.billingclient:billing:$billing_version"
    }

    And the bottom of my AndroidManifest.xml is:

            <meta-data android:name="billing.service" android:value="google.GooglePlayIabService" />
    
        </application>
        <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29"/>
        <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
    
        <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
             Remove the comment if you do not require these default permissions. -->
        <!-- %%INSERT_PERMISSIONS -->
        <uses-permission android:name="com.android.vending.BILLING"/>
    
        <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
             Remove the comment if you do not require these default features. -->
        <!-- %%INSERT_FEATURES -->
    
    </manifest>

    Any ideas?

    #24281

    Jon-Paul

    I had an earlier version of Qt selected in my project settings, just trying with a more recent version…

    #24283

    Alex
    Felgo Team

    Hi Jon-Paul,
    trying to jump in here, can you give a quick update on your latest state here, if you are still facing problems, and which ones?

    Best,
    Alex

    #24284

    Jon-Paul

    Thanks Alex,
    I’ve been going through my Soomla integration and commented out pieces of the code but still got the crash. This was with clearing out the build folder. I also updating Felgo and added Qt Purchasing. Not sure if any of that helped but now I get the error “This version of the application is not configured for billing through Google Play”. I’ve also removed the

    I have this line inside the application block:

     <meta-data android:name="billing.service" android:value="google.GooglePlayIabService"/>
    

    My SDK versions and billing permissions are in the manifest block:

    <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29"/>
     <uses-permission android:name="com.android.vending.BILLING"/>
    

     

    With build.gradle I just have the following in the dependencies block (NOT the buildscript dependencies):

    implementation 'net.vplay.plugins:plugin-soomla:3.+'

    The Soomla documentation mentoons the Soomla SDK version for Android is 3.6.21 but I don’t see that version number referenced anywhere. Is that a problem?

    The Android developer documentation mentions this needs to be added but I haven’t done that:

        def billing_version = "3.0.0"
    
        implementation "com.android.billingclient:billing:$billing_version"

     

    #24287

    Alex
    Felgo Team

    Hi Jon-Paul,

    only the integration steps outlined in our documentation are required. Qt Purchasing is not needed and also no additional gradle entries.

    Can you post the full content of your build.gradle file?

    Best,
    Alex

    #24291

    Jon-Paul

    Thanks, here’s my build.gradle:

    buildscript {
        repositories {
            maven { url 'https://maven.google.com' }
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
        }
    }
    
    allprojects {
        repositories {
            maven { url 'https://maven.google.com' }
            jcenter()
            maven { url 'https://sdk.v-play.net/maven/' }
        }
    }
    
    apply plugin: 'com.android.application'
    
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
    
        implementation "com.android.support:support-core-utils:27.1.0"
        implementation "com.android.support:appcompat-v7:27.1.0"
        implementation 'net.vplay.plugins:plugin-soomla:3.+'
    }
    
    android {
        /*******************************************************
         * The following variables:
         * - androidBuildToolsVersion,
         * - androidCompileSdkVersion
         * - qt5AndroidDir - holds the path to qt android files
         *                   needed to build any Qt application
         *                   on Android.
         *
         * are defined in gradle.properties file. This file is
         * updated by QtCreator and androiddeployqt tools.
         * Changing them manually might break the compilation!
         *******************************************************/
    
        compileSdkVersion androidCompileSdkVersion.toInteger()
        buildToolsVersion androidBuildToolsVersion
    
        defaultConfig {
          applicationId = productIdentifier
          versionCode = productVersionCode.toInteger()
          versionName = productVersionName
        }
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
                aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
                res.srcDirs = [qt5AndroidDir + '/res', 'res']
                resources.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                assets.srcDirs = ['assets']
                jniLibs.srcDirs = ['libs']
           }
        }
    
        lintOptions {
            abortOnError false
        }
    }
    
    

     

    #24292

    Jon-Paul

    I’ve created a new Felgo application project and enabled the Soomla plugin. The build.gradle file is slightly different so I’m making my original project match that. I’ll check all the other files too and see what the differences are.

    #24293

    Jon-Paul

    Cracked it.

    As Alex rightly said you only need to do the steps described here:
    https://felgo.com/doc/plugin-soomla/
    There’s no need to do any additional steps in the Google Play console (which required me adding 2 lines to build.gradle that weren’t needed). You don’t need to do anything with the Google Cloud Console. I got a bit confused when looking at the official Google docs as they mention other stuff that you don’t need.
    Apart from ensuring you follow the steps correctly, you must install the application following the link in the testing section of the Google Play Console. I copied my APK across but it must be installed from the Play Store.

    So, it was a mixture of a few things but I think the documentation being slightly out of date caused me to start looking at the official docs and do stuff I didn’t need to do. Then it was silly mistakes.

    Thanks for your help Alex.

Viewing 10 posts - 1 through 10 (of 10 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded