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

"isClosed" callback not working on Android #5

Open
mcalc001 opened this issue Feb 26, 2021 · 0 comments
Open

"isClosed" callback not working on Android #5

mcalc001 opened this issue Feb 26, 2021 · 0 comments

Comments

@mcalc001
Copy link

Hey, the "isClosed" callback works perfectly on IOS but it doesn't seem to be working on android.

I'm building my App on angular. (see below for package JSON)

This is my function:

  openWebView({
          url: data,
          toolbarColor: this.env.toolbarColor,
          toolbarControlsColor: this.env.toolbarControlsColor,
          isClosed: (dat)a => {
            console.log(dat, 'closed');
          },
      });

Also when i've tried to call the "Init()" function on the main.ts and App component i receive this error:
`System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
System.err:
System.err: StackTrace:
System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
System.err: at ./app.module.ts(file: app/app.module.ts:49:4)
System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
System.err: at (file: app/main.ts:1:106)
System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2672:30)
System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0)
System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57)
System.err: at require(:1:266)
System.err:
System.err:
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
System.err:
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
System.err:
System.err: StackTrace:
System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
System.err: at ./app.module.ts(file: app/app.module.ts:49:4)
System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
System.err: at (file: app/main.ts:1:106)
System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2672:30)
System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0)
System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57)
System.err: at require(:1:266)
System.err:
System.err:
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6720)
System.err: at android.app.ActivityThread.access$1300(ActivityThread.java:237)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
System.err: at android.os.Looper.loop(Looper.java:223)
System.err: at android.app.ActivityThread.main(ActivityThread.java:7660)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
System.err: Caused by: com.tns.NativeScriptException: Error calling module function
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
System.err:
System.err: StackTrace:
System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
System.err: at ./app.module.ts(file: app/app.module.ts:49:4)
System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
System.err: at (file: app/main.ts:1:106)
System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2672:30)
System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0)
System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57)
System.err: at require(:1:266)
System.err:
System.err:
System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
System.err: at com.tns.Runtime.runModule(Native Method)
System.err: at com.tns.Runtime.runModule(Runtime.java:689)
System.err: at com.tns.Runtime.run(Runtime.java:681)
System.err: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6715)
System.err: ... 8 more
Successfully synced application com.endsleighwalletapp.EndsleighWalletApp on device 192.168.1.225:5555.
File change detected. Starting incremental webpack compilation...
Hash: 7ad56d00832cb573316e
Version: webpack 4.44.2
Time: 1066ms
Built at: 26/02/2021 14:46:29
Asset Size Chunks Chunk Names
bundle.js 1.09 MiB bundle [emitted] bundle

  • 5 hidden assets
    Entrypoint bundle = runtime.js vendor.js bundle.js
    [../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built]
    [./app.module.ts] 5.53 KiB {bundle} [built]
    [./main.ts] 3.82 KiB {bundle} [built]
    • 1038 hidden modules
      Webpack compilation complete. Watching for file changes.
      Webpack build done!
      Successfully transferred bundle.js on device 192.168.1.225:5555.
      Restarting application on device 192.168.1.225:5555...
      System.err: An uncaught Exception occurred on "main" thread.
      System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
      System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
      System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
      System.err:
      System.err: StackTrace:
      System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
      System.err: at ./app.module.ts(file: app/app.module.ts:49:4)
      System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
      System.err: at (file: app/main.ts:1:106)
      System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2662:30)
      System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
      System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0)
      System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
      System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57)
      System.err: at require(:1:266)
      System.err:
      System.err:
      System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
      System.err:
      System.err: StackTrace:
      System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
      System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
      System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
      System.err:
      System.err: StackTrace:
      System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
      System.err: at ./app.module.ts(file: app/app.module.ts:49:4)
      System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
      System.err: at (file: app/main.ts:1:106)
      System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2662:30)
      System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
      System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0)
      System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
      System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57)
      System.err: at require(:1:266)
      System.err:
      System.err:
      System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
      System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6720)
      System.err: at android.app.ActivityThread.access$1300(ActivityThread.java:237)
      System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
      System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
      System.err: at android.os.Looper.loop(Looper.java:223)
      System.err: at android.app.ActivityThread.main(ActivityThread.java:7660)
      System.err: at java.lang.reflect.Method.invoke(Native Method)
      System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
      System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
      System.err: Caused by: com.tns.NativeScriptException: Error calling module function
      System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
      System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
      System.err:
      System.err: StackTrace:
      System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0)
      System.err: at ./app.module.ts(file: app/app.module.ts:49:4)
      System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
      System.err: at (file: app/main.ts:1:106)
      System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2662:30)
      System.err: at webpack_require(file: app/webpack/bootstrap:74:0)
      System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0)
      System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0)
      System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57)
      System.err: at require(:1:266)
      System.err:
      System.err:
      System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference
      System.err: at com.tns.Runtime.runModule(Native Method)
      System.err: at com.tns.Runtime.runModule(Runtime.java:689)
      System.err: at com.tns.Runtime.run(Runtime.java:681)
      System.err: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
      System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
      System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6715)
      System.err: ... 8 more
      Successfully synced application com.endsleighwalletapp.EndsleighWalletApp on device 192.168.1.225:5555.`

