Forums

OverviewV-Play Plugins Support › admob plugin wont work

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #7721

    Vlad

    Hi

    I’ve added AdMob Qt5 plugin to my app and want to run it on android

    To install AdMob plugin I’ve used steps, described here: http://plugins.v-play.net/doc/plugin-installation/

    However, after changing activity and package to VPlay’s ones, my application stopped to work:

    Starting remote process.D/dalvikvm(18754): Late-enabling CheckJNI
    D/AndroidRuntime(18754): Shutting down VM
    W/dalvikvm(18754): threadid=1: thread exiting with uncaught exception (group=0x41eacd88)
    E/AndroidRuntime(18754): FATAL EXCEPTION: main
    E/AndroidRuntime(18754): Process: org.vladest.Popcorn, PID: 18754
    E/AndroidRuntime(18754): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.vladest.Popcorn/net.vplay.helper.VPlayActivity}: java.lang.ClassNotFoundException: Didn't find class "net.vplay.helper.VPlayActivity" on path: DexPathList[[zip file "/data/app/org.vladest.Popcorn-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.vladest.Popcorn-1, /vendor/lib, /system/lib]]
    E/AndroidRuntime(18754): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2174)
    E/AndroidRuntime(18754): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2298)
    E/AndroidRuntime(18754): 	at android.app.ActivityThread.access$800(ActivityThread.java:144)
    E/AndroidRuntime(18754): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
    E/AndroidRuntime(18754): 	at android.os.Handler.dispatchMessage(Handler.java:102)
    E/AndroidRuntime(18754): 	at android.os.Looper.loop(Looper.java:212)
    E/AndroidRuntime(18754): 	at android.app.ActivityThread.main(ActivityThread.java:5151)
    E/AndroidRuntime(18754): 	at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime(18754): 	at java.lang.reflect.Method.invoke(Method.java:515)
    E/AndroidRuntime(18754): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
    E/AndroidRuntime(18754): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    E/AndroidRuntime(18754): 	at dalvik.system.NativeStart.main(Native Method)
    E/AndroidRuntime(18754): Caused by: java.lang.ClassNotFoundException: Didn't find class "net.vplay.helper.VPlayActivity" on path: DexPathList[[zip file "/data/app/org.vladest.Popcorn-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.vladest.Popcorn-1, /vendor/lib, /system/lib]]
    E/AndroidRuntime(18754): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    E/AndroidRuntime(18754): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
    E/AndroidRuntime(18754): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
    E/AndroidRuntime(18754): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
    E/AndroidRuntime(18754): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2165)
    E/AndroidRuntime(18754): 	... 11 more
    I/Process (18754): Sending signal. PID: 18754 SIG: 9

    my AndroidManifest:

    <?xml version="1.0"?>
    <manifest package="org.vladest.Popcorn" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
        <application package="net.vplay.helper.VPlayApplication" android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="net.vplay.helper.VPlayActivity" android:label="@string/app_name" android:screenOrientation="unspecified" android:launchMode="singleTop">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
                <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
                <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
                <meta-data android:name="android.app.repository" android:value="default"/>
                <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
                <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
                <!-- Deploy Qt libs as part of package -->
                <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
                <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
                <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
                <!-- Run with local libs -->
                <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
                <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
                <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
                <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
                <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
                <!--  Messages maps -->
                <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
                <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
                <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
                <!--  Messages maps -->
    
                <!-- Splash screen -->
                <!--
                <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>
                -->
                <!-- Splash screen -->
            </activity>
        </application>
        <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19"/>
        <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 -->
    
        <!-- 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>
    

     

    #7722

    Alex
    V-Play Team
    #7723

    Vlad

    ok,thanks

    now I can see in logcat that libAdmobPlugin loaded, but no any other activity, nor banner itself

     

    got: W/Qt      (24936): qrc:/qml/VPlayGameTemplateScene.qml:293 ((null)): qrc:/qml/VPlayGameTemplateScene.qml:293: ReferenceError: AdMobBanner is not defined

    • This reply was modified 4 years, 5 months ago by  vladest.
    #7730

    Vlad

    also, regarding this row of code (taken from examples):

    banner: typeof(isSupportedPlatform) === "undefined" ? AdMobBanner.Smart : 0

     

    this means if property isSupportedPlatform is not defined, then banner type is AdMobBanner.Smart?

    Under android this property is defined

    is this wrong code or I didnt catch the idea?

    #7785

    Vlad

    Any update?

    How I can debug admob activity?

     

    Thanks

    #7786

    Vlad

    I’ve deleted both V-Play 1.x and 2.x from the system and reinstal V-Play 2.x and plugins

    now I’ve got the following in logcat:

    D/AdMobBannerItem(22112): init plugin item: AdMobBannerItem
    D/AdMobInterstitialItem(22112): init plugin item: AdMobInterstitialItem
    D/AdMobBannerItem(22112): bannerChanged() called
    D/AdMobBannerItem(22112): bannerChanged() called
    D/AdMobInterstitialItem(22112): loadInterstitial() called
    D/AdMobInterstitialItem(22112): Load interstitial...
    D/AdMobInterstitialItem(22112): Interstitial failed: 3
    

     

    #7792

    Alex
    V-Play Team

    Hi Vladest,

    sorry for the delay, let’s try to get some structure into the problems:

    vladest said:

    also, regarding this row of code (taken from examples):

    banner: typeof(isSupportedPlatform) === "undefined" ? AdMobBanner.Smart : 0

     

    this means if property isSupportedPlatform is not defined, then banner type is AdMobBanner.Smart?

    Under android this property is defined

    is this wrong code or I didnt catch the idea?

     

    This code seems kind of wrong, could you please tell us from which example you copied it?

     

    vladest said:

    I’ve deleted both V-Play 1.x and 2.x from the system and reinstal V-Play 2.x and plugins

    now I’ve got the following in logcat:

    D/AdMobBannerItem(22112): init plugin item: AdMobBannerItem
    D/AdMobInterstitialItem(22112): init plugin item: AdMobInterstitialItem
    D/AdMobBannerItem(22112): bannerChanged() called
    D/AdMobBannerItem(22112): bannerChanged() called
    D/AdMobInterstitialItem(22112): loadInterstitial() called
    D/AdMobInterstitialItem(22112): Load interstitial...
    D/AdMobInterstitialItem(22112): Interstitial failed: 3
    

     

    Are you trying to port an existing V-Play 1.x game to V-Play 2.0 or are you starting a new project? Are you using your own AdMob adUnitId or re-using an old publisherId?

    Best,

    Alex

    #7793

    Alex
    V-Play Team
    #7795

    Vlad

    Hi Alex

     

    yes, I’ve set device IDs. but…how to make sure these IDs are test? Is there is an application for android, which shows the id?

     

    Thanks,

    Vlad

    #7796

    Alex
    V-Play Team

    You can find your test device ids in the device log after you first run an your app with integrated AdMob plugin, search for “To get test ads on this device, call adRequest.addTestDevice” within logcat (this comes from AdMob itself).

    Are you further using a new adunit it or the deprecated publisher id (which will not work with the new Qt 5 plugin anymore)?

    Alex

    #7798

    Vlad

    Hi Alex

     

    sorry, but I cannot see any of this strings in my logcat

    I’ve generated my adunit couple weeks ago

     

    br,

    vlad

    #7799

    Alex
    V-Play Team

    As a starting point for debugging, are you able to run our demo project locally on your development environment, found here: https://github.com/vplayplugins/AdmobSample ? Can you integrate the QML code of our demo into your custom project and verify if it is running as intended?

    Thanks,

    Alex

     

    (ps: I’ll move the thread to our plugins sub-forum)

    #7813

    Vlad

    Hi

     

    ok, now interstitial banner works (entered wrong banner id), but smartbanner – still not

     

    #7828

    Vlad

    Hi

    still cant fix smartbanner (in the AdMob) its registered as standard

    How to debug it why it doesnt works?

     

    thanks

    #7831

    Alex
    V-Play Team

    Hi,

    could you please download our sample project and add your own ad-unit-id instead of ours to check if the id is working as expected?

    You can find the sample here: https://github.com/vplayplugins/AdMobSample

    Please replace the id in line 21 of main.qml.

    Thanks,

    Alex

Viewing 15 posts - 1 through 15 (of 20 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support