iPaulPro / aFileChooser

[DEPRECATED] Android library that provides a file explorer to let users select files on external storage.
Apache License 2.0
1.79k stars 850 forks source link

Problem with Proguard #42

Closed jaibatrik closed 7 years ago

jaibatrik commented 10 years ago

I was trying to export the example application in the project and was unable to do so. In the aFileChooserExample project, I added the following line in project.properties file -

proguard.config=proguard.cfg

Then I tried to export the project by going to Android Tools > Export signed application package. It gave the following error message -

Conversion to dalvik format failed with error 1

jaibatrik commented 10 years ago

I also observed that the issue happens with optimization options in place. If you don't put optimization options, the APK is exported.

sevar83 commented 10 years ago

Check if your ProGuard is the latest version. "Dalvik error 1" happens after update of ADT. It's stupid but it always rewrites your ProGuard with some really ancient version that gives this problem.

BTW. I have a similar problem - "Proguard returned with error code 1. See console"

[2014-04-07 13:27:35 - geocoord-app] Proguard returned with error code 1. See console [2014-04-07 13:27:35 - geocoord-app] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find superclass or interface android.provider.DocumentsProvider [2014-04-07 13:27:35 - geocoord-app] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced class android.provider.DocumentsProvider [2014-04-07 13:27:35 - geocoord-app] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced class android.provider.DocumentsProvider [2014-04-07 13:27:35 - geocoord-app] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced method 'android.database.MatrixCursor$RowBuilder add(java.lang.String,java.lang.Object)' in library class android.database.MatrixCursor$RowBuilder [2014-04-07 13:27:35 - geocoord-app] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced method 'android.content.Context getContext()' in program class com.ianhanniballake.localstorage.LocalStorageProvider [2014-04-07 13:27:35 - geocoord-app] Warning: com.ipaulpro.afilechooser.utils.FileUtils: can't find referenced class android.provider.DocumentsContract [2014-04-07 13:27:35 - geocoord-app] Warning: com.ipaulpro.afilechooser.utils.FileUtils: can't find referenced class android.provider.DocumentsContract [2014-04-07 13:27:35 - geocoord-app] Warning: com.ipaulpro.afilechooser.utils.FileUtils: can't find referenced class android.provider.DocumentsContract [2014-04-07 13:27:35 - geocoord-app] Warning: there were 6 unresolved references to classes or interfaces. [2014-04-07 13:27:35 - geocoord-app] You may need to add missing library jars or update their versions. [2014-04-07 13:27:35 - geocoord-app] If your code works fine without the missing classes, you can suppress [2014-04-07 13:27:35 - geocoord-app] the warnings with '-dontwarn' options. 2014-04-07 13:27:35 - geocoord-app [2014-04-07 13:27:35 - geocoord-app] Warning: there were 1 unresolved references to program class members. [2014-04-07 13:27:35 - geocoord-app] Your input classes appear to be inconsistent. [2014-04-07 13:27:35 - geocoord-app] You may need to recompile the code. 2014-04-07 13:27:35 - geocoord-app [2014-04-07 13:27:35 - geocoord-app] Warning: there were 1 unresolved references to library class members. [2014-04-07 13:27:35 - geocoord-app] You probably need to update the library versions. 2014-04-07 13:27:35 - geocoord-app [2014-04-07 13:27:35 - geocoord-app] java.io.IOException: Please correct the above warnings first. [2014-04-07 13:27:35 - geocoord-app] at proguard.Initializer.execute(Initializer.java:369) [2014-04-07 13:27:35 - geocoord-app] at proguard.ProGuard.initialize(ProGuard.java:211) [2014-04-07 13:27:35 - geocoord-app] at proguard.ProGuard.execute(ProGuard.java:86) [2014-04-07 13:27:35 - geocoord-app] at proguard.ProGuard.main(ProGuard.java:483)

nicolabeghin commented 10 years ago

I got the same error. Any hint? I updated to latest ADT and pulled the latest code. Had no problem before using LocalStorageProvider

[2014-05-04 23:10:28 - MyApp] Proguard returned with error code 1. See console
[2014-05-04 23:10:28 - MyApp] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find superclass or interface android.provider.DocumentsProvider
[2014-05-04 23:10:28 - MyApp] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced class android.provider.DocumentsProvider
[2014-05-04 23:10:28 - MyApp] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced class android.provider.DocumentsProvider
[2014-05-04 23:10:28 - MyApp] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced method 'android.database.MatrixCursor$RowBuilder add(java.lang.String,java.lang.Object)' in class android.database.MatrixCursor$RowBuilder
[2014-05-04 23:10:28 - MyApp] Warning: com.ianhanniballake.localstorage.LocalStorageProvider: can't find referenced method 'android.content.Context getContext()' in class com.ianhanniballake.localstorage.LocalStorageProvider
[2014-05-04 23:10:28 - MyApp] Warning: com.ipaulpro.afilechooser.utils.FileUtils: can't find referenced class android.provider.DocumentsContract
[2014-05-04 23:10:28 - MyApp] Warning: com.ipaulpro.afilechooser.utils.FileUtils: can't find referenced class android.provider.DocumentsContract
[2014-05-04 23:10:28 - MyApp] Warning: com.ipaulpro.afilechooser.utils.FileUtils: can't find referenced class android.provider.DocumentsContract
[2014-05-04 23:10:28 - MyApp]       You should check if you need to specify additional program jars.
[2014-05-04 23:10:28 - MyApp] Warning: there were 6 unresolved references to classes or interfaces.
[2014-05-04 23:10:28 - MyApp]          You may need to specify additional library jars (using '-libraryjars').
[2014-05-04 23:10:28 - MyApp] Warning: there were 2 unresolved references to program class members.
[2014-05-04 23:10:28 - MyApp]          Your input classes appear to be inconsistent.
[2014-05-04 23:10:28 - MyApp]          You may need to recompile them and try again.
[2014-05-04 23:10:28 - MyApp]          Alternatively, you may have to specify the option 
[2014-05-04 23:10:28 - MyApp]          '-dontskipnonpubliclibraryclassmembers'.
[2014-05-04 23:10:28 - MyApp] java.io.IOException: Please correct the above warnings first.
[2014-05-04 23:10:28 - MyApp]   at proguard.Initializer.execute(Initializer.java:321)
[2014-05-04 23:10:28 - MyApp]   at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-05-04 23:10:28 - MyApp]   at proguard.ProGuard.execute(ProGuard.java:86)
[2014-05-04 23:10:28 - MyApp]   at proguard.ProGuard.main(ProGuard.java:492)
nicolabeghin commented 10 years ago

So stupid of me. Manifest.xml was correctly updated to use API level 19, while in Eclipse's project.properties it was still to 18. Solved.

khanhqhi commented 9 years ago

Thanks nicolabeghin, me too :D