My package JSON

}, "dependencies": { "@angular/animations": "~11.0.0", "@angular/common": "~11.0.0", "@angular/compiler": "~11.0.0", "@angular/core": "~11.0.0", "@angular/forms": "~11.0.0", "@angular/platform-browser": "~11.0.0", "@angular/platform-browser-dynamic": "~11.0.0", "@angular/router": "~11.0.0", "@nativescript/angular": "~11.0.1", "@nativescript/animated-circle": "^1.1.5", "@nativescript/appversion": "~2.0.0", "@nativescript/core": "~7.2.1", "@nativescript/directions": "^2.0.0", "@nativescript/email": "~2.0.0", "@nativescript/fingerprint-auth": "~7.0.0", "@nativescript/firebase": "^11.1.0", "@nativescript/secure-storage": "~3.0.0", "@nstudio/nativescript-cardview": "~2.0.1", "@nstudio/nativescript-https": "^3.0.1", "@nstudio/nativescript-pulltorefresh": "3.0.1", "@types/node": "^12.12.12", "html-encoder-decoder": "^1.3.8", "jwt-decode": "^2.2.0", "nativescript-awesome-webview-with-custom-menu-items": "^70.1.1", "nativescript-lottie": "^5.0.3", "nativescript-ngx-fonticon": "^7.0.0", "nativescript-rater": "^2.1.2", "nativescript-root-detection": "^1.0.0", "nativescript-taptic-engine": "^2.1.0", "nativescript-ui-gauge": "^7.0.2", "nativescript-ui-listview": "^9.1.0", "reflect-metadata": "~0.1.13", "rxjs": "^6.6.0", "rxjs-compat": "^6.5.3", "zone.js": "^0.9.1" }, "devDependencies": { "@angular/compiler-cli": "~11.0.0", "@nativescript/android": "7.0.1", "@nativescript/ios": "7.2.0", "@nativescript/types": "~7.2.0", "@nativescript/webpack": "~4.0.0", "@ngtools/webpack": "~11.0.0", "@typescript-eslint/eslint-plugin": "^4.6.0", "@typescript-eslint/parser": "^4.5.0", "codelyzer": "~5.2.0", "eslint": "^7.11.0", "eslint-config-airbnb-typescript": "^12.0.0", "eslint-config-prettier": "^6.13.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-nativescript": "0.0.0", "eslint-plugin-prettier": "^3.1.4", "husky": "^4.3.7", "lint-staged": "^10.5.3", "node-sass": "^4.13.1", "prettier": "^2.1.2", "sonarqube-scanner": "^2.8.0", "typescript": "~4.0.0", "webpack-obfuscator": "^0.27.2" }, "readme": "NativeScript Application", "main": "main.js" }

System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0) System.err: System.err: StackTrace: System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0) System.err: at ./app.module.ts(file: app/app.module.ts:49:4) System.err: at __webpack_require__(file: app/webpack/bootstrap:74:0) System.err: at (file: app/main.ts:1:106) System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2662:30) System.err: at __webpack_require__(file: app/webpack/bootstrap:74:0) System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0) System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57) System.err: at require(:1:266) System.err: System.err: System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference System.err: System.err: StackTrace: System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0) System.err: System.err: StackTrace: System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0) System.err: at ./app.module.ts(file: app/app.module.ts:49:4) System.err: at __webpack_require__(file: app/webpack/bootstrap:74:0) System.err: at (file: app/main.ts:1:106) System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2662:30) System.err: at __webpack_require__(file: app/webpack/bootstrap:74:0) System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0) System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57) System.err: at require(:1:266) System.err: System.err: System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6720) System.err: at android.app.ActivityThread.access$1300(ActivityThread.java:237) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) System.err: at android.os.Handler.dispatchMessage(Handler.java:106) System.err: at android.os.Looper.loop(Looper.java:223) System.err: at android.app.ActivityThread.main(ActivityThread.java:7660) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) System.err: Caused by: com.tns.NativeScriptException: Error calling module function System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference System.err: File: (file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0) System.err: System.err: StackTrace: System.err: init(file: node_modules/nativescript-awesome-webview-with-custom-menu-items/awesome-webview.android.js:21:0) System.err: at ./app.module.ts(file: app/app.module.ts:49:4) System.err: at __webpack_require__(file: app/webpack/bootstrap:74:0) System.err: at (file: app/main.ts:1:106) System.err: at ./main.ts(file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2662:30) System.err: at __webpack_require__(file: app/webpack/bootstrap:74:0) System.err: at checkDeferredModules(file: app/webpack/bootstrap:43:0) System.err: at webpackJsonpCallback(file: app/webpack/bootstrap:30:0) System.err: at (file:///data/data/com.endsleighwalletapp.EndsleighWalletApp/files/app/bundle.js:2:57) System.err: at require(:1:266) System.err: System.err: System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.bindService(android.content.Intent, android.content.ServiceConnection, int)' on a null object reference System.err: at com.tns.Runtime.runModule(Native Method) System.err: at com.tns.Runtime.runModule(Runtime.java:689) System.err: at com.tns.Runtime.run(Runtime.java:681) System.err: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21) System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192) System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6715) System.err: ... 8 more Successfully synced application com.endsleighwalletapp.EndsleighWalletApp on device 192.168.1.225:5555.

Thanks in advance!

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

No branches or pull requests

1 participant