Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my app crashes with Admob and Firebase?

I pubblished an app on google play. Then I linked it to Admob and the app works, showing me the banner of admob. Sometimes, on launch, it crashes, sometimes not. I viewed Android Studio Logcat and this is the error. Can someone help me?

Process: it.bluebait.mycurrency, PID: 13200
    java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
        at lt.b(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2)
        at ls.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1)
        at lu.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:18)
        at com.google.android.gms.ads.internal.util.ar.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:10)
        at kx.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:7)
        at kx.run(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000001f/dl-AdsFdrDynamite.integ_30000000.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000001f/n/arm64-v8a, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:169)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at ac.loadClass(:com.google.android.gms.dynamite_dynamiteloader@[email protected] (100400-239467275):4)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at lt.b(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2) 
        at ls.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1) 
        at lu.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:18) 
        at com.google.android.gms.ads.internal.util.ar.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:10) 
        at kx.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:7) 
        at kx.run(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2) 
2019-04-09 19:43:27.941 15295-15544/? E/AndroidRuntime: FATAL EXCEPTION: Thread-10
    Process: it.bluebait.mycurrency, PID: 15295
    java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
        at lt.b(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2)
        at ls.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1)
        at lu.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:18)
        at com.google.android.gms.ads.internal.util.ar.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:10)
        at kx.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:7)
        at kx.run(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000001f/dl-AdsFdrDynamite.integ_30000000.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000001f/n/arm64-v8a, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:169)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at ac.loadClass(:com.google.android.gms.dynamite_dynamiteloader@[email protected] (100400-239467275):4)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at lt.b(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2) 
        at ls.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:1) 
        at lu.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:18) 
        at com.google.android.gms.ads.internal.util.ar.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:10) 
        at kx.a(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:7) 
        at kx.run(:com.google.android.gms.policy_ads_fdr_dynamite@[email protected]:2) 
2019-04-09 19:43:27.953 563-563/? E/SELinux: avc:  denied  { find } for service=opdiagnose pid=15295 uid=10236 scontext=u:r:untrusted_app:s0:c236,c256,c512,c768 tcontext=u:object_r:opdiagnose_service:s0 tclass=service_manager permissive=0
2019-04-09 19:43:27.956 563-563/? E/SELinux: avc:  denied  { find } for service=opdiagnose pid=15295 uid=10236 scontext=u:r:untrusted_app:s0:c236,c256,c512,c768 tcontext=u:object_r:opdiagnose_service:s0 tclass=service_manager permissive=0
like image 246
Edoardo Colella Avatar asked Apr 09 '19 17:04

Edoardo Colella


1 Answers

Android 9.0 finally removed by default all traces of the old Apache HTTP library. However it seems that some libraries need it. You need to add this to your manifest inside the <application> element:

<uses-library
    android:name="org.apache.http.legacy"
    android:required="false"/>

Source: https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p

like image 147
niqueco Avatar answered Sep 26 '22 03:09

niqueco