I tried to generate an apk using proguard, but I've got this error while trying to build:
Warning: com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy
Warning: there were 3 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
:app:proguardRelease FAILED
Error:Execution failed for task ':app:proguardRelease'.
java.io.IOException: Please correct the above warnings first.
Recently, I upgraded my Android SDK Tools. Before it, this project presented no problems with proguard. I found this post (https://plus.google.com/+PaulBurke/posts/T3vmAnRP3q6) where Oliver Renner wrote:
"So basically the next Google library that may not be upgraded to the latest version. It also seems to require compileSdk 23 in order to be able to use ProGuard without modifications (Warning: com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy)"*
I updated my project to compile using SDK 23, but the problem wasn't solved.
Bellow, I included some parts of my build.gradle file:
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.sample.sample"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}
.
.
.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:design:23.0.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.0@aar') {
transitive = true;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…