1

I just enable proguard in my project . After that i run the apk successfully by using debug apk.

When I try to creating a signed Apk am getting an error

Error:Execution failed for task ':app:proguardRelease'.
 > java.io.IOException: Please correct the above warnings first.

My Gradle file like this

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.android4dev.navigationview"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:22.1.1'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.google.android.gms:play-services:8.1.0'

}

Warning

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.

I tried -dontwarn org.apache.lang.**, but still am getting the same issue

Can any please help me to recover this problem.

Binil Surendran
  • 2,524
  • 6
  • 35
  • 58

2 Answers2

0

For your google play services proguard problem refer here com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy

And also try to resolve the manifest duplication issues or you can disable lint in release build.. to disable the lint check in release build add this to your build.gradle file

lintOptions {
        checkReleaseBuilds false
    } 

try updating the play services version in build.gradle

compile 'com.google.android.gms:play-services-analytics:8.3.0'
Community
  • 1
  • 1
Dinesh Kannan
  • 1,255
  • 13
  • 32
0

According to the warning log that you have posted, it seems that the warning came from the package com.google.android.gms.internal.zzhu and not from org.apache.lang.

So to remove the warning add this in your proguard-rules.pro.

-dontwarn com.google.android.**

Tell us what happened then!

Yogesh
  • 444
  • 4
  • 12