Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tsonevn opened this issue Nov 5, 2018 · 24 comments

Comments

@tsonevn
Copy link

tsonevn commented Nov 5, 2018

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:\tns\ema2>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

@tsonevn
Copy link
Author

tsonevn commented Nov 6, 2018

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.

@anmaitrannguyen
Copy link

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

@samliaw
Copy link

samliaw commented Nov 7, 2018

I can't remember exactly the steps I perform, but you can do the following 2 steps

  1. tns plugin update
  2. npm update

@anmaitrannguyen
Copy link

Tried the above solution, still no luck.

@zbranzov
Copy link
Contributor

zbranzov commented Nov 7, 2018

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

@anmaitrannguyen
Copy link

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.

@NickIliev
Copy link
Collaborator

NickIliev commented Nov 7, 2018

@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

@anmaitrannguyen
Copy link

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.

@tsonevn tsonevn closed this as completed Nov 7, 2018
@calleja23
Copy link

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

@nuochong
Copy link

nuochong commented Nov 8, 2018

@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.

@MaxiSonntag
Copy link

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?

@hakkism
Copy link

hakkism commented Jan 23, 2019

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.

@NickIliev
Copy link
Collaborator

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

@jdaf2008
Copy link

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

@hakkism
Copy link

hakkism commented Jan 23, 2019

@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.

@NickIliev
Copy link
Collaborator

NickIliev commented Jan 24, 2019

@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 NativeScript/NativeScript#6810

@hakkism
Copy link

hakkism commented Jan 24, 2019

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

@MaxiSonntag
Copy link

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

@Stanteq
Copy link

Stanteq commented Feb 8, 2019

@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

@dominiosc9
Copy link

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.

@ben-sab
Copy link

ben-sab commented Feb 24, 2019

@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.

@NickIliev
Copy link
Collaborator

@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

@ben-sab
Copy link

ben-sab commented Feb 26, 2019

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

@ChristofferSkog21st
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests