问题描述
今天我在尝试运行我的应用程序时发现了这个错误.我做了以下尝试来解决它.- 首先我删除了 multidex 支持,但我仍然可以在那里看到 apk 的切片.-i 还尝试重建整个项目,并按照 java.lang.NoClassDefFoundError: 解析失败:Landroid/support/v4/util/ArrayMap
Today i found this error while trying to run my app. I made the following attempts towards solving it. - First i removed multidex support, but i can still see the slices of apk there. -i also attempted rebuilding the entire project, and updated the android support and play services libraries to the latest as recommended by java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap
Android Studio - NoClassDefFoundError:Landroid/support 解析失败/v4/print/PrintHelper
java.lang.NoClassDefFoundError: 失败分辨率:Landroid/support/v4/os/BuildCompat.
NoClassDefFoundError: android.support.v4.util.ArrayMap
stacktrace如下
The stacktrace is as follows
这是我的 gradle 文件
Here is my gradle file
我的自定义库有以下作为他们的 gradle
My custom libraries have the following as their gradle
第二个是
请让我坚持下去
我通过执行以下操作解决了这个问题.
I solved this by doing the following.
- 在播放服务库模块中选择所需的确切包.
- 确保没有重复的支持库.
- 清理并重建项目.
- 将库源保留在 64k 方法下,因此需要 multidex.
推荐答案
我在使用 Flutter
时遇到了同样的问题,当我搜索我的错误时,这个问题是 Google 上的第一个链接:
I faced the same problem with Flutter
and this question was the first link on Google when I searched my error:
所以你的问题的根源可能是相同的:AndroidX
适配.将这些行添加到 gradle.properties
解决了我的问题:
So the root of your problem might be same: AndroidX
adaptation. Adding those lines to gradle.properties
fixed my problem:
您可能还想将 compileSdkVersion 28
添加到您的 app-level build.gradle
文件中.更多信息
You may also want to add compileSdkVersion 28
to your app-level build.gradle
file.
For further information
这篇关于java.lang.NoClassDefFoundError:解析失败:Landroid/support/v4/util/ArrayMap;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!