Proguard error, can't export app - android

[2013-01-25 15:20:55 - CQAQI] Proguard returned with error code 1. See console
[2013-01-25 15:20:55 - CQAQI] Note: there were 208 duplicate class definitions.
[2013-01-25 15:20:55 - CQAQI] Warning: android.support.v4.view.ViewCompatJellybeanMr1: can't find referenced method 'int getLabelFor()' in class android.view.View
[2013-01-25 15:20:55 - CQAQI] Warning: android.support.v4.view.ViewCompatJellybeanMr1: can't find referenced method 'void setLabelFor(int)' in class android.view.View
[2013-01-25 15:20:55 - CQAQI] Warning: there were 2 unresolved references to program class members.
[2013-01-25 15:20:55 - CQAQI] Your input classes appear to be inconsistent.
[2013-01-25 15:20:55 - CQAQI] You may need to recompile them and try again.
[2013-01-25 15:20:55 - CQAQI] Alternatively, you may have to specify the option
[2013-01-25 15:20:55 - CQAQI] '-dontskipnonpubliclibraryclassmembers'.
[2013-01-25 15:20:55 - CQAQI] Error: Please correct the above warnings first.
When I export app I get an error, even after updating to Proguard 4.8. What can I do?

try this:
-dontwarn android.support.v4.view.**
-keep class android.support.v4.** { *; }

I had the same error.
Building with SDK level 4.2.2 worked for me!

Related

Warning: com.google.android.gms.internal.zzig: can't find referenced class android.security.NetworkSecurityPolicy

I'm exporting android application (in Eclipse) and get the following error:
[2016-07-31 09:21:57 - EnglishPhonics] Proguard returned with error code 1. See console
[2016-07-31 09:21:57 - EnglishPhonics] Warning: com.google.android.gms.internal.zzig: can't find referenced class android.security.NetworkSecurityPolicy
[2016-07-31 09:21:57 - EnglishPhonics] Warning: com.google.android.gms.internal.zzig: can't find referenced class android.security.NetworkSecurityPolicy
[2016-07-31 09:21:57 - EnglishPhonics] Warning: com.google.android.gms.internal.zzig: can't find referenced class android.security.NetworkSecurityPolicy
[2016-07-31 09:21:57 - EnglishPhonics] You should check if you need to specify additional program jars.
[2016-07-31 09:21:57 - EnglishPhonics] Warning: there were 3 unresolved references to classes or interfaces.
[2016-07-31 09:21:57 - EnglishPhonics] You may need to specify additional library jars (using '-libraryjars').
[2016-07-31 09:21:57 - EnglishPhonics] java.io.IOException: Please correct the above warnings first.
[2016-07-31 09:21:57 - EnglishPhonics] at proguard.Initializer.execute(Initializer.java:321)
[2016-07-31 09:21:57 - EnglishPhonics] at proguard.ProGuard.initialize(ProGuard.java:211)
[2016-07-31 09:21:57 - EnglishPhonics] at proguard.ProGuard.execute(ProGuard.java:86)
[2016-07-31 09:21:57 - EnglishPhonics] at proguard.ProGuard.main(ProGuard.java:492)
I'm using Google Billing service with lastest version. Does anyone know how to solve this problem?

Android: Proguard error in eclipse

I am trying to built the signed apk of my app. But i am getting the error pop up as
Proguard returned with error code 1. See console
And error log in console as :
[2016-04-15 11:36:44 - MyApp] Proguard returned with error code 1. See console
[2016-04-15 11:36:44 - MyApp] Note: there were 85 duplicate class definitions.
[2016-04-15 11:36:44 - MyApp] Warning: org.acra.ErrorReporter: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in class android.app.Notification
[2016-04-15 11:36:44 - MyApp] You should check if you need to specify additional program jars.
[2016-04-15 11:36:44 - MyApp] Warning: there were 1 unresolved references to program class members.
[2016-04-15 11:36:44 - MyApp] Your input classes appear to be inconsistent.
[2016-04-15 11:36:44 - MyApp] You may need to recompile them and try again.
[2016-04-15 11:36:44 - MyApp] Alternatively, you may have to specify the option
[2016-04-15 11:36:44 - MyApp] '-dontskipnonpubliclibraryclassmembers'.
[2016-04-15 11:36:44 - MyApp] java.io.IOException: Please correct the above warnings first.
[2016-04-15 11:36:44 - MyApp] at proguard.Initializer.execute(Initializer.java:321)
[2016-04-15 11:36:44 - MyApp] at proguard.ProGuard.initialize(ProGuard.java:211)
[2016-04-15 11:36:44 - MyApp] at proguard.ProGuard.execute(ProGuard.java:86)
[2016-04-15 11:36:44 - MyApp] at proguard.ProGuard.main(ProGuard.java:492)
I am not able to understand what is the issue. For last version it works fine. I just provide support to Marsh Mellow in this version.
Please suggest me what changes or steps to perform to built signed apk with out Proguard error.
Try to add this to Proguard configuration file:
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn android.net.**

