Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProGuard problems #39

Closed
emilan opened this issue Feb 20, 2014 · 10 comments
Closed

ProGuard problems #39

emilan opened this issue Feb 20, 2014 · 10 comments

Comments

@emilan
Copy link

emilan commented Feb 20, 2014

I get the following errors when using ProGuard on a project using SignalA 0.16. I haven't tried it with earlier versions of SignalA but from the output I can guess it is because of the "Changed package names to lowercase" change.

Proguard returned with error code 1. See console
Warning: class [com/zsoft/signala/BuildConfig.class] unexpectedly contains class [com.zsoft.SignalA.BuildConfig]
Warning: class [com/zsoft/signala/R$attr.class] unexpectedly contains class [com.zsoft.SignalA.R$attr]
Warning: class [com/zsoft/signala/R$drawable.class] unexpectedly contains class [com.zsoft.SignalA.R$drawable]
Warning: class [com/zsoft/signala/R$string.class] unexpectedly contains class [com.zsoft.SignalA.R$string]
Warning: class [com/zsoft/signala/R$style.class] unexpectedly contains class [com.zsoft.SignalA.R$style]
Warning: class [com/zsoft/signala/R.class] unexpectedly contains class [com.zsoft.SignalA.R]
Warning: there were 6 classes in incorrectly named files.
         You should make sure all file names correspond to their class names.
         The directory hierarchies must correspond to the package hierarchies.
         If you don't mind the mentioned classes not being written out,
         you could try your luck using the '-ignorewarnings' option.
java.io.IOException: Please correct the above warnings first.
@erizet
Copy link
Owner

erizet commented Feb 20, 2014

Strange. Are you building from source or using the aar from Maven central?

@erizet
Copy link
Owner

erizet commented Feb 20, 2014

It seems like my changes of directory names to lowercase was not commited to the repo.

@emilan
Copy link
Author

emilan commented Feb 20, 2014

I am using Eclipse, so I've not bothered setting up the projects but simply extracted the jar files from the aar's from the Maven web page. I also just tried with the jars from 0.15 and they worked. Both failed classes (BuildConfig and R) are generated by the android tools and I see that in AndroidManifest.xml, you have the code below. If you fix the casing there, it'll probably work.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.zsoft.SignalA"
    android:versionCode="5"
    android:versionName="0.16" >

@erizet
Copy link
Owner

erizet commented Feb 20, 2014

I don't get the same errors as you do, but I'm using Android Studio.
Anyway, I've uploaded a snapshot where I made the changes you suggested. You can download the snapshot here, https://oss.sonatype.org/content/repositories/snapshots/com/github/erizet/signala/signala/0.17-SNAPSHOT/
Please tell me if this works for you!

@emilan
Copy link
Author

emilan commented Feb 21, 2014

That seems to be working. However, the failing classes (Buildconfig and R) do not seem to exist in the new snapshot. I don't know if this is an issue, but here are two screenshots:

JAR from 0.16:
0 16

JAR from 0.17-snapshot:
0 17

@erizet
Copy link
Owner

erizet commented Feb 21, 2014

I don't know if those classes are required. What are they used for? SignalA don't use any resources so I guess that the R class is not used at all.
I also looked into an old version of SignalA, 0-14-snapshot. As far as I can tell the buildconfig and R classes are not in that jar either.

@emilan
Copy link
Author

emilan commented Feb 22, 2014

R is, as you say, resources. BuildConfig contains (from what I've found on the web) a flag to tell the code if it is in debug mode or not. I guess neither of them is needed if you don't use the debug flag or resources.

@erizet
Copy link
Owner

erizet commented Feb 27, 2014

fixed in version 0.20

@erizet erizet closed this as completed Feb 27, 2014
@erizet
Copy link
Owner

erizet commented Apr 8, 2014

Please, start a new issue. This does not seem to be a ProGuard problem.

@heheLT
Copy link

heheLT commented Dec 30, 2014

How can I do with the Message loss ,The.Net server receives can not receive, the Android client can not receive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants