Android Question mopub error on startup

Schakalaka

Active Member
Licensed User
Longtime User
hello.
I'm going to try to integrate mopub into my app and follow this tutorial by @Pendrush
B4X:
https://www.b4x.com/android/forum/threads/mopub-ads-library.116307/
I have download the example, create ads on mopub and all should work, but on startup, it returns this error:

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
    at com.mopub.mobileads.MoPubAd$$CC.setAdUnitId$$dflt$$(Unknown Source:5)
    at com.mopub.mobileads.MoPubView.setAdUnitId(Unknown Source:4)
    at com.pendrush.wrapper.MoPubWrapper.inicijalizujMoPubBanner(MoPubWrapper.java:117)
    at com.pendrush.wrapper.MoPubWrapper.ProveriGdpr(MoPubWrapper.java:90)
    at com.pendrush.wrapper.MoPubWrapper.access$000(MoPubWrapper.java:29)
    at com.pendrush.wrapper.MoPubWrapper$1.onInitializationFinished(MoPubWrapper.java:72)
    at com.mopub.common.MoPub$1.run(MoPub.java:383)
    at android.os.Handler.handleCallback(Handler.java:808)
    at android.os.Handler.dispatchMessage(Handler.java:101)
    at android.os.Looper.loop(Looper.java:166)
    at android.app.ActivityThread.main(ActivityThread.java:7529)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "/data/app/b4a.example-43_dA0lgPjrj2MZVWXFbTA==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-43_dA0lgPjrj2MZVWXFbTA==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64, /preas/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 14 more

the last version of mopub android SDK is 5.15.0 (November 18, 2020)


I also looking for an alternative for AdMob to monetize my app, with banner, interstitial, and reward video...
 

Schakalaka

Active Member
Licensed User
Longtime User
Thank you.
this solves the problem.
Complete solution:
Download the last file version, from here:
B4X:
https://search.maven.org/artifact/org.jetbrains.kotlin/kotlin-stdlib/1.4.30-M1/jar
and here:
B4X:
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/

Add referance and enable multidex:

B4X:
    #AdditionalJar: AudienceNetwork.aar
    #AdditionalJar: kotlin-stdlib-1.3.21.jar
    #AdditionalJar: kotlin-stdlib-jdk8-1.3.21.jar
    #MultiDex: True
    'AudienceNetwork.aar is part of Facebook Audience Network Library
    'Download Facebook Audience Network Library from: https://www.b4x.com/android/forum/threads/facebook-audience-network-library.115930/

Don t work with version kotlin-stdlib-1.4.30-M1.jar

useful link:
B4X:
https://dl.bintray.com/mopub/mopub-android-sdk/

do you know how to add reward videos too?
Do you know a good ad network for banners?
admob - I have a gplay console banned account and this causes the problem with ads
facebook - it allows only apps from play store
tapjpy - as mediation with mopub, don't support banners. mopub, allow the only Facebook

I use mopub, for tapjoy interstitial, (and I'd like to add reward video), but I can't use mopub marketplace ads

can I use AdMob with mediation networks without use real AdMob ads? they can limit ads showing because I haven't a dev play store account




I have collected almost of file need to create the new library version:
B4X:
https://drive.google.com/file/d/1jNrzIdtz_tiiWIxpZF0GRPwcEsC8v9mZ/view?usp=sharing

B4X:
File List:
MoPubAds.jar [No Find]

MoPubAds.xml [No Find]

MoPubMerged.jar [No Find]

admob--19.6.0.1.aar [OK]

facebookaudiencenetwor-6.2.0.2.aar [OK]

kotlin-stdlib-jdk8-1.4.30-M1.jar [OK]

kotlin-stdlib-1.4.30-M1.jar [OK]

mopub-sdk-banner-5.5.15.0.aar [OK]

mopub-sdk-native-static-5.15.0.aar [NEW]

mopub-sdk-base-5.5.15.0.aar [OK]

mopub-sdk-fullscreen-5.15.0.aar [OK]

mopub-volley-2.1.0.androidx.jar [OK]
 
Last edited:
Upvote 0
Top