Android - can't export apk with Proguard, when using Joda Time

I use joda-time.jar in my app, and when exporting signed apk proguard saying something like (it is pretty common problem as I can see, when I look over internet):
[2014-01-07 12:44:53 - XYZ] Proguard returned with error code 1. See console
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.DateMidnight: can't find referenced class org.joda.convert.FromString
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.DateTime: can't find referenced class org.joda.convert.FromString
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.Days: can't find referenced class org.joda.convert.FromString
...
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.Years: can't find referenced class org.joda.convert.FromString
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.Years: can't find referenced class org.joda.convert.ToString
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.base.AbstractDuration: can't find referenced class org.joda.convert.ToString
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.base.AbstractInstant: can't find referenced class org.joda.convert.ToString
[2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.base.AbstractPeriod: can't find referenced class org.joda.convert.ToString
[2014-01-07 12:44:53 - XYZ] You should check if you need to specify additional program jars.
[2014-01-07 12:44:53 - XYZ] Warning: there were 37 unresolved references to classes or interfaces.
[2014-01-07 12:44:53 - XYZ] You may need to specify additional library jars (using '-libraryjars').
[2014-01-07 12:44:53 - XYZ] java.io.IOException: Please correct the above warnings first.
[2014-01-07 12:44:53 - XYZ] at proguard.Initializer.execute(Initializer.java:321)
[2014-01-07 12:44:53 - XYZ] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-01-07 12:44:53 - XYZ] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-01-07 12:44:53 - XYZ] at proguard.ProGuard.main(ProGuard.java:492)
Everywhere in forums or also here (Android - Proguard didn't compile with Joda Time jar file) they say solution should be downloading joda-convert.jar, adding to buildpath. But for me it just DOESN'T WORK, after I did it, proguard again says something similar:
[2014-01-07 12:41:39 - XYZ] Proguard returned with error code 1. See console
[2014-01-07 12:41:39 - XYZ] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter
[2014-01-07 12:41:39 - XYZ] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter
[2014-01-07 12:41:39 - XYZ] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter
[2014-01-07 12:41:39 - XYZ] You should check if you need to specify additional program jars.
[2014-01-07 12:41:39 - XYZ] Warning: there were 3 unresolved references to classes or interfaces.
[2014-01-07 12:41:39 - XYZ] You may need to specify additional library jars (using '-libraryjars').
[2014-01-07 12:41:39 - XYZ] java.io.IOException: Please correct the above warnings first.
[2014-01-07 12:41:39 - XYZ] at proguard.Initializer.execute(Initializer.java:321)
[2014-01-07 12:41:39 - XYZ] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-01-07 12:41:39 - XYZ] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-01-07 12:41:39 - XYZ] at proguard.ProGuard.main(ProGuard.java:492)
How to fix this issue? I spend few hours of trying everything, but I just can't find it out...Many thanks!
Ok I figured it out. Actually adding joda-convert.jar to build path works, but only for older version (1.4 and lower, if you download latest one - 1.5 joda-convert.jar, it doesn't work)...

Implementing Proguard Security with my APK

I want to configure proguard with my Application. But while doing so I am receiving the following problems :
[2013-09-24 12:27:46 - DemoProguard] Proguard returned with error code 1. See console
[2013-09-24 12:27:46 - DemoProguard] Warning: com.google.android.gms.internal.bn$b: can't find referenced method 'android.view.Display getDisplay()' in class android.view.View
[2013-09-24 12:27:46 - DemoProguard] Warning: com.google.android.gms.internal.bn$b: can't find referenced method 'void removeOnGlobalLayoutListener(android.view.ViewTreeObserver$OnGlobalLayoutListener)' in class android.view.ViewTreeObserver
[2013-09-24 12:27:46 - DemoProguard] You should check if you need to specify additional program jars.
[2013-09-24 12:27:46 - DemoProguard] Warning: there were 2 unresolved references to program class members.
[2013-09-24 12:27:46 - DemoProguard] Your input classes appear to be inconsistent.
[2013-09-24 12:27:46 - DemoProguard] You may need to recompile them and try again.
[2013-09-24 12:27:46 - DemoProguard] Alternatively, you may have to specify the option
[2013-09-24 12:27:46 - DemoProguard] '-dontskipnonpubliclibraryclassmembers'.
[2013-09-24 12:27:46 - DemoProguard] java.io.IOException: Please correct the above warnings first.
[2013-09-24 12:27:46 - DemoProguard] at proguard.Initializer.execute(Initializer.java:321)
[2013-09-24 12:27:46 - DemoProguard] at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-09-24 12:27:46 - DemoProguard] at proguard.ProGuard.execute(ProGuard.java:86)
[2013-09-24 12:27:46 - DemoProguard] at proguard.ProGuard.main(ProGuard.java:492)
[2013-09-24 12:40:50 - DemoProguard] Proguard returned with error code 1. See console
[2013-09-24 12:40:50 - DemoProguard] Warning: com.google.android.gms.internal.bn$b: can't find referenced method 'android.view.Display getDisplay()' in class android.view.View
[2013-09-24 12:40:50 - DemoProguard] Warning: com.google.android.gms.internal.bn$b: can't find referenced method 'void removeOnGlobalLayoutListener(android.view.ViewTreeObserver$OnGlobalLayoutListener)' in class android.view.ViewTreeObserver
[2013-09-24 12:40:50 - DemoProguard] You should check if you need to specify additional program jars.
[2013-09-24 12:40:50 - DemoProguard] Warning: there were 2 unresolved references to program class members.
[2013-09-24 12:40:50 - DemoProguard] Your input classes appear to be inconsistent.
[2013-09-24 12:40:50 - DemoProguard] You may need to recompile them and try again.
[2013-09-24 12:40:50 - DemoProguard] Alternatively, you may have to specify the option
[2013-09-24 12:40:50 - DemoProguard] '-dontskipnonpubliclibraryclassmembers'.
[2013-09-24 12:40:50 - DemoProguard] java.io.IOException: Please correct the above warnings first.
[2013-09-24 12:40:50 - DemoProguard] at proguard.Initializer.execute(Initializer.java:321)
[2013-09-24 12:40:50 - DemoProguard] at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-09-24 12:40:50 - DemoProguard] at proguard.ProGuard.execute(ProGuard.java:86)
[2013-09-24 12:40:50 - DemoProguard] at proguard.ProGuard.main(ProGuard.java:492)
Here is my proguard-text file
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
-dontskipnonpubliclibraryclassmembers
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
try to add these line very first on our proguard.cfg file on your project as below:
-ignorewarnings
if you have any annotation in your project so, please add the next line as below
-keepattributes *Annotation*
and ensure your gradle file has minifyEnabled as false

Android Proguard - Internet connectivity issue after exporting application

I am currently exporting application while proguard is enabled and the issue is that the application works fine but application is deployed without proguard but if exported and deployed while proguard is enabled the application gives error that internet is not connected. following is the proguard file text
-dontshrink
-dontoptimize
-dontwarn com.example.google.tv.**
-dontwarn android.support.**
-dontwarn org.ksoap.**
-dontwarn android.view.**
-dontwarn android.graphics.**
-dontwarn android.content.**
-dontwarn android.util.**
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
#-libraryjars libs/ksoap2-android-assembly-2.5.2-jar-with-dependencies.jar
#-libraryjars libs/android-support-v4.jar
If I remove
-dontwarn android.view.**
-dontwarn android.graphics.**
-dontwarn android.content.**
-dontwarn android.util.**
then here is the log that I receive
[2013-08-02 10:29:04 - Project] Proguard returned with error code 1. See console
[2013-08-02 10:29:04 - Project] Note: there were 4 duplicate class definitions.
[2013-08-02 10:29:04 - Project] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlSerializer
[2013-08-02 10:29:04 - Project] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.content.res.ColorStateList depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.BitmapDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.ColorDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.LayerDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] You should check if you need to specify additional program jars.
[2013-08-02 10:29:04 - Project] Warning: there were 13 instances of library classes depending on program classes.
[2013-08-02 10:29:04 - Project] You must avoid such dependencies, since the program classes will
[2013-08-02 10:29:04 - Project] be processed, while the library classes will remain unchanged.
[2013-08-02 10:29:04 - Project] java.io.IOException: Please correct the above warnings first.
[2013-08-02 10:29:04 - Project] at proguard.Initializer.execute(Initializer.java:321)
[2013-08-02 10:29:04 - Project] at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-08-02 10:29:04 - Project] at proguard.ProGuard.execute(ProGuard.java:86)
[2013-08-02 10:29:04 - Project] at proguard.ProGuard.main(ProGuard.java:492)
You should remove the package org.xmlpull.v1 from your libraries. It is already present in the Android runtime (which gets precedence anyway). Adding duplicate packages increases the application size at best, and it can cause versioning problems at worst. In this case, ProGuard detects some dependency conflicts.
Note that is "ProGuard", not "Progaurd".

Categories

Resources