Error on Android when change screen orientation
See original GitHub issueFrom @dgmaar on October 18, 2017 18:27
Please, provide the details below:
Hi, I’m getting this error when switch app orientation, I noticed that this happen when property clearHistory = true when navigating pages
An uncaught Exception occurred on “main” thread. java.lang.RuntimeException: Unable to start activity ComponentInfo{mx.sicar.sicarapp/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
Error: Could not find a page for fragment0[0]. File: "file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js, line: 584, column: 18
StackTrace: Frame: function:‘findPageForFragment’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 385, column: 15 Frame: function:‘FragmentCallbacksImplementation.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 465, column: 13 Frame: function:‘FragmentClass.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js’, line: 21, column: 25 Frame: function:‘ActivityCallbacksImplementation.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 584, column: 19 Frame: function:‘NativeScriptActivity.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/activity.js’, line: 20, column: 25
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2572)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4317)
at android.app.ActivityThread.-wrap15(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
Error: Could not find a page for fragment0[0]. File: "file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js, line: 584, column: 18
StackTrace: Frame: function:‘findPageForFragment’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 385, column: 15 Frame: function:‘FragmentCallbacksImplementation.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 465, column: 13 Frame: function:‘FragmentClass.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js’, line: 21, column: 25 Frame: function:‘ActivityCallbacksImplementation.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/frame.js’, line: 584, column: 19 Frame: function:‘NativeScriptActivity.onCreate’, file:‘file:///data/data/package/files/app/tns_modules/tns-core-modules/ui/frame/activity.js’, line: 20, column: 25
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1084)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:966)
at com.tns.Runtime.callJSMethod(Runtime.java:953)
at com.tns.Runtime.callJSMethod(Runtime.java:937)
at com.tns.Runtime.callJSMethod(Runtime.java:929)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
at android.app.Activity.performCreate(Activity.java:6270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)
... 10 more
Did you verify this is a real problem by searching [Stack Overflow]
Yes
Please provide the following version numbers that your issue occurs with:
│ nativescript │ 3.2.1 │ 3.2.1
│ tns-core-modules │ 3.2.0 │ 3.2.0
│ tns-android │ 3.2.0 │ 3.2.0
│ tns-ios │ 3.2.0 │ 3.2.0
plugins
"base-64": "^0.1.0",
"crypto-js": "^3.1.9-1",
"nativescript-apiclient": "^1.13.0",
"nativescript-barcodescanner": "^2.1.1",
"nativescript-drop-down": "^3.1.0",
"nativescript-email": "^1.4.0",
"nativescript-ethernet-printer": "file:nativescript-ethernet-printer",
"nativescript-fingerprint-auth": "^3.0.1",
"nativescript-https": "^1.0.1",
"nativescript-iqkeyboardmanager": "^1.0.1",
"nativescript-miniprinter-ios": "file:pluginM06/nativescript-miniprinter-ios",
"nativescript-orientation": "^1.6.1",
"nativescript-pdf-view": "^2.0.1",
"nativescript-printer": "file:plugin/nativescript-printer",
"nativescript-pushservice": "file:nativescript-pushservice",
"nativescript-slides": "^2.2.8",
"nativescript-telerik-ui": "^3.0.0-2017.6.28.1",
"nativescript-timedatepicker": "^1.0.0",
"nativescript-xml2js": "^0.5.2",
"tns-core-modules": "^3.2.0",
"utf8": "^2.1.2"
Did the error happen while the app was executing? (runtime error)
Yes Please provide us with the log by following these steps:
- Add
__enableVerboseLogging()
in theapp.js
file. - Run command:
adb logcat
. - Attach the content of the log to the Issue. You can use pastebin. –>
Please tell us how to recreate the issue in as much detail as possible.
Copied from original issue: NativeScript/android-runtime#862
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Hi @dgmaar,
I reviewed your case and was able to recreate the similar problem on my side. In my investigation, I found that the issue is related to the
nativescript-orientation
plugin and it is not something that depends on tns-core-modules. Regarding that, I would suggest to contact the plugin’s author and to report this issue in its repository.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.