Skip to content

App crashes with Resources$NotFoundException if page navigated after app minimize #6698

Closed

Description

@Egor3f

Environment

  • CLI: 5.0.2
  • Cross-platform modules: 5.0.5
  • Android Runtime: 5.0.0
  • iOS Runtime (if applicable):
  • Plugin(s): nativescript-vue

Describe the bug
It's a runtime bug. Application crashes with the following stacktrace:

An uncaught Exception occurred on "main" thread.
android.content.res.Resources$NotFoundException: Unable to find resource ID #0xfffffff6
 at android.content.res.ResourcesImpl.getResourceTypeName(ResourcesImpl.java:274)
 at android.content.res.Resources.getResourceTypeName(Resources.java:1991)
 at android.support.v4.app.FragmentManagerImpl.loadAnimation(FragmentManager.java:1172)
 at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1543)
 at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
 at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
 at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
 at android.support.v4.app.FragmentManagerImpl.dispatchDestroyView(FragmentManager.java:3254)
 at android.support.v4.app.Fragment.performDestroyView(Fragment.java:2674)
 at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1533)
 at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
 at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
 at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
 at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
 at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733)
 at android.os.Handler.handleCallback(Handler.java:790)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:171)
 at android.app.ActivityThread.main(ActivityThread.java:6622)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

To Reproduce

  • Launch sample application ( https://github.com/Egor3f/NativeScriptVueBugReport )
  • Move to the second page (inside nested frame) with Next button
  • Minimize the application with "home" button
  • Restore the application from recents menu
  • Try to navigate to StartPage (in the topmost frame)

Expected behavior
Navigation to Start Page

Sample project
https://github.com/Egor3f/NativeScriptVueBugReport
Application consists of App.vue component with topmost frame, which has 2 pages: WelcomeScreen and StartPage
Inside WelcomeScreen there is another nested frame with some pages (in this sample project they are the same), and a button leading to StartPage

Additional context
Bug occurs only when I'm navigating to StartPage in topmost frame right after minimizing and restoring application.

If I press Start button right after first launch, everything is ok.

Tried literally everything found in another issues, no luck.

Sorry for my bad English

Activity

  1. changed the title [-]App crashes with Resources$NotFoundException if page navigated afte app minimize[/-] [+]App crashes with Resources$NotFoundException if page navigated after app minimize[/+] on Nov 29, 2018
  2. self-assigned this
    on Dec 11, 2018
  3. ghost removed on Dec 12, 2018
  4. manoldonev commented on Dec 12, 2018

    @manoldonev
    Contributor

    @Egor3f we are planning to include #6677 in tns-core-modules@5.1.1 patch release before Christmas but the fix is already available in tns-core-modules@next so you can test it if necessary.

  5. anuragd7 commented on Dec 18, 2018

    @anuragd7

    Hi @manoldonev . I was facing a similar error that was closed in favour of this one and a few others. I just tried updating to tns-core-modules 5.2.0-next-2018-12-18-114934-01 and running my android project. I am still getting the same error:

    Refreshing application on device 192.168.56.101:5555...
    Successfully synced application org.nativescript.qbank on device 192.168.56.101:5555.
    JS: phone css is chosen
    JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
    JS: firebase.init done
    System.err: android.content.res.Resources$NotFoundException: Resource ID #0xfffffff6
    System.err: 	at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190)
    System.err: 	at android.content.res.Resources.loadXmlResourceParser(Resources.java:2101)
    System.err: 	at android.content.res.Resources.getAnimation(Resources.java:1139)
    System.err: 	at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:107)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.loadAnimation(FragmentManager.java:1073)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1554)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
    System.err: 	at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
    System.err: 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
    System.err: 	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
    System.err: 	at android.os.Handler.handleCallback(Handler.java:751)
    System.err: 	at android.os.Handler.dispatchMessage(Handler.java:95)
    System.err: 	at android.os.Looper.loop(Looper.java:154)
    System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
    System.err: 	at java.lang.reflect.Method.invoke(Native Method)
    System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
    

    Here is my package.json

    
    {
      "description": "NativeScript Application",
      "license": "SEE LICENSE IN <your-license-filename>",
      "readme": "NativeScript Application",
      "repository": "<fill-your-repository-here>",
      "nativescript": {
        "id": "org.nativescript.xyz",
        "tns-android": {
          "version": "5.1.0"
        },
        "tns-ios": {
          "version": "5.1.0"
        }
      },
      "dependencies": {
        "@angular/animations": "~6.1.0",
        "@angular/common": "~6.1.0",
        "@angular/compiler": "~6.1.0",
        "@angular/core": "~6.1.0",
        "@angular/forms": "~6.1.0",
        "@angular/http": "~6.1.0",
        "@angular/platform-browser": "~6.1.0",
        "@angular/platform-browser-dynamic": "~6.1.0",
        "@angular/router": "~6.1.0",
        "nativescript-algolia": "^1.1.0",
        "nativescript-angular": "^6.2.0",
        "nativescript-camera": "^4.0.2",
        "nativescript-email": "^1.5.3",
        "nativescript-filter-select": "^1.2.9",
        "nativescript-filterable-listpicker": "^2.2.3",
        "nativescript-geolocation": "^4.2.6",
        "nativescript-imagepicker": "^6.0.4",
        "nativescript-iqkeyboardmanager": "^1.3.0",
        "nativescript-ngx-slides": "^6.1.0",
        "nativescript-pdf-view": "^2.0.1",
        "nativescript-plugin-firebase": "^7.4.6",
        "nativescript-social-share": "^1.5.0",
        "nativescript-theme-core": "~1.0.4",
        "nativescript-toast": "^1.4.6",
        "nativescript-ui-listview": "^3.8.0",
        "nativescript-web-image-cache": "^4.2.2",
        "reflect-metadata": "~0.1.8",
        "rxjs": "^6.0.0",
        "rxjs-compat": "^6.2.2",
        "tns-core-modules": "^5.2.0-next-2018-12-18-114934-01"
      },
      "devDependencies": {
        "@angular/compiler-cli": "~6.1.0",
        "@ngtools/webpack": "~6.2.0",
        "babel-traverse": "6.26.0",
        "babel-types": "6.26.0",
        "babylon": "6.18.0",
        "codelyzer": "^4.4.4",
        "es6-promise-loader": "^1.0.2",
        "lazy": "1.0.11",
        "nativescript-dev-typescript": "^0.7.3",
        "nativescript-dev-webpack": "^0.17.0",
        "prettier": "^1.11.1",
        "tslint": "^5.1.0",
        "typescript": "~2.7.2",
        "webpack": "^4.25.1",
        "zone.js": "^0.8.26"
      }
    }
    
    

    I am running tns 5.1 on my mac. The project works fine on IOS. Let me know if you need more information.

  6. manoldonev commented on Dec 20, 2018

    @manoldonev
    Contributor

    @anuragd7 let's keep the discussion in one place -- I can see @NickIliev is working with you on this here: https://github.com/NativeScript/android-runtime/issues/1212#issuecomment-448993678.

  7. locked and limited conversation to collaborators on Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions