Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23697] Hyperloop - Android - Dexer fails because of duplicated classes

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-08-04T16:16:13.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsAndroid, Hyperloop
Labelsandroid, hyperloop
ReporterRodolfo Perottoni
AssigneeChristopher Williams
Created2016-07-28T07:51:51.000+0000
Updated2018-08-06T17:49:24.000+0000

Description

I'm building a project with this .AAR: https://github.com/PaoloRotolo/AppIntro Problem is, this project needs appcompatV7 underneath it. If i try and build my project with the appcompatV7 .JAR file, i get the following error when the dexer is run:
[ERROR] Failed to run dexer:
[ERROR]   
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$DisplayOptions;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$LayoutParams;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$NavigationMode;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$OnMenuVisibilityListener;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$OnNavigationListener;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$Tab;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBar$TabListener;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/app/ActionBarActivity;
[ERROR]   
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] java.lang.RuntimeException: Translation has been interrupted
[ERROR]         at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
[ERROR]         at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
[ERROR]         at com.android.dx.command.dexer.Main.run(Main.java:277)
[ERROR]         at com.android.dx.command.dexer.Main.main(Main.java:245)
[ERROR]         at com.android.dx.command.Main.main(Main.java:106)
[ERROR] Caused by: java.lang.InterruptedException: Too many errors
[ERROR]         at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
[ERROR]         ... 4 more
I guess that's happening because in the *Packaging application* part of the build process you can see that the *android.support.v7.appcompat* lib is already included there by default, but the thing is... Hyperloop doesn't know / doesn't have access to it without without the Hyperloop wrappers that are generated beneath */build/hyperloop/js*.
INFO]  Packaging application: /Users/rodolfo/Documents/Development/android-sdk-macosx/build-tools/23.0.3/aapt "package" "-f" "-m" "-J" "/Users/rodolfo/Documents/Workspace/loopmodules-appintro/build/android/gen" "-M" "/Users/rodolfo/Documents/Workspace/loopmodules-appintro/build/android/AndroidManifest.xml" "-A" "/Users/rodolfo/Documents/Workspace/loopmodules-appintro/build/android/bin/assets" "-S" "/Users/rodolfo/Documents/Workspace/loopmodules-appintro/build/android/res" "-I" "/Users/rodolfo/Documents/Development/android-sdk-macosx/platforms/android-23/android.jar" "-F" "/Users/rodolfo/Documents/Workspace/loopmodules-appintro/build/android/bin/app.ap_" "--auto-add-overlay" "--extra-packages" "ti.modules.titanium.ui:android.support.v7.appcompat:android.support.v7.cardview:com.github.paolorotolo.appintro" "-S" "/var/folders/6g/x4xgj0gn17z2nhk3v4n01mhw0000gn/T/116627-19422-1re5chr/res" "-S" "/var/folders/6g/x4xgj0gn17z2nhk3v4n01mhw0000gn/T/116627-19422-6esb5c/res" "-S" "/var/folders/6g/x4xgj0gn17z2nhk3v4n01mhw0000gn/T/116627-19422-jzgxx0/res" "-S" "/Users/rodolfo/Documents/Workspace/loopmodules-appintro/build/hyperloop/android/appintro-4.0.0/res"
Kiat asked me to try running the app with the latest 6.0.0 build, but the app won't even open:
[ERROR] TiApplication: (main) [33,356] Sending event: exception on thread: main msg:java.lang.UnsatisfiedLinkError: dlopen failed: library "libstlport_shared.so" not found; Titanium 6.0.0,2016/07/26 20:28,undefined
[ERROR] TiApplication: java.lang.UnsatisfiedLinkError: dlopen failed: library "libstlport_shared.so" not found
[ERROR] TiApplication: 	at java.lang.Runtime.loadLibrary(Runtime.java:371)
[ERROR] TiApplication: 	at java.lang.System.loadLibrary(System.java:988)
[ERROR] TiApplication: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:151)
[ERROR] TiApplication: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:118)
[ERROR] TiApplication: 	at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:205)
[ERROR] TiApplication: 	at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:114)
[ERROR] TiApplication: 	at org.appcelerator.kroll.KrollRuntime.init(KrollRuntime.java:136)
[ERROR] TiApplication: 	at com.loopmodules.appintro.LoopmodulesAppintroApplication.onCreate(LoopmodulesAppintroApplication.java:46)
[ERROR] TiApplication: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
[ERROR] TiApplication: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
[ERROR] TiApplication: 	at android.app.ActivityThread.access$1500(ActivityThread.java:151)
[ERROR] TiApplication: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
[ERROR] TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiApplication: 	at android.os.Looper.loop(Looper.java:135)
[ERROR] TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5254)
[ERROR] TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiApplication: 	at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
[ERROR] TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
[ERROR] E/NetworkScheduler.SR( 3015): Invalid parameter app
[ERROR] E/NetworkScheduler.SR( 3015): Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
[ERROR] Error: invalid session
    at makeError (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/auth.js:87:14)
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/auth.js:256:21
    at Request._callback (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/index.js:354:11)
    at Request.self.callback (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/request.js:187:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/request.js:1044:10)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/request.js:965:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:921:12)
---------------------------------------------
    at Request.init (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/request.js:190:10)
    at new Request (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/request.js:129:8)
    at request (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/index.js:55:10)
    at Function.get (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/request/index.js:63:12)
    at _createRequest (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/index.js:429:39)
    at Function.AppC.createRequest (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/index.js:387:9)
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/auth.js:251:8
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/node_modules/async/lib/async.js:251:17
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/node_modules/async/lib/async.js:154:25
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/node_modules/async/lib/async.js:248:21
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/node_modules/async/lib/async.js:612:34
    at /Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/appc-platform-sdk/lib/auth.js:110:3
    at next (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/tough-cookie/lib/cookie.js:994:9)
    at MemoryCookieStore.putCookie (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/tough-cookie/lib/memstore.js:118:3)
    at withCookie (/Users/rodolfo/.appcelerator/install/5.4.0-31/package/node_modules/tough-cookie/lib/cookie.js:1013:13)
---------------------------------------------
    at Object.setImmediate (/Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:194:9)
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:272:35
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:44:16
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:723:17
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:167:37
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/android/cli/hooks/run.js:400:7
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:718:13
    at iterate (/Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:262:13)
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:274:29
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:44:16
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:723:17
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:167:37
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:52:16
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:269:32
    at /Users/rodolfo/Library/Application Support/Titanium/mobilesdk/osx/6.0.0.v20160726202757/node_modules/async/lib/async.js:44:16

Comments

  1. Christopher Williams 2016-07-28

    I believe he's adding the appcompat v7 Jar himself manually to the app - but Titanium actually already has that library internally and is already baking it into the app. We should likely detect and avoid duplicate entries like this.
  2. Christopher Williams 2016-07-29

    https://github.com/appcelerator/hyperloop.next/pull/46
  3. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source