Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError in Android 9 (Pie)

Tags:

android

I have following error in Android 9 (Pie) I don't get where is the error I think its related to google gms libs.

java.lang.NoClassDefFoundError: 
  at fa.b (com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-219897028):3)
  at ez.a (com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-219897028):3)
  at fb.a (com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-219897028):15)
  at com.google.maps.api.android.lib6.drd.al.a (com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-219897028):6)
  at ee.a (com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-219897028):21)
  at ee.run (com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-219897028):8)
Caused by: java.lang.ClassNotFoundException: 
  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-219897028):4)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
like image 525
code4rox Avatar asked Feb 17 '26 20:02

code4rox


1 Answers

Here is official docs

If you are using com.google.android.gms:play-services-maps:16.0.0 or below and your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration within the element of AndroidManifest.xml.

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

This is handled for you if you are using com.google.android.gms:play-services-maps:16.1.0 and is not necessary if your app is targeting a lower API level.

and also add this tag in Menifest.xml

<application
.....
.....
android:usesCleartextTraffic="true">

if you are using send and received request to server like (Volley , retrofit and Http request)

Also try this one (optional)

convert the project to AndroidX make sure backup of project first.

like image 105
code4rox Avatar answered Feb 20 '26 11:02

code4rox