Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23502] Android: Duplicate entry: org/appcelerator/titanium/gen/bindings.json in custom module

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-01-23T14:02:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.2
ComponentsAndroid
Labelscb-tooling
ReporterSean Conway
AssigneeGary Mathews
Created2016-06-09T23:27:53.000+0000
Updated2017-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-m

Actual Result

Failed to sign APK

Expected Result

Success to sign APK. This issue did not occur before. The modules have not changed, something in an update has broken it.

Attachments

FileDateSize
.log2016-06-09T23:27:55.000+0000725262
diagnostic1533847997741429310.log2016-06-09T23:28:32.000+0000119490
Screen Shot 2016-06-09 at 3.48.33 PM.png2016-06-09T23:28:32.000+0000102447
Screen Shot 2016-06-09 at 3.54.45 PM.png2016-06-09T23:28:33.000+000029109

Comments

  1. Sean Conway 2016-06-13

    Any idea what is causing this?
  2. Ashraf Abu 2016-06-14

    [~scconway8@gmail.com] we will need to investigate to see what's causing this issue.
  3. Chris Barber 2016-06-23

    [~msamah] Just to clarify, this is happening when building the module or when building an app with this module?
  4. Ashraf Abu 2016-06-24

    [~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)

  5. Ashraf Abu 2016-06-24

    [~aislam] If you have more information to help clarify it, please do. Thank you. :)
  6. Aminul Islam 2016-06-24

    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
  7. Michael Gangolf 2016-06-27

    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
  8. Ashraf Abu 2016-06-29

    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.
  9. Ashraf Abu 2016-06-29

    Not sure but is https://github.com/appcelerator/titanium_mobile/pull/7866 related some how? Hmm. Perhaps not.
  10. David van de Meer 2016-07-14

    Same issue here - when I build an Android Module and then include it in the project and Build the Project I get this error....
  11. Ben 2016-07-22

    Is there a solution for this? I'm still seeing this error when building and and including modules
  12. Sean Conway 2016-08-08

    I am still getting this issue. Now when I build the gen/bindings.json is still present in the .jar files.
  13. John Staunton 2016-08-09

    Have the same issue - can no longer build app for Android. This is critical, please fix / update ASAP.
  14. Sean Conway 2016-08-10

    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.
  15. Sean Conway 2016-08-12

    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
  16. Sean Conway 2016-08-12

    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.
  17. Aminul Islam 2016-08-14

    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
  18. Sean Conway 2016-08-15

    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.
  19. Sean Conway 2016-08-15

    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.
  20. Sean Conway 2016-08-15

    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 :-)
  21. Ashraf Abu 2016-08-16

    [~scconway8@gmail.com] (y) Fantastic news. I guess that solves that mystery? :)
  22. Flavio Lacerda 2016-08-23

    Tried Sean Conway solution, but didn't worked for me. Now the duplications error appears on application build.
  23. Sean Conway 2016-08-24

    @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.
  24. Flavio Lacerda 2016-08-24

    @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.
  25. Michael Kazmier 2016-10-20

    @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!!
  26. Gary Mathews 2016-10-26

    master: https://github.com/appcelerator/titanium_mobile/pull/8551
  27. Vittorio Sorbera 2016-12-01

    I had this problem, but with this fix has been resolved. But now a new problem appears:
        [ERROR] Failed to sign apk:
        [ERROR] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
        
  28. Sean Conway 2016-12-01

    @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.
  29. Sean Conway 2016-12-01

    @Vittoria Sorbera I do something like this for my ANT bash. https://gist.github.com/SeanChristopherConway/387b577b9fead533dc0d4fa3a17edf31
  30. Vittorio Sorbera 2016-12-01

    @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:
        appc run -p android --build-only
        
    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
        [ERROR] Failed to sign apk:
        [ERROR] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: org/appcelerator/titanium/gen/bindings.json
        
  31. Sean Conway 2016-12-01

    Did you check the jars to make sure they do not have the same classes?
  32. Vittorio Sorbera 2016-12-01

    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..
  33. Sean Conway 2016-12-01

    @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 :-)
  34. Raef Akehurst 2016-12-13

    @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.
  35. Christian Green 2017-01-17

    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?
  36. Eric Merriman 2017-01-20

    Reopening for back port
  37. Hans Knöchel 2017-01-23

    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!
  38. Andy Waldman 2017-01-25

    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
        [ERROR] Failed to sign apk:
        [ERROR] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
        
    Due to another ticket being created for the readme issue, i will close this ticket on the verification of it being fixed
  39. Joseph Sachs 2017-01-27

    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
  40. Joseph Sachs 2017-01-27

    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
  41. Joseph Sachs 2017-01-27

    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
  42. Joseph Sachs 2017-01-27

    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:
        [ERROR] :  Failed to sign apk:
        [ERROR] :  jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: org/appcelerator/titanium/gen/bindings.json
        
  43. Joseph Sachs 2017-01-28

    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 through appc run --build-only 5- Added both Modules to a Ti App project When I run the App, I still get:
        [ERROR] :  Failed to sign apk:
        [ERROR] :  jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: org/appcelerator/titanium/gen/bindings.json
        
  44. Flavio De Stefano 2017-02-02

    Same error here. Patch applied, same error: [ERROR] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
  45. Ben 2017-02-02

    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 "
  46. Hans Knöchel 2017-02-02

    (TIMOB-24363)
  47. Adam Paxton 2017-02-08

    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-only
  48. Arjan 2017-03-23

    SDK 6.0.3.GA still has this issue. Adams solution does work though.
  49. Pietro Granati 2017-04-20

    It this solved? today: [ERROR] : Failed to sign apk: [ERROR] : jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: assets/README
  50. Gary Mathews 2017-04-20

    [~Pietro] Yes, you may want to recompile your module using the latest SDK
  51. Pietro Granati 2017-04-20

    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
  52. Arjan 2017-04-20

    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
  53. Pietro Granati 2017-04-20

    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)
  54. Pietro Granati 2017-04-20

    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
  55. Rainer Schleevoigt 2017-05-10

    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.
  56. Rainer Schleevoigt 2017-05-16

    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.

JSON Source