Android的appCompat问题,三星和WIKO [英] Android appCompat issue with samsung and wiko

查看:246
本文介绍了Android的appCompat问题,三星和WIKO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个小问题,我的应用程序,一切工作正常一些三星的大多数设备,但并WIKO我得到这个错误:  java.lang.NoClassDefFoundError的:android.support.v7.internal.view.menu.MenuBuilder

currently I have a little problem with my application, everything works fine on most devices but on some samsung and wiko I get this error : java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder

我在网上看到一些答案,他们说将下面一行添加在ProGuard的文件,在我的情况下,这也不行

I saw some answers on the internet where they said to add the line below in the proguard file, in my case this doesn't work

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

我的应用程序是2模块(所以我有2 ProGuard的文件)的化合物,1module是主要的应用程序,另一个是为图书馆

My app is compound of 2 modules(so I have 2 proguard file), 1module is for the main app and the other is for a library

这是我的摇篮文件THR应用模块:

here is my gradle file for thr app module:

 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')
}

是否有人有办法解决这个问题吗?

Does somebody have a solution to this problem please ?

推荐答案

在遇到此问题,我没有在我的应用程序中使用ProGuard的。我通过设置 minifyEnabled真正,并使用以下的ProGuard配置解决了这个问题。

Before encountering this issue I did not use proguard on my app. I resolved the issue by setting minifyEnabled true and using the following proguard config

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

我测试我的应用程序 appthwack 前,此修复程序后,以验证它的工作。

I tested my app on appthwack before and after this fix to verify that it worked.

这篇关于Android的appCompat问题,三星和WIKO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