Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20564] Android: java.lang.NoSuchMethodError: android.app.Activity.startActivity

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-03-14T22:52:34.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.2.1
ComponentsAndroid
LabelsAndroid, SDK, notable
ReporterAndrey Tkachenko
AssigneeSrikanth Sombhatla
Created2016-03-13T08:55:03.000+0000
Updated2016-03-18T22:53:33.000+0000

Description

Can't run application on device *Lenovo A630 Android 4.0.4* due error:
[ERROR] :  TiApplication: (main) [1225,4779] Sending event: exception on thread: main msg:java.lang.NoSuchMethodError: android.app.Activity.startActivity; Titanium 5.2.0,2016/02/20 08:05,384775e
[ERROR] :  TiApplication: java.lang.NoSuchMethodError: android.app.Activity.startActivity
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:161)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:103)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:444)
[ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:154)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:4624)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
[ERROR] :  TiApplication: 	at dalvik.system.NativeStart.main(Native Method)
Steps to reproduce: Create default alloy project and run it on device. SDK 5.1.2.GA works without error.

Attachments

FileDateSize
2016-03-13 20-45-03 Android SDK Manager.png2016-03-13T17:46:24.000+0000209312
Screen Shot 2016-03-13 at 10.14.24 PM.png2016-03-13T16:15:03.000+0000270757
Screen Shot 2016-03-14 at 3.46.48 AM.png2016-03-14T14:12:22.000+0000252442

Comments

  1. Mostafizur Rahman 2016-03-13

    Hello, The proper method is Titanium.Android.Activity.startActivity. Follow the guide here http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Activity-method-startActivity Please provide the code that you are testing. Also, provide full list of steps to follow. Use the latest SDK 5.2.0.GA for your test. Thanks.
  2. Andrey Tkachenko 2016-03-13

    @Mostafizur Rahman Do you read issue description?
  3. Sharif AbuDarda 2016-03-13

    Hello, I just tested a default alloy project in Android, The project is running as expected. See the screenshot. Below is my platform Information.
       Operating System
         Name                        = Mac OS X
         Version                     = 10.11.3
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 4.2.2
         npm Version                 = 2.14.7
       Titanium CLI
         CLI Version                 = 5.0.6
       Titanium SDK
         SDK Version                 = 5.2.0.GA
         Target Platform             = android
       
    I have both tested in Android Simulator (5.1.0) and Device (4.4.2). Thanks.
  4. Andrey Tkachenko 2016-03-13

    Guys, I wrote about *Lenovo A630* Android *4.0.4*. Can you help me to find bug if you can't test on this device and android version. What changed from 5.1.2.GA to 5.2.0.GA that can lead to this exception? I have this device for test.
  5. Sharif AbuDarda 2016-03-13

    Hello, We don't have the device you mentioned, Also Genymotion emulator does not provide this model. I would suggest you try on a different device and see if the error occurs. Thanks.
  6. Andrey Tkachenko 2016-03-13

    You can test with sdk emulator. Screenshot attached.
  7. Ashraf Abu 2016-03-14

    Tested with 5.2.0.GA with an Ally app. Able to reproduce. Moved ticket to TIMOB.
  8. Ashraf Abu 2016-03-14

    Error from logcat:-
       D/AndroidRuntime( 1505): Shutting down VM
       W/dalvikvm( 1505): threadid=1: thread exiting with uncaught exception (group=0xb31a1180)
       E/TiApplication( 1505): (main) [241,241] Sending event: exception on thread: main msg:java.lang.NoSuchMethodError: android.app.Activity.startActivity; Titanium 5.2.0,2016/02/20 08:05,384775e
       E/TiApplication( 1505): java.lang.NoSuchMethodError: android.app.Activity.startActivity
       E/TiApplication( 1505): 	at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:161)
       E/TiApplication( 1505): 	at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:103)
       E/TiApplication( 1505): 	at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:444)
       E/TiApplication( 1505): 	at android.os.Handler.dispatchMessage(Handler.java:95)
       E/TiApplication( 1505): 	at android.os.Looper.loop(Looper.java:137)
       E/TiApplication( 1505): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
       E/TiApplication( 1505): 	at java.lang.reflect.Method.invokeNative(Native Method)
       E/TiApplication( 1505): 	at java.lang.reflect.Method.invoke(Method.java:511)
       E/TiApplication( 1505): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
       E/TiApplication( 1505): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
       E/TiApplication( 1505): 	at dalvik.system.NativeStart.main(Native Method)
       E/AndroidRuntime( 1505): FATAL EXCEPTION: main
       E/AndroidRuntime( 1505): java.lang.NoSuchMethodError: android.app.Activity.startActivity
       E/AndroidRuntime( 1505): 	at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:161)
       E/AndroidRuntime( 1505): 	at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:103)
       E/AndroidRuntime( 1505): 	at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:444)
       E/AndroidRuntime( 1505): 	at android.os.Handler.dispatchMessage(Handler.java:95)
       E/AndroidRuntime( 1505): 	at android.os.Looper.loop(Looper.java:137)
       E/AndroidRuntime( 1505): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
       E/AndroidRuntime( 1505): 	at java.lang.reflect.Method.invokeNative(Native Method)
       E/AndroidRuntime( 1505): 	at java.lang.reflect.Method.invoke(Method.java:511)
       E/AndroidRuntime( 1505): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
       E/AndroidRuntime( 1505): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
       E/AndroidRuntime( 1505): 	at dalvik.system.NativeStart.main(Native Method)
       W/ActivityManager(  881):   Force finishing activity sg.www.appcelerator/.CrashmetooActivity
       
  9. Ashraf Abu 2016-03-14

    Tested this on both Alloy and Classic on 5.2.0.GA on an Android 4.0.3 emulator. Able to reproduce the crash. It seems there's something going on in Android 4.0.X. Will be investigating this. [~falko]
  10. Srikanth Sombhatla 2016-03-14

    5_2_X PR https://github.com/appcelerator/titanium_mobile/pull/7840
  11. Ashraf Abu 2016-03-14

    Cherry-Picked into 5_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/7841 Master PR: https://github.com/appcelerator/titanium_mobile/pull/7842
  12. Andrey Tkachenko 2016-03-14

    Thank you for quick PRs. It works without error on my test device and emulator.
  13. Ashraf Abu 2016-03-14

    Thanks for reporting and creating this Jira ticket!
  14. Ashraf Abu 2016-03-14

    PR merged into 5_2_X, 5_3_X and Master
  15. Lokesh Choudhary 2016-03-18

    Verified the fix. The app does not crash with the error. Closing. Environment: Appc Studio : 4.5.0.201602170831 Ti SDK : 5.2.1.v20160317105842, 5.3.0.v20160318094530, 5.4.0.v20160318144950 Ti CLI : 5.0.6 Alloy : 1.7.35 MAC El Capitan : 10.11.13 Appc NPM : 4.2.4-2 Appc CLI : 5.2.1-12 Node: 4.2.2 Android emulator: android 4.0.3 Device: Samsung Galaxy S3 Android 4.0.4

JSON Source