[TIMOB-20564] Android: java.lang.NoSuchMethodError: android.app.Activity.startActivity
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-03-14T22:52:34.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | Release 5.2.1 |
Components | Android |
Labels | Android, SDK, notable |
Reporter | Andrey Tkachenko |
Assignee | Srikanth Sombhatla |
Created | 2016-03-13T08:55:03.000+0000 |
Updated | 2016-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
File | Date | Size |
---|---|---|
2016-03-13 20-45-03 Android SDK Manager.png | 2016-03-13T17:46:24.000+0000 | 209312 |
Screen Shot 2016-03-13 at 10.14.24 PM.png | 2016-03-13T16:15:03.000+0000 | 270757 |
Screen Shot 2016-03-14 at 3.46.48 AM.png | 2016-03-14T14:12:22.000+0000 | 252442 |
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.
@Mostafizur Rahman Do you read issue description?
Hello, I just tested a default alloy project in Android, The project is running as expected. See the screenshot. Below is my platform Information.
I have both tested in Android Simulator (5.1.0) and Device (4.4.2). Thanks.
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.
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.
You can test with sdk emulator. Screenshot attached.
Tested with 5.2.0.GA with an Ally app. Able to reproduce. Moved ticket to TIMOB.
Error from logcat:-
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]
5_2_X PR https://github.com/appcelerator/titanium_mobile/pull/7840
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
Thank you for quick PRs. It works without error on my test device and emulator.
Thanks for reporting and creating this Jira ticket!
PR merged into 5_2_X, 5_3_X and Master
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