Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25206] Android: Unable to use some native modules with 6.2.0

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2017-08-30T17:54:13.000+0000
Affected Version/sRelease 6.2.0
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsregression
ReporterEwan Harris
AssigneeGary Mathews
Created2017-08-29T13:30:32.000+0000
Updated2017-08-30T18:47:54.000+0000

Description

Description

When attempting to use ti.barcode on 6.2.0 the app will crash with the below, the same code works fine in 6.1.2.GA
[ERROR] TiExceptionHandler: (main) [18084,18184] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,18184] - In /app.js:92,13
[ERROR] TiExceptionHandler: (main) [1,18185] - Message: Uncaught No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-1/base.apk)
[ERROR] TiExceptionHandler: (main) [0,18185] - Source:     Barcode.capture({
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@bf48a50
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@3237449
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@1ffb7c
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@a260c05
[ERROR] V8Exception: Exception occurred at /app.js:92: Uncaught No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-1/base.apk)
[ERROR] V8Exception: No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-1/base.apk)

Steps to reproduce

Download ti.barcode from https://github.com/appcelerator-modules/ti.barcode/releases

Grab the code and tiapp settings from https://gist.github.com/ewanharris/f524cf9758b0b2fac540c60c4f4acd1e

Build to a device

Tap get perms

Tap scan code or scan image from gallery

Actual

Crashes with the above error

Expected

No crash
-- Start application log -----------------------------------------------------
[INFO]  TiApplication: (main) [0,0] checkpoint, app created.
[INFO]  TiApplication: (main) [37,37] Titanium 6.2.0 (2017/08/28 18:04 undefined)
[INFO]  MultiDex: VM with version 2.1.0 has multidex support
[INFO]  MultiDex: install
[INFO]  MultiDex: VM has multidex support, MultiDex support library is disabled.
[WARN]  TiAndroid: (main) [283,320] Application instance no longer available. Unable to get current activity.
[WARN]  TiAndroid: (main) [1,321] Application instance no longer available. Unable to get current activity.
[WARN]  TiAndroid: (main) [1,322] Application instance no longer available. Unable to get current activity.
[INFO]  TiApplication: (main) [26,348] Titanium Javascript runtime: v8
[WARN]  art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
[INFO]  TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO]  TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.testing.TestinappActivity@f3601a4
[DEBUG] AppTracker: App Event: start
[DEBUG] AppTracker: App Event: stop
[WARN]  TiUIScrollView: (main) [97,97] Scroll direction could not be determined based on the provided view properties. Default VERTICAL scroll direction being used. Use the 'scrollType' property to explicitly set the scrolling direction. [TRACE] BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
[TRACE] BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
[TRACE] BoostFramework: mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
[TRACE] BoostFramework: mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
[TRACE] BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@2b0a8fb
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@5d69d18
[DEBUG] Window: Checkpoint: postWindowCreated()
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@33548bb
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@57b21d8
[DEBUG] AppTracker: App Event: start
[DEBUG] AppTracker: App Event: stop
[INFO]  Adreno: QUALCOMM build                   : 853a1ff, I9c435c2712
[INFO]  Adreno: Build Date                       : 01/10/17
[INFO]  Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04
[INFO]  Adreno: Local Branch                     :
[INFO]  Adreno: Remote Branch                    :
[INFO]  Adreno: Remote Branch                    :
[INFO]  Adreno: Reconstruct Branch               :
[INFO]  OpenGLRenderer: Initialized EGL, version 1.4
[DEBUG] OpenGLRenderer: Swap behavior 1
[DEBUG] AppTracker: App Event: start
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@668204d
[WARN]  W/System.err: java.lang.NoSuchMethodError: No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-2/base.apk)
[WARN]  W/System.err:   at ti.barcode.BarcodeModule.capture(BarcodeModule.java:309)
[WARN]  W/System.err:   at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN]  W/System.err:   at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
[WARN]  W/System.err:   at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:921)
[WARN]  W/System.err:   at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1144)
[WARN]  W/System.err:   at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:363)
[WARN]  W/System.err:   at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN]  W/System.err:   at android.os.Looper.loop(Looper.java:154)
[WARN]  W/System.err:   at android.app.ActivityThread.main(ActivityThread.java:6290)
[WARN]  W/System.err:   at java.lang.reflect.Method.invoke(Native Method)
[WARN]  W/System.err:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
[WARN]  W/System.err:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
[ERROR] TiExceptionHandler: (main) [3948,4045] ----- Titanium Javascript Runtime Error -----
[ERROR] TiExceptionHandler: (main) [0,4045] - In /app.js:92,13
[ERROR] TiExceptionHandler: (main) [0,4045] - Message: Uncaught No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-2/base.apk)
[ERROR] TiExceptionHandler: (main) [0,4045] - Source:     Barcode.capture({
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@241dc26
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@2828067
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@5df94b2
[TRACE] BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@32cbc03
[ERROR] V8Exception: Exception occurred at /app.js:92: Uncaught No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-2/base.apk)
[ERROR] V8Exception: No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-2/base.apk)
[WARN]  TiVerify: (Timer-0) [955,5000] Verifying module licenses...
[INFO]  DpmTcmClient: RegisterTcmMonitor from: org.apache.http.impl.conn.TcmIdleTimerMonitor
[DEBUG] NetworkSecurityConfig: No Network Security Config specified, using platform default
[INFO]  TiVerify: (Timer-0) [545,5545] Succesfully verified module licenses
[DEBUG] AppTracker: App Event: stop
-- End application log -------------------------------------------------------

Comments

  1. Ewan Harris 2017-08-29

    Trying to run some more tests on other modules to determine if this is a widespread issue or limited to ti.barcode
  2. Ewan Harris 2017-08-29

    ti.map (using the example) and hyperloop (using hyperloop-examples) run fine
  3. Hans Knöchel 2017-08-30

    Hey [~michael], since you made the latest Android PR, would you mind taking a look here? I guess the issue should be around
       [ERROR] V8Exception: Exception occurred at /app.js:92: Uncaught No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-2/base.apk)
       [ERROR] V8Exception: No static method getAppCurrentActivity()Landroid/app/Activity; in class Lorg/appcelerator/titanium/TiApplication; or its super classes (declaration of 'org.appcelerator.titanium.TiApplication' appears in /data/app/com.testing-2/base.apk)
       
    [~eharris] Do you see the same crash with 3.0.0 and 3.1.0? Your environment suggests that, but then the issue wouldn't be the most recent module update.
  4. Michael Gangolf 2017-08-30

    Sure I'll have a look at this later today!
  5. Ewan Harris 2017-08-30

    [~hknoechel] Should have put it in the description as well as environment, but yeah it happens in both 3.0.0 and 3.1.0, so I doubt it's any change made by [~michael]. The modules work fine in 6.1.2 so this something caused by the SDK
  6. Hans Knöchel 2017-08-30

    And it also happens with other modules? Maybe we removed an API in the Core that was used by module developers, causing this issue. We should mark this for 6.2.0.
  7. Hans Knöchel 2017-08-30

    [*Busted!*](https://github.com/appcelerator/titanium_mobile/commit/763ed6ae31e910cfd79064dae722ea82b64b4b57#diff-b25efddb6838e12b7428809a3536596bR330) Caused by TIMOB-20037, so reopening it.
  8. Ewan Harris 2017-08-30

    [~hknoechel] I tried ti.map and Hyperloop which both make use of the same API, they do not see the issue, that's all I managed to check out yesterday.
  9. Gary Mathews 2017-08-30

    master: https://github.com/appcelerator/titanium_mobile/pull/9371
  10. Gary Mathews 2017-08-30

    6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9372
  11. Abir Mukherjee 2017-08-30

    Passed FR. PR merged.
  12. Abir Mukherjee 2017-08-30

    Passed FR. PR merged. Changes seen in SDKs: 6.2.0.v20170830105311 7.0.0.v20170830105203

JSON Source