gpt4 book ai didi

java - 三星和 wiko 的 Android appCompat 问题

转载 作者:太空宇宙 更新时间:2023-11-03 10:18:43 25 4
gpt4 key购买 nike

目前我的应用程序有点问题,在大多数设备上一切正常,但在某些三星和 wiko 上我收到此错误: java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder

我在网上看到了一些答案,他们说要在混淆文件中添加下面这行,在我的例子中这是行不通的

 -keep class !android.support.v7.internal.view.menu.**, ** { *; }

我的应用程序由 2 个模块组成(所以我有 2 个 proguard 文件),1 个模块用于主应用程序,另一个用于库

这是我的 thr 应用模块的 gradle 文件:

 apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.refresh.quickeer"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug
{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:22.+'
compile 'com.android.support:palette-v7:21.0.0'
compile 'com.xgc1986.android:parallaxpagertransformer:1.0.3'
compile project(':library')
}

enter image description here有人可以解决这个问题吗?

最佳答案

在遇到这个问题之前,我没有在我的应用程序上使用混淆器。我通过设置 minifyEnabled true 并使用以下混淆器配置解决了这个问题

-dontshrink    
-keep class !android.support.v7.internal.view.menu.**,** {*;}
-keepattributes **
-dontwarn **

我在 appthwack 上测试了我的应用程序在此修复之前和之后验证它是否有效。

关于java - 三星和 wiko 的 Android appCompat 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29871727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com