Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate entry: org/appcelerator/titanium/gen/bindings.json in custom Android module

Setup / Problem

I've create a custom Android module for Titanium to display Gif animations inside Ti. The module source code can be found here: https://github.com/m1ga/com.miga.gifview

The actual module is working fine but when I use it with a second module (with the same problem) I receive the following error:

java.util.zip.ZipException: duplicate entry: org/appcelerator/titanium/gen/bindings.json

The problem is inside the gifimageview.jar file:

enter image description here

My two modules each have a bindings.json file inside the /gen folder that contains the same information as the bindings/gifview.json. So if I remove it manually in one module I can use both modules (because there is only one bindings.json now).

Question

How can I advise the compiler not to create this file or change the name? When I compile the module with ant I see this in the output:

compile:
    [javac] Compiling 3 source files to /home/miga/dev/ti.gif/android/build/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
    [javac] Note: [KrollBindingGen] Running Kroll binding generator.
    [javac] Note: [KrollBindingGen] Succesfully loaded existing binding data: /home/miga/dev/ti.gif/android/build/classes/org/appcelerator/titanium/gen/bindings.json
    [javac] Note: [KrollBindingGen] Found binding for proxy GifView
    [javac] Note: [KrollBindingGen] Found binding for module Tigifview
    [javac] Note: [KrollBindingGen] Generating JSON: file:/home/miga/dev/ti.gif/android/build/classes/org/appcelerator/titanium/gen/bindings.json
     [copy] Copying 1 file to /home/miga/dev/ti.gif/android/build/classes

There it is creating the bindings.json

What I've tried

Adding

org.eclipse.jdt.apt.processorOptions/kroll.jsonFile=migagifview.json

to the settings file: https://github.com/m1ga/com.miga.gifview/blob/master/android/.settings/org.eclipse.jdt.apt.core.prefs didn't work

My setup

  • javac -version: javac 1.8.0_91
  • CLI version 5.0.6
  • Titanium SDK version 5.2.2.GA
  • Android-23
like image 792
miga Avatar asked Apr 30 '16 10:04

miga


1 Answers

This was a confirmed bug and is fixed in 6.1.0

Issue details: https://jira.appcelerator.org/browse/TIMOB-23502

like image 150
Hazem Khaled Avatar answered Sep 18 '22 20:09

Hazem Khaled