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
Android: NullPointerException on navigation (Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()') #8441
Comments
|
note that other navigation work. This is caused by a specific navigation (back to login route), and I couldn't figure out what is so different about it. |
|
@cghislai is there a 3rd-party plugin used in the pages that are involved in the navigation? Try to isolate the issue by removing parts of your code and re-testing the case. Also, what is the version of |
|
@NickIliev indeed this seem related to some plugins. removing My version of tns-core-modules is "^6.4.1". EDIT: I can reproduce without cardview, it does not seems completely deterministic, im trying to narrow down. |
|
So I have this in the view Im navigating from: with the corresponding css: and that triggers the crash. To avoid the crash, I can either:
Enabling the CardView plugin triggers the crash in all cases. |
|
No above solution work. |
|
any updates on this? I currently experience the same issue. |
|
Nothing happen with NS. Issue still occurs, peoples have to do own patches for framework... (note - same problem on latest NS 8) |


Environment
tns info:
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.4.0 and the latest available version is 6.4.1.
⚠ Update available for component tns-core-modules. Your current version is 6.4.1 and the latest available version is 6.4.2.
✔ Component tns-android has 6.4.1 version and is up to date.
⚠ Update available for component tns-ios. Your current version is 6.4.0 and the latest available version is 6.4.2.
package.json dependencies:
"@nstudio/nativescript-cardview": "^1.0.0",
"nativescript-angular": "^8.21.0",
"nativescript-background-http": "^4.2.1",
"nativescript-handle-file-cghislai": "^6.4.0",
"nativescript-imagepicker": "^7.1.0",
"nativescript-mediafilepicker": "^3.0.0",
"nativescript-perms": "^2.0.3",
"nativescript-share-file": "file:nativescript-share-file-1.0.6.tgz",
"nativescript-theme-core": "~1.0.6",
"nativescript-toast": "^2.0.0",
"nativescript-ui-chart": "^7.1.1",
"nativescript-ui-sidedrawer": "^8.0.0",
"@nativescript/schematics": "~0.7.3",
"@nativescript/tslint-rules": "0.0.5",
"nativescript-dev-webpack": "^1.5.0",
android version tested: 6.0
Describe the bug
When triggering a navigation, my app crashes with the following exception:
I couldn't reproduce the issue in a poc on nativescript-playground. I tried plyaing around with the route hierarchy and the
<page-router-outlet>uses, but I didn't manage to reproduce there unfortunately.The application was a web-only angular app imported into a nativescript project, so there are some constraint on the application modules and components layout.
Debugging nativescript doc, and consulting android documentation, i think the issue is that nativescript expect
View.getDrawingCache()to always return a bitmap, whereas documentation seems to imply null must be checked.In nativescript frame.js, there is those lines:
NativeScript/nativescript-core/ui/frame/frame.android.ts
Lines 1049 to 1052 in e57d5d9
With the android documentation stating (for
setDrawingCacheEnabled):The text was updated successfully, but these errors were encountered: