question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on Android when change screen orientation

See original GitHub issue

From @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 the app.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:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tsonevncommented, Oct 19, 2017

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.

0reactions
lock[bot]commented, Aug 27, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Auto Rotate Not Working on Android
Fix Auto-Rotate Issues by Restarting Your Android Phone · Turn On Screen Rotation From Android Settings · Use the In-App Screen Rotation Option....
Read more >
7 ways to fix Android screen rotation not working - Carlcare
7 ways to fix Android screen rotation not working · Restart your phone · Check Auto-rotation settings · Calibrate phone's sensors · Check...
Read more >
Auto Rotate Not Working On Android? Here's How To Fix It
Go to Quick Settings by swiping down from the top of the screen. Long-press the auto-rotate icon. Scroll down until you see Rotate...
Read more >
How to Fix the Android Screen Rotation Not Working Issue
How to Fix the Android Screen Rotation Not Working Issue · 1. Turn Auto-Rotate On · 2. Restart Your Phone · 3. Check...
Read more >
My Android Won't Auto-Rotate - What to Do - Technipages
Let's get the apparent solutions out of the way. Sometimes a simple reboot will do the job. If that doesn't work, try checking...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found