Nativescript-ui-feedback: RE: SideDrawer - android.content.res.Resources$NotFoundException: Resource ID #0xfffffff6

Created on 5 Nov 2018  Â·  24Comments  Â·  Source: ProgressNS/nativescript-ui-feedback

_From @samliaw on November 3, 2018 23:45_

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI:
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime:
  • Plugin(s):
    C:tnsema2>tns info
    √ Getting NativeScript components versions information...
    √ Component nativescript has 5.0.0 version and is up to date.
    √ Component tns-core-modules has 5.0.1 version and is up to date.
    √ Component tns-android has 5.0.0 version and is up to date.
    √ Component tns-ios has 5.0.0 version and is up to date.

Describe the bug

I am building a new app using the following command. Here is the package.json
{
"nativescript": {
"id": "org.nativescript.ema2",
"tns-android": {
"version": "5.0.0"
},
"tns-ios": {
"version": "5.0.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"repository": "",
"scripts": {
"lint": "tslint "src/*/.ts""
},
"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-angular": "~6.2.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-sidedrawer": "~5.0.0",
"tns-core-modules": "~5.0.0",
"reflect-metadata": "~0.1.10",
"rxjs": "~6.2.0",
"zone.js": "~0.8.18"
},
"devDependencies": {
"@nativescript/schematics": "~0.3.0",
"codelyzer": "~4.5.0",
"nativescript-dev-sass": "~1.6.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "~0.17.0",
"tslint": "~5.11.0",
"typescript": "~2.7.2",
"@angular/compiler-cli": "~6.1.0",
"@ngtools/webpack": "~6.2.0"
},
"readme": "NativeScript Application"
}

I run the following command
"tns create ema2--template tns-template-drawer-navigation-ng",
"cd ema2",
"tns run android --emulator"
and the following error is produced.
Refreshing application on device emulator-5554...
Successfully synced application org.nativescript.ema2 on device emulator-5554.
ActivityManager: Start proc 14174:org.nativescript.ema2/u0a69 for activity org.nativescript.ema2/com.tns.NativeScriptActivity
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
System.err: android.content.res.Resources$NotFoundException: Resource ID #0xfffffff6
System.err: at android.content.res.Resources.getValue(Resources.java:1351)
System.err: at android.content.res.Resources.loadXmlResourceParser(Resources.java:2774)
System.err: at android.content.res.Resources.getAnimation(Resources.java:1189)
System.err: at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:75)
System.err: at android.support.v4.app.FragmentManagerImpl.loadAnimation(FragmentManager.java:1102)
System.err: at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1600)
System.err: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1641)
System.err: at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:794)
System.err: at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2415)
System.err: at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2200)
System.err: at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2153)
System.err: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2063)
System.err: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:725)
System.err: at android.os.Handler.handleCallback(Handler.java:739)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:148)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5417)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
ActivityManager: Process org.nativescript.ema2 (pid 14174) has died

To Reproduce

run following commands
"tns create ema2--template tns-template-drawer-navigation-ng",
"cd ema2",
"tns run android --emulator"

Expected behavior
I should be able to see the main screen without any compiling errors.

Sample project

Additional context

_Copied from original issue: NativeScript/NativeScript#6503_

bug sidedrawer

Most helpful comment

@anmaitrannguyen make sure to delete the platform folder after the upgrade to NativeScript CLI 5.0.0. Then make a clean rebuild of the application.

tns --version  // should shown 5.0.0 otherwise run npm i -g nativescript@latest
rm -rf platforms
tns platform add android
tns run android

All 24 comments

Hi @samliaw,
Try to clear up the project, following the below-attached steps and then rebuild the project.

  1. delete platforms, node_modules, hooks folders and package-lock.json file.
  2. clear npm cache via npm cache clear
  3. run npm i
  4. rebuild the project with tns run android command.

I'm getting this error too when create a new project, using tns-template-drawer-navigation-ng template, and run tns run android

I can't remember exactly the steps I perform, but you can do the following 2 steps
1) tns plugin update
2) npm update

Tried the above solution, still no luck.

This error is caused if you don't use CLI 5.0 but have migrated your project to use runtime and modules 5.0. So install latest nativescript:

npm i -g nativescript

I have updated the CLI 5.0:
https://pasteboard.co/HM2y9Ib.png
But the same issues still happen. Look like some of the animation is missing, it quite hard to find which caused this error.

@anmaitrannguyen make sure to delete the platform folder after the upgrade to NativeScript CLI 5.0.0. Then make a clean rebuild of the application.

tns --version  // should shown 5.0.0 otherwise run npm i -g nativescript@latest
rm -rf platforms
tns platform add android
tns run android

Thanks for your help, I have to restart my computer after install for it to take effect. Not sure why. But at least the error has gone away.

Hi

@anmaitrannguyen make sure to delete the platform folder after the upgrade to NativeScript CLI 5.0.0. Then make a clean rebuild of the application.

tns --version  // should shown 5.0.0 otherwise run npm i -g nativescript@latest
rm -rf platforms
tns platform add android
tns run android

perfect! i had 5.0.1 version
before try your trick , in my project, in app.component.html I put another tag works

@anmaitrannguyen make sure to delete the platform folder after the upgrade to NativeScript CLI 5.0.0. Then make a clean rebuild of the application.

tns --version  // should shown 5.0.0 otherwise run npm i -g nativescript@latest
rm -rf platforms
tns platform add android
tns run android

Thank you very much. I'm sure many people will encounter this problem.

Still facing a similar issue, in my case the app starts and works fine for some time, but after some navigation via SideDrawer it crashes with this error):

System.err: android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffec
System.err: at android.content.res.ResourcesImpl.getResourceTypeName(ResourcesImpl.java:271)
System.err: at android.content.res.Resources.getResourceTypeName(Resources.java:1986)
System.err: at android.support.v4.app.FragmentManagerImpl.loadAnimation(FragmentManager.java:1172)
System.err: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1543)
System.err: at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
System.err: at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
System.err: at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
System.err: at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
System.err: at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
System.err: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
System.err: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:193)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Sometimes it takes 5 or 6 navigations for this to appear, sometimes it happens at the first.
tns --version shows that I'm using 5.1.0

Any ideas on that one?

Same here. Using side drawer with lazy loading app-routing module. After navigating Module A to Module B is OK. But navigating Module B to A crashes like this.

@hakkism can you provide a sample app so we could investigate this one more thoroughly.

Same navigation issue. After navigates a few steps the app crashes with System.err: android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffec

@NickIliev Thank you for your reply. I think i figure out something. I started a project with "--template tns-template-drawer-navigation-ng" template. And i add "TabView" widget with two Tabs to Featured Module. In my first tab i have "RadDataForm" items. After i run my app on android and i tap Featured module its ok it shows tabs. But when i tap another menu item, then this navigation problem occured. When i remove TabView from my html it worked again.

@hakkism thank you for the provided details - I can confirm that the issue exists and is also logged here. It seems that the issue is related to the fade transition used in the template - can you test it with another type of transition on your side?

Related to https://github.com/NativeScript/NativeScript/issues/6810

@NickIliev I tried "slide" and "flip" transitions. "Slide" has failed like "Fade". But "Flip" transition worked well.

@NickIliev I can confirm that the fade transition caused my problem as well, stumbled upon this a few days ago. Removed it - works perfectly

@hakkism, @NickIliev, I have the same problem after I switched to nativescript 5.1.1 (with 4.x was fine)
Navigating (lazy loading, fade transition) from module A to B (with TabView inside) - OK
Navigate from B to A - Crash

Very strange what here it's working well
https://play.nativescript.org/?template=play-ng&id=NBTjR6

Found the same issue. When using 'fade' transition effect to any component in the app everything goes well, but when navigation from a component that uses TabView to any other component, the exact same exception is throwed. Removed 'fade' transition and everything works fine.

@NickIliev I can confirm that I have experienced the same thing as @hakkism. But I also discovered something weird. If the page containing the tabs is transitioned into with 'fade' and you transition out of the page with any other transition but 'fade' there's no problem. If the page containing the tabs is transitioned into using anything but 'fade' though you can transition out of it with 'fade'! But if you use 'flip' you can use the same transition in and out of the component with tabs without problems. Hope this helps identifying the problem.

@ben-sab there is this PR which handles a case that was resulting in the same error with missing resourceId. The PR is now merged in the release branch which means that you can test it by installing the latest release candidate with

rm -rf node_modules platforms
npm i tns-core-modules@rc --save
tns run android 

Please @MaxiSonntag @anmaitrannguyen @samliaw @dominiosc9 @ben-sab do let me know if this is resolving your cases

@NickIliev Yes that's done it. Thanks and keep up the great work.

This still happens even in 6.1.2. But I only get the issue when trying to call this.router.backToPreviousPage();, the app doesn't respond to it but I can still switch between different views in TabView and/or BottomNavigation but when I then make a change in my code and it tries to reload the app I get the resource not found error.

Was this page helpful?
0 / 5 - 0 ratings