sktverma / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

Aar creation in 3.8.2 creates problems with resources (works fine with apklib) #437

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Check out https://github.com/inmite/android-styled-dialogs
2. mvn install the snapshot
3. use the aar dependency in any Gradle-based project and show dialog, for 
example like this:
SimpleDialogFragment.createBuilder(this, 
getSupportFragmentManager()).setMessage("test").show();

What is the expected output?

Showing the dialog doesn't crash, just like when I create apklib.

What do you see instead?

Exceptions regarding resources like:

android.content.res.Resources$NotFoundException: String resource ID #0x7f070000

or

org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid 
drawable tag alpha

What version of maven-android-plugin are you using?
3.8.2

What are the complete output lines of "mvn -version" on your machine?
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 
17:22:22+0200)
Maven home: /Users/destil/software/apache-maven-3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.1", arch: "x86_64", family: "mac"

Original issue reported on code.google.com by m...@destil.cz on 31 Dec 2013 at 12:12

GoogleCodeExporter commented 9 years ago
I have the same problem except my project has multiple aar dependencies and 1 
apklib. and the apklib is causing the problem...

Original comment by Ben...@afrogleap.com on 8 Jan 2014 at 1:38

GoogleCodeExporter commented 9 years ago
Same issue here, my app is crashing constantly when I build with 3.8.2.  I have 
multiple apklibs, no aar libs, so I suspect this issue isn't tied to aar.  I 
can reproducibly get this in my app building with 3.8.2.  Changing back to 
3.8.1, it works fine.

I've looked at the maven build output for the aapt commands, they seem to have 
change a bit in 3.8.2.  The only real difference I see is in the 
generate-sources goal, here's a comparison of 3.8.1 vs 3.8.2.

3.8.1:
...
[INFO] /Users/jon/android-sdk-mac_x86/build-tools/19.0.1/aapt [package, -m, -J, 
/Users/jon/code/p1v/gs-android/myapp/target/generated-sources/r, -M, 
/Users/jon/code/p1v/gs-android/myapp/AndroidManifest.xml, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/filtered-res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpack/apklibs/com.starkmobile_base_
apklib_0.3.5-SNAPSHOT/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpack/apklibs/com.google.android.gm
s_google-play-services-for-froyo_apklib_12.0.0/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpack/apklibs/com.actionbarsherlock
_actionbarsherlock_apklib_4.4.0/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpack/apklibs/com.viewpagerindicato
r_library_apklib_2.4.1/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpack/apklibs/com.readystatesoftwar
e_mapviewballoons_apklib_1.0.1/res, --auto-add-overlay, -I, 
/Users/jon/android-sdk-mac_x86/platforms/android-19/android.jar, 
--output-text-symbols, /Users/jon/code/p1v/gs-android/myapp/target]
...

3.8.2:
...
[INFO] /Users/jon/android-sdk-mac_x86/build-tools/19.0.1/aapt [package, -f, 
--no-crunch, -I, 
/Users/jon/android-sdk-mac_x86/platforms/android-19/android.jar, -M, 
/Users/jon/code/p1v/gs-android/myapp/AndroidManifest.xml, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/filtered-res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpacked-libs/com.starkmobile_base_a
pklib_0.3.5-SNAPSHOT/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpacked-libs/com.google.android.gms
_google-play-services-for-froyo_apklib_12.0.0/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpacked-libs/com.actionbarsherlock_
actionbarsherlock_apklib_4.4.0/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpacked-libs/com.viewpagerindicator
_library_apklib_2.4.1/res, -S, 
/Users/jon/code/p1v/gs-android/myapp/target/unpacked-libs/com.readystatesoftware
_mapviewballoons_apklib_1.0.1/res, -A, 
/Users/jon/code/p1v/gs-android/myapp/target/generated-sources/combined-assets/as
sets, -m, -J, /Users/jon/code/p1v/gs-android/myapp/target/generated-sources/r, 
--output-text-symbols, /Users/jon/code/p1v/gs-android/myapp/target, 
--auto-add-overlay]
...

Original comment by jdeyo...@gmail.com on 10 Jan 2014 at 2:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Could you share us the pom (dependency only) you used in your apk project

Original comment by benoit.b...@gmail.com on 11 Jan 2014 at 2:44

GoogleCodeExporter commented 9 years ago
First report was only about aar that was created by maven plugin. It contain 
some bug in resource and it is not possible use it in Graddle project.

Original comment by tomas.pr...@gmail.com on 16 Jan 2014 at 8:27

GoogleCodeExporter commented 9 years ago
OK, I checked out https://github.com/inmite/android-styled-dialogs and it 
builds just fine using android-maven-plugin:3.8.2 (once I switched the library 
to build an aar instead of apklib).

Deployed the demo and all functions of the demo work fine.

Unless someone can provide a project in which this fails I'm going to close the 
issue.

Original comment by william....@xandar.com.au on 18 Jan 2014 at 10:02

GoogleCodeExporter commented 9 years ago
For me this can be closed as when you have a project using ONLY aar's 
everything is working fine.

If you have a project with aar's and apklib's or only apklib's then we have an 
issue ( see ticket 441 
https://code.google.com/p/maven-android-plugin/issues/detail?id=441 )

Original comment by benoit.b...@gmail.com on 19 Jan 2014 at 10:39

GoogleCodeExporter commented 9 years ago
I have tried it again and it works now. StyledDialogs code have changed in the 
meantime, so I guess it was something in the particular library. Please close 
this issue.

Original comment by m...@destil.cz on 21 Jan 2014 at 3:09

GoogleCodeExporter commented 9 years ago
Fixed in 3.9.0

Original comment by william....@xandar.com.au on 27 Feb 2014 at 10:29