[TIMOB-23502] Android: Duplicate entry: org/appcelerator/titanium/gen/bindings.json in custom module
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-01-23T14:02:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.2 |
Components | Android |
Labels | cb-tooling |
Reporter | Sean Conway |
Assignee | Gary Mathews |
Created | 2016-06-09T23:27:53.000+0000 |
Updated | 2017-05-16T07:40:50.000+0000 |
Description
Steps to Reproduce
Build android custom modules. They both produce a org/appcelerator/titanium/gen/bindings.json file. Then when signing the APK Duplicate entry: org/appcelerator/titanium/gen/bindings.json occurs. This issue is occurred before and is occurring now with other users: http://appcelerator287.rssing.com/browser.php?indx=18050476&item=2527 http://stackoverflow.com/questions/36953652/duplicate-entry-org-appcelerator-titanium-gen-bindings-json-in-custom-android-mActual Result
Failed to sign APKExpected Result
Success to sign APK. This issue did not occur before. The modules have not changed, something in an update has broken it.Attachments
File | Date | Size |
---|---|---|
.log | 2016-06-09T23:27:55.000+0000 | 725262 |
diagnostic1533847997741429310.log | 2016-06-09T23:28:32.000+0000 | 119490 |
Screen Shot 2016-06-09 at 3.48.33 PM.png | 2016-06-09T23:28:32.000+0000 | 102447 |
Screen Shot 2016-06-09 at 3.54.45 PM.png | 2016-06-09T23:28:33.000+0000 | 29109 |
Any idea what is causing this?
[~scconway8@gmail.com] we will need to investigate to see what's causing this issue.
[~msamah] Just to clarify, this is happening when building the module or when building an app with this module?
[~cbarber] I haven't been able to reproduce it. But I believe it's when:-
Building 2 modules
Using both modules and building an app (Errors occur at this step due to duplicate org/appcelerator/titanium/gen/bindings.json)
[~aislam] If you have more information to help clarify it, please do. Thank you. :)
Hi [~cbarber] [~msamah], This is happening when building an app with this module. *Steps to reproduce :* 1. Create a module with Appcelerator Studio 4.6.0 and SDK 5.3.0.GA. 2. Create a simple classic new project. 3. Include that module in new project (tiapp.xml). 4. Build apps on android devices. (you will get error now) *For module investigate:* Check module's following path : org/appcelerator/titanium/bindings/bindings.json org/appcelerator/titanium/gen/test.json Thanks
Having the same issue when compiling my module (https://github.com/m1ga/com.miga.gifview) Some more details on stackoverflow: http://stackoverflow.com/questions/36953652/duplicate-entry-org-appcelerator-titanium-gen-bindings-json-in-custom-android-m
I've checked the part that compiles the module. That portion has been changed in a while. I don't think it would be the compiling of the module that causes the issue. Will need to look at the other parts.
Not sure but is https://github.com/appcelerator/titanium_mobile/pull/7866 related some how? Hmm. Perhaps not.
Same issue here - when I build an Android Module and then include it in the project and Build the Project I get this error....
Is there a solution for this? I'm still seeing this error when building and and including modules
I am still getting this issue. Now when I build the gen/bindings.json is still present in the .jar files.
Have the same issue - can no longer build app for Android. This is critical, please fix / update ASAP.
Did everybody quit at Appcelerator or what? Are we expected to just abandon all our legacy modules and start using Hyperloop? This is having rather dire consequences to a bunch of us and seems rather unprofessional to not have a solution to such an important issue.
Apparently this is the answer my friends, from the Appcelerator Team(asked by me personally): Hi, Thanks for your reply. Support android *.aar will fixed in our next release Release 6.0.0. Sorry for the inconvenience. TIMOB-23502 will solved in Release 6.1.0. In the mien time to develop android module , I recommend you to use ANT build. http://docs.appcelerator.com/platform/latest/#!/guide/Installing_Ant Run as Ant Build: http://docs.appcelerator.com/platform/latest/#!/guide/Android_Module_Project-section-43289002_AndroidModuleProject-RunasAntBuild
From trial and error I have found that running as an ant build does not fix the issue because the jar file created still has a gen/bindings.json file. This is still seen as a duplicate when signing and crashes.
Hi, I have tested this issue with Appcelerator Studio, build: 4.7.0.201607250649, SDK 5.4.0.GA and NDK 10. So far I am unable to reproduce it. Create a test android module using ANT build. It's working fine. No duplicate crash in Ant Build. Steps: 1. Create a test module using Appcelerator Studio, build: 4.7.0.201607250649, SDK 5.4.0.GA and NDK 10 2. Include NDK location in build.properties : android.ndk=/Users/zzz/Documents/android-ndk-r10 3. Run as Ant Build 4. Find the build module in project dist folder. 5. Create a classic test project and include that module. 6. Run the test project. Regards, Aminul
Yes, but just one thing, the main reason the issue is happening: did you try it with two modules? Build two test modules then run it. The issue obviously won't occur with just one module as duplicates need at least two of course.
Look. When I build a module using ANT or just by using the GUI it now produces an org/appcelerator/titanium/gen/bindings.json file. I am using NDK 10 in build properties as well, always have been. I compare my jars built for same module with same settings but post 5.1.1GA I believe, can't remember when started happening could be even older builds, and this gen/bindings.json file did not exist. If I delete them then the build complains, if I have them it complains.
I was able to remove the gen/bindings.json file by doing the following: (1) Set Java Compiler to 1.8 (2) Update build.properties: titanium.platform=/Users/xxx/Library/Application Support/Titanium/mobilesdk/osx/5.4.0.GA/android android.platform=/Users/xxx/Library/android-sdk-macosx/platforms/android-23 android.ndk=/Users/xxx/android-sdks/build-tools/22.0.1/android-ndk-r10e (3) Change all libraries in build path to use 5.4.0.GA JARS (4) Delete build and dist folders then rebuild using ANT *** WIll not work otherwise, still produces gen file if you package-->android module DO not use package option to build, go to build.xml, right click-->Run as Ant Build Successful project build :-)
[~scconway8@gmail.com] (y) Fantastic news. I guess that solves that mystery? :)
Tried Sean Conway solution, but didn't worked for me. Now the duplications error appears on application build.
@Flavio Lacerda Did you use ANT to make the build? DO not use package option to build, go to build.xml, right click-->Run as Ant Build. Then grab the zip folder from the android/dist folder, you should be able to check the jar in the dist folder and see whether or not it has the gen file. If you followed my method it should not, and if it does then do not copy it over to the application. SImply rename the .jar to .zip and look at its contents. The duplication errors were happening on the applications build for me as well with the normal package option in Appcelerator.
@Sean Conway. Thanks a lot. One of my modules was not with 5.4.0 and was generating the gen file. When i changed the build.properties to 5.4.0 worked! Thanks a lot. This is critical! Must be fixed. Regards.
@sean Conway - Thank you for your work around! I too can confirm that after rebuilding all 8 modules in our project using your steps above, we can once again build!!
master: https://github.com/appcelerator/titanium_mobile/pull/8551
I had this problem, but with this fix has been resolved. But now a new problem appears:
@Vittoria Sorbera Never seen this issue and am not having any issues with SDK 5.5.1.GA. Which version of the SDK are you using? I suggest you do my steps above listed and also rebuild all modules using Node v4+ with at least 5.5.x sdk. On somewhat of a side not: Personally, I have taken to just building with ANT as (a) I find Appcelerator Studio tedious to use on my Macbook with 8g RAM as it is very slow, so I use all CLI. With ANT you can just then write a bash script to build the module and copy it to your app.
@Vittoria Sorbera I do something like this for my ANT bash. https://gist.github.com/SeanChristopherConway/387b577b9fead533dc0d4fa3a17edf31
@Sean Conway, I'm using: * Ti SDK 6.0.0.GA * node v4.6.1 * ndk android-ndk-r13b * android build-tool 25.0.0 * google play services 10.0.1 (rev 38) and I use only the cli to build my module:
I did the android build of these two modules: ti.admob (https://github.com/appcelerator-modules/ti.admob) ti.ga (https://github.com/benbahrenburg/Ti.GA) Individually they work properly, but if I add them both, I get the above error. Before of https://github.com/appcelerator/titanium_mobile/pull/8551 fix, I received the error
Did you check the jars to make sure they do not have the same classes?
Certainly. My first problem was due to the fact that there were some classes in common in google play services of the two modules. So I created first an identical jar file, which contained all the necessary classes to both modules (using this script that I upgraded in my github https://github.com/Astrovic/Google-Play-Service-Lite). But now I have this new problem.. In any case, if I remove or rename _*assets/README*_ in one of the two modules to create the build, the modules work together. So I think it's some bug..
@Vittorio Sorbera Sounds like it. Perhaps file a new JIRA with all your specific details, etc. Good luck, am not working with those modules currently so have no other feedback. Will do if I come across anything :-)
@Virrorio and @Sean. Thanks for your discussion here. It got me going! FYI, I ended up building with a nightly build (6.1.0.v20161212041915) and deleting all occurrences of
assets/README
files. Yuck! With 11 Android modules in my project, this was a time-consuming process. I hope this helps someone.I was able to get rid of the "duplicates binding issue" with the latest 6.1 nightly build which led the to "assets/README" duplicate error. Removing assets/README then throws "[MODULE]is missing bindings json file" Has anyone been able to resolve this?
Reopening for back port
PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8773 And for the
README
issue, it would be good to have an ticket focussing on that particular issue. Then we can see if we include that in 6.0.2 as well. Thx!Wednesday 25th January: Environment: Appcelerator Command-Line Interface, version 6.1.0 Android 7.1 (Google Pixel) Operating System Name: MacOS Sierra Operating System Version: 10.12.1 Node.js Version: 4.5.0 NPM: 4.2.8 Appc NPM: 4.2.8 Titanium SDK Version: 6.0.2.v20170123140026 and 6.0.0.GA, 6.1.0.v20170124071525 Xcode: 8.2.1 Studio Build: 4.8.1.201612050850 after testing this with all three of these SDK versions, i can confirm the issue is fixed, however After then taking the steps to try to reproduce i including all the modules in the builds and come up with the duplicate read me error, on 6.0.2.v20170123140026 and 6.1.0.v20170124071525 verify the steps: Step 1) Build classic app with the SDK's above including all the modules Step 2) Build and Run in both studio and CLI ( CLI command appc run -p android --build-only) run in app directory Step 3) Error for duplicate read me is produced
Due to another ticket being created for the readme issue, i will close this ticket on the verification of it being fixed
Same here... just stumbled on this issue: [ERROR] : Failed to sign apk: [ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
So, I guess this issue needs more clarification. I've managed to compile two Android module for api 3 (Ti SDK 6.0). The modules compile all good. When I add them to the project, and run the app, I get this error: [ERROR] : Failed to sign apk: [ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
Tried it with Nightly Build: 6.1.0.v20170126175503 [ERROR] : Failed to sign apk: [ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
Update: After removing the README from assets/README both Android Modules & then compiled them (with 6.0.1.GA) & 6.1.0v2017 (today's) When I add both, and run the Ti App, now I get the other issue:
I'm having the same issue with 2 other Android modules (ti.draggable & com.animecys.animator) What I've done is: 1- Downloaded latest Nightly Build (Ti 6.1.0v20170127....) 2- Updated the Module's manifest to use 6.1.0v20170127 sdk for both modules 3- Deleted README file (located in
proj/assets/README
) for both modules 4- Compiled the module throughappc run --build-only
5- Added both Modules to a Ti App project When I run the App, I still get:Same error here. Patch applied, same error: [ERROR] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
I was getting the assets/README error but after deleting the README files from my modules, everything is working fine. If you don't want to re build every module, from the terminal go to the module directory and enter " zip -d your-modules-jar-file.jar assets/README.txt "
(TIMOB-24363)
Thanks to [~benpeters49]'s suggestion I was also able to delete the duplicate bindings.json from an already compiled module without need to rebuild by doing:
zip -d your-module-jar-file.jar org/appcelerator/titanium/gen/bindings.json
This was performed that had been compiled with v.6.0.1 and by running ti build -p android --build-onlySDK 6.0.3.GA still has this issue. Adams solution does work though.
It this solved? today: [ERROR] : Failed to sign apk: [ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
[~Pietro] Yes, you may want to recompile your module using the latest SDK
Gary Mathews , no i remove all the modules and the problem seems to be ti.map [ERROR] : Failed to sign apk: [ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
As I wrote on 23 march; it's not fixed in 6.0.3.GA. You can remove the bindings from the jar file by running: zip -d your-module-jar-file.jar org/appcelerator/titanium/gen/bindings.json
Well I used you command but this is the 2 result: zip -d google-play-services-base.jar org/appcelerator/titanium/gen/bindings.json zip warning: name not matched: org/appcelerator/titanium/gen/bindings.json zip error: Nothing to do! (google-play-services-base.jar) zip -d google-play-services-map.jar org/appcelerator/titanium/gen/bindings.json zip warning: name not matched: org/appcelerator/titanium/gen/bindings.json zip error: Nothing to do! (google-play-services-map.jar)
Apoligize me guys! I was writing the code you gave me but my problem was readme file. For those who have my same problem here is the solution: navigate with command line into the ti.map folder, find last version and write: {color:red}zip -d map.jar assets/README{color} Result: deleting: assets/README
I have the issue too by signing an app with module Ti.Chromecast. This module uses googleplay-services and support.v7.mediarouter. MY SDK is 5.5.1. I cannot use a 6-version, because a streaming module is only available with old shared objects.
Now I found: if I remove the
bindings.json
from my jar, then at runtime the module cannot resolve my Proxy. The module should return a list of proxies and this failes.