Android appCompat issue with samsung and wiko

I currently 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

I saw several answers on the Internet where they said add the line below to the proguard file, in my case this does not work.

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

My application consists of 2 modules (so I have 2 proguard files), 1 module is for the main application, and the other for the library

here is my gradle file for thr application 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')
}

enter image description here Anyone have a solution to this problem?

+4
source share
2 answers

, proguard . , minifyEnabled true proguard

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

appthwack , , .

+1

, , Google

java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder:

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

, v4 v7:

##################################################################################
#
# App Compat
# /questions/698691/note-androidsupportv4texticucompatics-cant-find-dynamically-referenced-class-libcoreicuicu
#
##################################################################################
-dontnote android.support.**
-dontwarn android.support.v4.**
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }
-dontwarn android.support.v7.**
# -keep class android.support.v7.** { *; }  # <-- excess notes
# -keep interface android.support.v7.** { *; }
# Allow obfuscation of android.support.v7.internal.view.menu.**
# to avoid problem on Samsung 4.2.2 devices with appcompat v21
# see https://code.google.com/p/android/issues/detail?id=78377
-keep class !android.support.v7.internal.view.menu.**,android.support.** {*;}  # <-- important

: : android.support.v4.text.ICUCompatIcs: libcore.icu.ICU https://code.google.com/p/android/issues/detail?id=78377

+1

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


All Articles