Android build crashes when try to add Admob under IronSource mediation [SOLVED]

Hi, I’m trying to integrate Admob ads via IronSource extension on Android, the build finishes correctly, but fails on launch on device.

Here is the official instruction from IronSource: https://developers.ironsrc.com/ironsource-mobile/android/admob-mediation-guide/#step-4

Summary of required changes:
build.gradle:

repositories {
    maven {
        url "http://dl.bintray.com/ironsource-mobile/android-adapters"
    }
}

dependencies {
    implementation 'com.google.android.gms:play-services-ads:18.3.0'
    implementation 'com.ironsource.adapters:admobadapter:4.3.7@jar'
}

AndroidManifest.xml:

<activity android:name="com.google.android.gms.ads.AdActivity" 
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" 
    android:theme="@android:style/Theme.Translucent" />

<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
   android:value="[ADMOB_APP_ID]"/>

The repro project can be found here:

Fails on start with such logs:

03-06 15:26:00.987 32446-32470/com.defironsource.test E/AndroidRuntime: FATAL EXCEPTION: Thread-5367
    Process: com.defironsource.test, PID: 32446
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string;
        at com.google.android.gms.common.api.internal.GoogleServices.<init>(Unknown Source)
        at com.google.android.gms.common.api.internal.GoogleServices.initialize(Unknown Source)
        at com.google.android.gms.internal.measurement.zzx.zzf(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:44)
        at com.google.android.gms.internal.measurement.zzx.<init>(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:22)
        at com.google.android.gms.internal.measurement.zzx.zza(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:6)
        at com.google.android.gms.measurement.api.AppMeasurementSdk.getInstance(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:2)
        at com.google.android.gms.internal.ads.zzaku.zzd(com.google.android.gms:play-services-ads-lite@@18.3.0:43)
        at com.google.android.gms.internal.ads.zzakt.run(com.google.android.gms:play-services-ads-lite@@18.3.0)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.R$string" on path: DexPathList[[zip file "/data/app/com.defironsource.test-2/base.apk"],nativeLibraryDirectories=[/data/app/com.defironsource.test-2/lib/arm, /data/app/com.defironsource.test-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at com.google.android.gms.common.api.internal.GoogleServices.<init>(Unknown Source) 
        at com.google.android.gms.common.api.internal.GoogleServices.initialize(Unknown Source) 
        at com.google.android.gms.internal.measurement.zzx.zzf(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:44) 
        at com.google.android.gms.internal.measurement.zzx.<init>(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:22) 
        at com.google.android.gms.internal.measurement.zzx.zza(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:6) 
        at com.google.android.gms.measurement.api.AppMeasurementSdk.getInstance(com.google.android.gms:play-services-measurement-sdk-api@@17.1.0:2) 
        at com.google.android.gms.internal.ads.zzaku.zzd(com.google.android.gms:play-services-ads-lite@@18.3.0:43) 
        at com.google.android.gms.internal.ads.zzakt.run(com.google.android.gms:play-services-ads-lite@@18.3.0) 
        at java.lang.Thread.run(Thread.java:818) 
    	Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.R$string
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        		... 10 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

In the log I see different versions of com.google.android.gms libs 17.1.0 and 18.3.0. The second one appeared from Admob dependencies requirement, so I guess the first one is set somewhere in Defold templates… Is this OK? Should I sync them? How?

Another guess - the error message says “Didn’t find class …” - can this be caused by proguard stripping? There were no instructions for proguard for Admob in IronSource, but I’m not sure if striping is enabled by default an if any extra configs needed here. (but there is proguard config from initial IS implementation, which already includes some directives for com.google.android.gms)

Am I missing something? Any ideas how to fix?
Thanks!

If you post the log.txtfrom your build folder, it’s easier to see what dependencies the build resolved to.

No, Proguard isn’t enabled currently. We’ll take a new pass at it soon, to make it match up with the new gradle dependency support.

1 Like

Here is the log for android arm64:

log.txt (18.4 KB)


