Msgstr "After adding" libs / mpandroidchartlibrary-2-1-6.jar "

eI found this error after adding compilation files ('libs / mpandroidchartlibrary-2-1-6.jar'). It works correctly before adding mpandroidchartlibrary-2-1-6.jar

FATAL EXCEPTION: main Process: com.pnp.papps.schoob, PID: 11781 java.lang.NoClassDefFoundError: com.google.android.gms.R $ string at com.google.android.gms.measurement.zza. (Unknown source) at com.google.android.gms.measurement.zza.zzaR (Unknown source) at com.google.android.gms.measurement.internal.zzn.zziJ (Unknown source) at com.google.android.gms .measurement.internal.zzz.zza (Unknown source) at com.google.android.gms.measurement.internal.zzw. (Unknown source) at com.google.android.gms.measurement.internal.zzaa.zzDj (Unknown source) at com.google.android.gms.measurement.internal.zzw.zzaT (Unknown source) at com.google.android .gms.measurement.AppMeasurementContentProvider.onCreate (unknown source) at android.content.ContentProvider.attachInfo (ContentProvider.java:1616) at android.content.ContentProvider.attachInfo (ContentProvider.java:1587) in android.app.ActivityThread (ActivityThread.java-00-00 868) at android.app.ActivityThread.installContentProviders (ActivityThread.java:4463) at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4403) at android.app.ActivityThread.access $ 1500 (ActivityThread.java:138) at android .app.ActivityThread $ H.handleMessage (ActivityThread.java:1259) on android.os.Handler.dispatchMessage (Handler.java:102) on android.os.Looper.loop (Looper.java:136) in android.app. ActivityThread.main (ActivityThread.java:5095) in java.lang.reflect.Method.invokeNative (native method) in java.lang.reflect.Method.invoke (Method.javahaps1515) at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 786) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:602) in dalvik.system.NativeStart.main (native method)

**

I found this error after adding compilation files ('LIES / mpandroidchartlibrary-2-1-6.jar'). It works properly for adding mpandroidchartlibrary-2-1-6.jar.

**

+2
source share
4 answers

** Finally, this work is for me ..

-> Setting up your application for Multidex using Gradle. http://developer.android.com/tools/building/multidex.html#mdex-gradle **

1) Change your manifest to reference the MultiDexApplication class

android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { minSdkVersion 14 targetSdkVersion 21 multiDexEnabled true } dependencies { compile 'com.android.support:multidex:1.0.0' } 

'}'

** 2) In the manifest, add the MultiDexApplication class from the multidex support library to the application element.

Add the following line to the application tag of the manifest file. **

 <application android:name="android.support.multidex.MultiDexApplication"> 
+12
source

In the manifest → application add the line below

  android:name="android.support.multidex.MultiDexApplication" 

Note. If you already have an application class, just extend this application class with MultiDexApplication

+3
source

In the app build.gradle file

 android { defaultConfig { multiDexEnabled true } } dependencies { compile 'com.android.support:multidex:1.0.1' } 

than in your Application class, extends the MultiDexApplication class

  public class myApplication extends MultiDexApplication { @Override public void onCreate() { super.onCreate(); } } 

than in your manifest add class myApplication

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.demo.application"> <application .... android:name=".myApplication"> .... </application> 

0
source

If the problem persists even after you turn on multidex, and all make sure that you compiled SDkVersion compatible with the build tools ...

I'm not sure, but I had some kind of application with this, and the problem continued:

 compileSdkVersion 25 buildToolsVersion "26.0.2" 

It worked after switching to something like this:

 compileSdkVersion 25 buildToolsVersion "25.0.3" 
0
source

Source: https://habr.com/ru/post/1247355/


All Articles