在除 android L 之外的所有 android 版本上获取 TypeNotPresentException 后跟 ClassNotFoundException 或 NoClassDefFoundError
Getting TypeNotPresentException followed by ClassNotFoundException or NoClassDefFoundError on All android versions except android L
我的一个应用程序中出现了非常有趣的错误。我的应用程序在 android L 上运行良好,但是当我尝试在其他 android 版本上 运行 它时,我收到 ClassNotFoundException 或 NoClassDefFoundError 在尝试使用 Retrofit 调用 Web 服务时,即使所有这些 类 都存在并且在我的 android L 设备上运行良好。我不知道现在发生了什么,应用程序在其他版本中 运行ning 只要我不发出网络请求,但只要我去网络请求,它就会给我 ClassNotFoundException 或 NoClassDefFoundError。另外我正在使用 Android Studio,所以如果有人之前遇到过这种问题,那么请帮忙,我非常需要。
注意:应用程序在 Android L 和 类 上运行良好,其中我得到的 ClassNotFoundException 或 NoClassDefFoundError 不是特定于版本的,即它们在 [=33] 中不受支持=] L左右。我收到这些错误的所有 类 都是一般性的 custom/model 类 并且没有 link 更高的 android 版本或其他东西。
这些是我的 Logcat 错误
这是点击登录时的异常api
java.lang.TypeNotPresentException: Type com.codebrew.embazaar.pojo.UserLoginPojo not present
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:63)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.codebrew.embazaar.pojo.UserLoginPojo
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:61)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com/codebrew/embazaar/pojo/UserLoginPojo
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:61)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.codebrew.embazaar.pojo.UserLoginPojo" on path: DexPathList[[zip file "/data/app/com.codebrew.embazaar-11.apk"],nativeLibraryDirectories=[/data/app-lib/com.codebrew.embazaar-11, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:61)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
这是我在点击忘记密码网络请求时得到的
java.lang.NoClassDefFoundError: com.codebrew.embazaar.MainActivity
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:392)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
**重要提示:当我调试我的代码时,我得到了 TypeNotPresentException,这是一个未经检查的异常,后跟这些 ClassNotFoundException 或 NoClassDefFoundError。我在这里提到这个是因为我认为这件事可以让我的 question/problem.
更清晰一些
这是我的MainActivity CommonPojo and gradle file
这是因为你有
multiDexEnabled = true
在您的 gradle 文件中。
启用 multidex 时,必须确保在应用程序启动时加载所有 classes.dex 文件。否则它将无法加载不在第一个 classes.dex 文件中的 类。
AndroidL不需要这个,因为它支持在启动时加载多个dex文件,而不是一个。
为此,您可以尝试以下方法之一:
- 删除
multiDexEnabled = true
,但您可能会超过 65K 方法限制。
按照 https://developer.android.com/tools/building/multidex.html 上的说明进行操作,特别是添加
compile 'com.android.support:multidex:1.0.0'
依赖,并使您的应用程序对象继承或开始于 MultiDexApplication
。
我的一个应用程序中出现了非常有趣的错误。我的应用程序在 android L 上运行良好,但是当我尝试在其他 android 版本上 运行 它时,我收到 ClassNotFoundException 或 NoClassDefFoundError 在尝试使用 Retrofit 调用 Web 服务时,即使所有这些 类 都存在并且在我的 android L 设备上运行良好。我不知道现在发生了什么,应用程序在其他版本中 运行ning 只要我不发出网络请求,但只要我去网络请求,它就会给我 ClassNotFoundException 或 NoClassDefFoundError。另外我正在使用 Android Studio,所以如果有人之前遇到过这种问题,那么请帮忙,我非常需要。
注意:应用程序在 Android L 和 类 上运行良好,其中我得到的 ClassNotFoundException 或 NoClassDefFoundError 不是特定于版本的,即它们在 [=33] 中不受支持=] L左右。我收到这些错误的所有 类 都是一般性的 custom/model 类 并且没有 link 更高的 android 版本或其他东西。
这些是我的 Logcat 错误
这是点击登录时的异常api
java.lang.TypeNotPresentException: Type com.codebrew.embazaar.pojo.UserLoginPojo not present
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:63)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.codebrew.embazaar.pojo.UserLoginPojo
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:61)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com/codebrew/embazaar/pojo/UserLoginPojo
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:61)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.codebrew.embazaar.pojo.UserLoginPojo" on path: DexPathList[[zip file "/data/app/com.codebrew.embazaar-11.apk"],nativeLibraryDirectories=[/data/app-lib/com.codebrew.embazaar-11, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at libcore.reflect.ParameterizedTypeImpl.getRawType(ParameterizedTypeImpl.java:61)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:72)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.ParameterizedTypeImpl.getResolvedType(ParameterizedTypeImpl.java:71)
at libcore.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:70)
at libcore.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:55)
at libcore.reflect.Types.getTypeArray(Types.java:50)
at java.lang.reflect.Method.getGenericParameterTypes(Method.java:216)
at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:250)
at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
at $Proxy0.userLogin(Native Method)
at com.codebrew.embazaar.MainActivity.loginUser(MainActivity.java:529)
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:324)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
这是我在点击忘记密码网络请求时得到的
java.lang.NoClassDefFoundError: com.codebrew.embazaar.MainActivity
at com.codebrew.embazaar.MainActivity.onClick(MainActivity.java:392)
at android.view.View.performClick(View.java:4748)
at android.view.View$PerformClick.run(View.java:19535)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5679)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
**重要提示:当我调试我的代码时,我得到了 TypeNotPresentException,这是一个未经检查的异常,后跟这些 ClassNotFoundException 或 NoClassDefFoundError。我在这里提到这个是因为我认为这件事可以让我的 question/problem.
更清晰一些这是我的MainActivity CommonPojo and gradle file
这是因为你有
multiDexEnabled = true
在您的 gradle 文件中。
启用 multidex 时,必须确保在应用程序启动时加载所有 classes.dex 文件。否则它将无法加载不在第一个 classes.dex 文件中的 类。
AndroidL不需要这个,因为它支持在启动时加载多个dex文件,而不是一个。
为此,您可以尝试以下方法之一:
- 删除
multiDexEnabled = true
,但您可能会超过 65K 方法限制。 按照 https://developer.android.com/tools/building/multidex.html 上的说明进行操作,特别是添加
compile 'com.android.support:multidex:1.0.0'
依赖,并使您的应用程序对象继承或开始于
MultiDexApplication
。