nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
218 stars 80 forks source link

App crash: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference #383

Closed HamoBoker closed 2 years ago

HamoBoker commented 2 years ago

Error

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method run failed
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
System.err: 
System.err: StackTrace:
System.err: (file: app/webpack:/bitlims/node_modules/@nativescript-community/ui-material-core/android/utils.js:186:0)
System.err:     at (file: app/webpack:/bitlims/node_modules/@nativescript-community/ui-material-core/index.android.js:276:43)
System.err:     at invoke(file: app/webpack:/bitlims/node_modules/@nativescript/core/timer/index.android.js:18:0)
System.err:     at run(file: app/webpack:/bitlims/node_modules/@nativescript/core/timer/index.android.js:22:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1175)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1153)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1149)
System.err:     at com.tns.gen.java.lang.Runnable.run(Runnable.java:17)
System.err:     at android.os.Handler.handleCallback(Handler.java:789)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:98)
System.err:     at android.os.Looper.loop(Looper.java:164)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6944)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
System.err: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
System.err:     at com.nativescript.material.core.Utils.createStateListAnimator(Utils.java:24)
System.err:     ... 14 more
JS: XXX uncaughtError =>  Error: Calling js method run failed
JS: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

package.json

  "dependencies": {
    "@nativescript-community/ui-material-bottom-navigation": "^7.0.5",
    "@nativescript-community/ui-material-bottomnavigationbar": "^7.0.5",
    "@nativescript-community/ui-material-bottomsheet": "^7.0.5",
    "@nativescript-community/ui-material-core": "^7.0.5",
    "@nativescript-community/ui-material-progress": "^7.0.5",
    "@nativescript-community/ui-material-snackbar": "^7.0.5",
    "@nativescript-community/ui-material-tabs": "^7.0.5",
    "@nativescript/core": "^8.2.3",
    "@nativescript/datetimepicker": "^2.1.10",
    "@nativescript/firebase-auth": "^1.2.2",
    "@nativescript/firebase-core": "^1.2.2",
    "@nativescript/firebase-crashlytics": "^1.2.2",
    "@nativescript/firebase-firestore": "^1.2.2",
    "@nativescript/localize": "^5.0.4",
    "@nativescript/tailwind": "^2.0.0",
    "@nativescript/theme": "~3.0.2",
    "@nstudio/nativescript-loading-indicator": "^4.1.2",
    "nativescript-drop-down": "^6.0.2",
    "nativescript-ui-listview": "^10.1.1",
    "nativescript-vue": "~2.9.1",
    "nativescript-vue-router-extended": "^1.1.8",
    "tailwindcss": "^3.0.24",
    "vuex": "^3.6.2"
  },
  "devDependencies": {
    "@mdi/font": "^6.6.96",
    "@nativescript/android": "8.2.2",
    "@nativescript/eslint-plugin": "^0.0.4",
    "@nativescript/ios": "8.2.3",
    "@nativescript/webpack": "~5.0.6",
    "@typescript-eslint/parser": "^5.22.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^7.28.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-vue": "^8.7.1",
    "nativescript-vue-template-compiler": "~2.9.1",
    "prettier": "^2.6.2",
    "scss-symbols-parser": "^2.0.1",
    "string-replace-loader": "^3.1.0"
  }
farfromrefug commented 2 years ago

@HamoBoker thanks for the report. Should be fixed in 7.0.6

HamoBoker commented 2 years ago

What amazing team, Thank you so much 💙