aapt package -f  -m --auto-add-overlay -M /tmp/job6352639229063027244/build/AndroidManifest.xml -I /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/share/java/android.jar -J /tmp/job6352639229063027244/build/rjava  -S /tmp/job6352639229063027244/upload/packages/com.defold.android/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/res  -S /tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/res  -S /tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/res  -S /tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/res 

javac -source 1.6 -target 1.6 -J-Xms2048m -J-Xmx2048m -classpath /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/share/java/android.jar:/tmp/job6352639229063027244/build/tmp0rjava/classes -d /tmp/job6352639229063027244/build/tmp0rjava/classes @/tmp/job6352639229063027244/build/tmp0rjava/sources.txt
warning: [options] bootstrap class path not set in conjunction with -source 6
warning: [options] source value 6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings

jar cf /tmp/job6352639229063027244/build/tmp0rjava/R.jar -C /tmp/job6352639229063027244/build/tmp0rjava/classes .

javac -source 1.6 -target 1.6 -J-Xms2048m -J-Xmx2048m -classpath /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/share/java/android.jar:/tmp/job6352639229063027244/upload/ironsource/src:/tmp/job6352639229063027244/build/tmp1javac/classes:/tmp/job6352639229063027244/build/tmp0rjava/R.jar:/tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-2.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.loader-loader-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.arch.core-core-runtime-2.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.annotation-annotation-1.0.0.jar:/tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-ui-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-runtime-2.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.arch.core-core-common-2.0.0.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.slidingpanelayout-slidingpanelayout-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-base-18.3.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.collection-collection-1.0.0.jar:/tmp/.gradle/unpacked/androidx.interpolator-interpolator-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-tasks-17.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.customview-customview-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.viewpager-viewpager-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-utils-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.ironsource.sdk-mediationsdk-6.15.0.jar:/tmp/.gradle/unpacked/androidx.asynclayoutinflater-asynclayoutinflater-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.versionedparcelable-versionedparcelable-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.localbroadcastmanager-localbroadcastmanager-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.fragment-fragment-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.cursoradapter-cursoradapter-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-identifier-17.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-viewmodel-2.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.ironsource.adapters-admobadapter-4.3.7.jar:/tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-gass-18.3.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.drawerlayout-drawerlayout-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.documentfile-documentfile-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.swiperefreshlayout-swiperefreshlayout-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-common-2.0.0.jar:/tmp/.gradle/unpacked/androidx.print-print-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-sdk-api-17.1.0.aar/classes.jar:/tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-base-17.1.0.aar/classes.jar:/tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-core-2.0.0.aar/classes.jar -d /tmp/job6352639229063027244/build/tmp1javac/classes @/tmp/job6352639229063027244/build/tmp1javac/sources.txt
warning: [options] bootstrap class path not set in conjunction with -source 6
warning: [options] source value 6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings

jar cf /tmp/job6352639229063027244/build/tmp1javac/output.jar -C /tmp/job6352639229063027244/build/tmp1javac/classes .

dx -JXms2048m -JXmx2048m --dex --multi-dex --main-dex-list=/tmp/job6352639229063027244/build/main_dex_list.txt --output /tmp/job6352639229063027244/build /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/share/java/android-support-multidex.jar /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//share/java/glfw_android.jar /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//share/java/gamesys_android.jar /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//share/java/sound_android.jar /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-2.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.loader-loader-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.arch.core-core-runtime-2.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.annotation-annotation-1.0.0.jar /tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-ui-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-runtime-2.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.arch.core-core-common-2.0.0.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.slidingpanelayout-slidingpanelayout-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-base-18.3.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.collection-collection-1.0.0.jar /tmp/.gradle/unpacked/androidx.interpolator-interpolator-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-tasks-17.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.customview-customview-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.viewpager-viewpager-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-utils-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.ironsource.sdk-mediationsdk-6.15.0.jar /tmp/.gradle/unpacked/androidx.asynclayoutinflater-asynclayoutinflater-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.versionedparcelable-versionedparcelable-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.localbroadcastmanager-localbroadcastmanager-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.fragment-fragment-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.cursoradapter-cursoradapter-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-identifier-17.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-viewmodel-2.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.ironsource.adapters-admobadapter-4.3.7.jar /tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-gass-18.3.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.drawerlayout-drawerlayout-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.documentfile-documentfile-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.swiperefreshlayout-swiperefreshlayout-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-common-2.0.0.jar /tmp/.gradle/unpacked/androidx.print-print-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-sdk-api-17.1.0.aar/classes.jar /tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-base-17.1.0.aar/classes.jar /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-core-2.0.0.aar/classes.jar /tmp/job6352639229063027244/build/tmp1javac/output.jar /tmp/job6352639229063027244/build/tmp0rjava/R.jar  

aarch64-linux-android21-clang++ -c -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -march=armv8-a -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -Wa,--noexecstack -DDLIB_LOG_DOMAIN="IRONSOURCE" -DDM_PLATFORM_ANDROID -D__aarch64__ -DLUA_BYTECODE_ENABLE_64  -fno-exceptions -fvisibility=hidden  -Iupload/ironsource/include -Iupload/  -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//include -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//sdk/include  -I/opt/platformsdk/android/android-ndk-r20/sources/android/native_app_glue -I/opt/platformsdk/android/android-ndk-r20/sources/android/cpufeatures  upload/ironsource/src/ironsource.cpp -obuild/ironsource.cpp_0.o
upload/ironsource/src/ironsource.cpp:5:9: warning: 'DLIB_LOG_DOMAIN' macro redefined [-Wmacro-redefined]
#define DLIB_LOG_DOMAIN LIB_NAME
        ^
<command line>:2:9: note: previous definition is here
#define DLIB_LOG_DOMAIN "IRONSOURCE"
        ^
1 warning generated.

aarch64-linux-android21-clang++ -c -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -march=armv8-a -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -Wa,--noexecstack -DDLIB_LOG_DOMAIN="IRONSOURCE" -DDM_PLATFORM_ANDROID -D__aarch64__ -DLUA_BYTECODE_ENABLE_64  -fno-exceptions -fvisibility=hidden  -Iupload/ironsource/include -Iupload/  -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//include -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//sdk/include  -I/opt/platformsdk/android/android-ndk-r20/sources/android/native_app_glue -I/opt/platformsdk/android/android-ndk-r20/sources/android/cpufeatures  upload/ironsource/src/android/ironsource_android.cpp -obuild/ironsource_android.cpp_1.o

aarch64-linux-android21-clang++ -c -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -march=armv8-a -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -Wa,--noexecstack -DDLIB_LOG_DOMAIN="IRONSOURCE" -DDM_PLATFORM_ANDROID -D__aarch64__ -DLUA_BYTECODE_ENABLE_64  -fno-exceptions -fvisibility=hidden  -Iupload/ironsource/include -Iupload/  -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//include -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//sdk/include  -I/opt/platformsdk/android/android-ndk-r20/sources/android/native_app_glue -I/opt/platformsdk/android/android-ndk-r20/sources/android/cpufeatures  upload/ironsource/src/ironsource_callback.cpp -obuild/ironsource_callback.cpp_2.o

aarch64-linux-android21-clang++ -c -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -march=armv8-a -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -Wa,--noexecstack -DDLIB_LOG_DOMAIN="IRONSOURCE" -DDM_PLATFORM_ANDROID -D__aarch64__ -DLUA_BYTECODE_ENABLE_64  -fno-exceptions -fvisibility=hidden  -Iupload/ironsource/include -Iupload/  -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//include -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//sdk/include  -I/opt/platformsdk/android/android-ndk-r20/sources/android/native_app_glue -I/opt/platformsdk/android/android-ndk-r20/sources/android/cpufeatures  upload/ironsource/src/utils/LuaUtils.cpp -obuild/LuaUtils.cpp_3.o

aarch64-linux-android-ar rcs /tmp/job6352639229063027244/build/lib2.a build/ironsource.cpp_0.o build/ironsource_android.cpp_1.o build/ironsource_callback.cpp_2.o build/LuaUtils.cpp_3.o 

aarch64-linux-android21-clang++ -c -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -march=armv8-a -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -Wa,--noexecstack -DDLIB_LOG_DOMAIN="ENGINE_MAIN" -DDM_PLATFORM_ANDROID -D__aarch64__ -DLUA_BYTECODE_ENABLE_64  -fno-exceptions -fvisibility=hidden   -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//include -I/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//sdk/include  -I/opt/platformsdk/android/android-ndk-r20/sources/android/native_app_glue -I/opt/platformsdk/android/android-ndk-r20/sources/android/cpufeatures  build/main.cpp -obuild/main_tmp3.o

aarch64-linux-android21-clang++ -isysroot=/opt/platformsdk/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot -static-libstdc++ build/main_tmp3.o  -o build/libdmengine.so -Wl,-soname=libdmengine.so -DDLIB_LOG_DOMAIN="ENGINE_MAIN" -DDM_PLATFORM_ANDROID -D__aarch64__ -DLUA_BYTECODE_ENABLE_64   -Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text -L/tmp/job6352639229063027244/build  -L/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//lib/arm64-android -L/var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/lib/arm64-android -L/opt/platformsdk/android/android-ndk-r20/sources/cxx-stl/llvm-libc++/libs/arm64-v8a  -Wl,-Bstatic -Wl,--start-group -lc++_static  -l2  -lengine -lengine_service -lmbedtls -lwebviewext -lprofilerext -lfacebookext -liapext -lpushext -liacext -lrecord_null -lgameobject -lddf -lresource -lgamesys -lgraphics -lphysics -lBulletDynamics -lBulletCollision -lLinearMath -lBox2D -lrender -lscript -lluajit-5.1 -lextension -lhid -linput -lparticle -lrig -ldlib -ldmglfw -lgui -lcrashext -lsound -lopenal_soft -ltremolo -lliveupdate -lunwind -lcares  -Wl,--end-group -Wl,-Bdynamic  -lEGL -lGLESv1_CM -lGLESv2 -lOpenSLES -lm -llog -lc  -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared

and just in case - packages folder:

You need to specify which extra packages to include when we run the Android Asset Packaging Tool (aapt). Like this:

1 Like

Thanks! Now it does not crash and IS IntegrationHelper says Admob is configured correctly:

1 Like

Another issue, when I add Vungle SDK into this setup for Android as described in docs: https://developers.ironsrc.com/ironsource-mobile/android/vungle-mediation-guide/#step-5, build fails with:

Here is the repro project:

As I figured out if I comment out either

  • implementation ‘com.google.android.gms:play-services-ads:18.3.0’ or
  • implementation 'com.vungle:publisher-sdk-android:6.4.11’

in gradle dependencies, then build succeeds, but it does not look as a correct solution:

dependencies {
    // Add AdMob Network
    implementation 'com.google.android.gms:play-services-ads:18.3.0'
    implementation 'com.ironsource.adapters:admobadapter:4.3.7@jar'
    
    // Add Vungle Network
    implementation 'com.ironsource.adapters:vungleadapter:4.1.6@jar'
    implementation 'com.vungle:publisher-sdk-android:6.4.11'
}

I found two similar errors mentioned on the forum, but one of them was solved by the same addition to ext.manifest, and other was not solved.

Any ideas why these two dependencies conflict and how to solve it? In worst case I can skip Vungle and keep Admob for Android version, but would be great to find a solution.

The font provider attributes seem to exist in two dependencies. Does the build log included in the build zip give any clues?

log.txt (6.3 KB)

java -jar /opt/local/bin/manifestmergetool.jar --platform android --main /tmp/job16253509840969747362/upload/AndroidManifest.xml  --lib /tmp/job16253509840969747362/upload/ironsource/manifests/android/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.loader-loader-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-runtime-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.slidingpanelayout-slidingpanelayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-base-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-tasks-17.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.customview-customview-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.versionedparcelable-versionedparcelable-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-gass-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.drawerlayout-drawerlayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.documentfile-documentfile-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.vungle-publisher-sdk-android-6.4.11.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.swiperefreshlayout-swiperefreshlayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-sdk-api-17.1.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-core-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.arch.core-core-runtime-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-ui-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.interpolator-interpolator-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.viewpager-viewpager-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/android.arch.lifecycle-runtime-1.1.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-utils-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.asynclayoutinflater-asynclayoutinflater-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.localbroadcastmanager-localbroadcastmanager-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.fragment-fragment-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.cursoradapter-cursoradapter-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-identifier-17.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-viewmodel-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-core-utils-27.1.1.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.print-print-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-base-17.1.0.aar/AndroidManifest.xml  --out /tmp/job16253509840969747362/build/AndroidManifest.xml

aapt package -f --extra-packages com.google.android.gms.common -m --auto-add-overlay -M /tmp/job16253509840969747362/build/AndroidManifest.xml -I /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/share/java/android.jar -J /tmp/job16253509840969747362/build/rjava  -S /tmp/job16253509840969747362/upload/packages/com.defold.android/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/res  -S /tmp/.gradle/unpacked/com.vungle-publisher-sdk-android-6.4.11.aar/res  -S /tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res  -S /tmp/.gradle/unpacked/android.arch.lifecycle-runtime-1.1.0.aar/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/res  -S /tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-core-utils-27.1.1.aar/res  -S /tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/res 
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:7: error: Attribute "fontProviderAuthority" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:7: error: Attribute "fontProviderPackage" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:7: error: Attribute "fontProviderQuery" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:7: error: Attribute "fontProviderCerts" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:7: error: Attribute "fontProviderFetchStrategy" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:12: error: Attribute "fontProviderFetchTimeout" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:16: error: Attribute "fontStyle" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:19: error: Attribute "font" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:19: error: Attribute "fontWeight" has already been defined

/tmp/.gradle/unpacked/com.android.support-support-compat-27.1.1.aar/res/values/values.xml:7: error: Attribute “fontProviderPackage” has already been defined

Ok, it seems, like some com.android.support libs were added twice, but what can I do with this information from my side?

Ahhhh… Here was a note, that Vungle did not switch to new flow required for AndroidX, something about switching from support libs to other way (I don’t really understand what is the change): https://developers.ironsrc.com/ironsource-mobile/android/mediation-networks-android/#step-2

Sooo, the case is solved, Vungle goes to the trash, thanks everyone for helping. :handshake:

1 Like

And I just checked Vungle docs and there are some instructions under “early access” topic for Vungle + Admob with Google SDK 18.3.0: https://support.vungle.com/hc/en-us/articles/360027517832

So, probably it’s possible to merge Admob with Vungle SDK 6.5.2, but as it’s not officially supported by IronSource mediation, I’ll just skip it for now. Mentioning just in case if someone faces the same issues and want to solve it on his own risk.

1 Like

Another issue, now with defold’s facebook extension. When there is Admob as an adapter for IronSource and facebook SDK as extension (not FB Ads, only FB core) - I face the same error as was with Vungle:

But I believe facebook extension is ready for AndroidX and this should not happen?

log.txt (8.9 KB)

java -jar /opt/local/bin/manifestmergetool.jar --platform android --main /tmp/job5445286329317806100/upload/AndroidManifest.xml  --lib /tmp/job5445286329317806100/upload/ironsource/manifests/android/AndroidManifest.xml  --lib /tmp/job5445286329317806100/upload/facebook/manifests/android/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.loader-loader-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-runtime-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-share-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.slidingpanelayout-slidingpanelayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-base-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-tasks-17.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.customview-customview-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-vector-drawable-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.versionedparcelable-versionedparcelable-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-fragment-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-customtabs-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-v4-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-gass-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.drawerlayout-drawerlayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.documentfile-documentfile-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.swiperefreshlayout-swiperefreshlayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-cardview-v7-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-media-compat-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-sdk-api-17.1.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-core-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-livedata-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.arch.core-core-runtime-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-ui-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-applinks-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.interpolator-interpolator-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.viewpager-viewpager-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-core-utils-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.legacy-legacy-support-core-utils-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/android.arch.lifecycle-runtime-1.0.3.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.asynclayoutinflater-asynclayoutinflater-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-animated-vector-drawable-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.localbroadcastmanager-localbroadcastmanager-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.fragment-fragment-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.cursoradapter-cursoradapter-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-identifier-17.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.lifecycle-lifecycle-viewmodel-2.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-messenger-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-support-core-ui-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-places-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-core-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.support-appcompat-v7-27.0.2.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-common-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.print-print-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.facebook.android-facebook-login-5.9.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.google.android.gms-play-services-measurement-base-17.1.0.aar/AndroidManifest.xml  --out /tmp/job5445286329317806100/build/AndroidManifest.xml

aapt package -f --extra-packages com.google.android.gms.common:com.facebook:com.facebook.common:com.facebook.login:com.facebook.share -m --auto-add-overlay -M /tmp/job5445286329317806100/build/AndroidManifest.xml -I /var/extender/sdk/5295afb3878441fb12f497df8831148525dcfb10/defoldsdk//ext/share/java/android.jar -J /tmp/job5445286329317806100/build/rjava  -S /tmp/job5445286329317806100/upload/packages/com.defold.android/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-lite-18.3.0.aar/res  -S /tmp/.gradle/unpacked/com.facebook.android-facebook-share-5.9.0.aar/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-basement-17.0.0.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-vector-drawable-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-fragment-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-customtabs-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-v4-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-cardview-v7-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-media-compat-27.0.2.aar/res  -S /tmp/.gradle/unpacked/androidx.coordinatorlayout-coordinatorlayout-1.0.0.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-core-utils-27.0.2.aar/res  -S /tmp/.gradle/unpacked/android.arch.lifecycle-runtime-1.0.3.aar/res  -S /tmp/.gradle/unpacked/com.android.support-animated-vector-drawable-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.google.android.gms-play-services-ads-18.3.0.aar/res  -S /tmp/.gradle/unpacked/androidx.browser-browser-1.0.0.aar/res  -S /tmp/.gradle/unpacked/com.facebook.android-facebook-messenger-5.9.0.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-support-core-ui-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.android.support-appcompat-v7-27.0.2.aar/res  -S /tmp/.gradle/unpacked/com.facebook.android-facebook-common-5.9.0.aar/res  -S /tmp/.gradle/unpacked/com.facebook.android-facebook-login-5.9.0.aar/res  -S /tmp/.gradle/unpacked/androidx.core-core-1.0.0.aar/res 
/tmp/.gradle/unpacked/com.android.support-appcompat-v7-27.0.2.aar/res/values/values.xml:132: error: Attribute "alpha" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:7: error: Attribute "fontProviderAuthority" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:7: error: Attribute "fontProviderPackage" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:7: error: Attribute "fontProviderQuery" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:7: error: Attribute "fontProviderCerts" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:7: error: Attribute "fontProviderFetchStrategy" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:12: error: Attribute "fontProviderFetchTimeout" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:16: error: Attribute "fontStyle" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:19: error: Attribute "font" has already been defined
/tmp/.gradle/unpacked/com.android.support-support-compat-27.0.2.aar/res/values/values.xml:19: error: Attribute "fontWeight" has already been defined

Here is the repro project:

No, AndroidX support seems to have been added to the Facebook SDK only very recently:

I don’t think it has reached a public release yet.

1 Like

Ohh, ok, I see, thanks… Then, if choosing between Facebook and Admob, I’ll drop Admob support for now and keep working on the Android port.

Classic Android development experience :confused:

1 Like