read properties of undefined (reading 'app') - android

An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:64319/lujnI6UYeBo=
TypeError: Cannot read properties of undefined (reading 'app')
at Object.app$ [as app] (http://localhost:49682/packages/firebase_core_web/src/interop/core.dart.lib.js:37:101)
at initializeApp (http://localhost:49682/packages/firebase_core_web/firebase_core_web.dart.lib.js:87:25)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:49682/dart_sdk.js:40666:34)
at Object._async [as async] (http://localhost:49682/dart_sdk.js:40697:7)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:49682/packages/firebase_core_web/firebase_core_web.dart.lib.js:80:20)
at initializeApp (http://localhost:49682/packages/firebase_core/firebase_core.dart.lib.js:106:59)
at initializeApp.next (<anonymous>)
at runBody (http://localhost:49682/dart_sdk.js:40666:34)
at Object._async [as async] (http://localhost:49682/dart_sdk.js:40697:7)
at Function.initializeApp (http://localhost:49682/packages/firebase_core/firebase_core.dart.lib.js:105:20)
at new main.MyApp.new (http://localhost:49682/packages/fupro/main.dart.lib.js:152:52)
at main$ (http://localhost:49682/packages/fupro/main.dart.lib.js:169:20)
at main (http://localhost:49682/web_entrypoint.dart.lib.js:39:29)
at main.next (<anonymous>)
at http://localhost:49682/dart_sdk.js:40646:33
at _RootZone.runUnary (http://localhost:49682/dart_sdk.js:40503:58)
at _FutureListener.thenAwait.handleValue (http://localhost:49682/dart_sdk.js:35432:29)
at handleValueCallback (http://localhost:49682/dart_sdk.js:36017:49)
at Function._propagateToListeners (http://localhost:49682/dart_sdk.js:36055:17)
at _Future.new.[_completeWithValue] (http://localhost:49682/dart_sdk.js:35897:23)
at http://localhost:49682/dart_sdk.js:35083:46
at _RootZone.runUnary (http://localhost:49682/dart_sdk.js:40503:58)
at _FutureListener.then.handleValue (http://localhost:49682/dart_sdk.js:35432:29)
at handleValueCallback (http://localhost:49682/dart_sdk.js:36017:49)
at Function._propagateToListeners (http://localhost:49682/dart_sdk.js:36055:17)
at _Future.new.[_completeWithValue] (http://localhost:49682/dart_sdk.js:35897:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:49682/dart_sdk.js:35920:35)
at Object._microtaskLoop (http://localhost:49682/dart_sdk.js:40808:13)
at _startMicrotaskLoop (http://localhost:49682/dart_sdk.js:40814:13)
at http://localhost:49682/dart_sdk.js:36279:9
The Flutter DevTools debugger and profiler on Chrome is available at: http://127.0.0.1:9104?uri=http://127.0.0.1:64319/lujnI6UYeBo=

Try changing firebase script line in index.html to
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script>. Reference

Related

showing error when implement authentication in react-native

Give me some solution about this .auth error in window opening`[Unhandled promise rejection:
TypeError: undefined is not an object (evaluating 'window.document.getElementsByTagName')]
at node_modules\#firebase\analytics\dist\esm\index.esm2017.js:null in findGtagScriptOnPage
at node_modules\#firebase\analytics\dist\esm\index.esm2017.js:null in _initializeAnalytics
at node_modules\#babel\runtime\helpers\asyncToGenerator.js:null in asyncGeneratorStep
at node_modules\#babel\runtime\helpers\asyncToGenerator.js:null in _next
at node_modules\promise\setimmediate\core.js:null in tryCallOne
at node_modules\promise\setimmediate\core.js:null in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _allocateCallback$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _callReactNativeMicrotasksPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in callReactNativeMicrotasks
`

TypeError: Cannot read properties of undefined (reading 'app')

So I am following a tutorial on creating a quiz app in flutter and I keep getting this error below when I run it. Here is my full code so far: https://github.com/NathanDevelops1/quizappmaker.
This is the error:
at Object.app$ [as app] (http://localhost:57087/packages/firebase/src/top_level.dart.lib.js:83:56)
at new cloud_firestore_web.FirestoreWeb.new (http://localhost:57087/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:806:57)
at Function.registerWith (http://localhost:57087/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:751:71)
at Object.registerPlugins (http://localhost:57087/packages/quizappmaker/generated_plugin_registrant.dart.lib.js:18:38)
at main (http://localhost:57087/web_entrypoint.dart.lib.js:31:35)
at main.next (<anonymous>)
at runBody (http://localhost:57087/dart_sdk.js:39250:34)
at Object._async [as async] (http://localhost:57087/dart_sdk.js:39281:7)
at main$ (http://localhost:57087/web_entrypoint.dart.lib.js:30:18)
at http://localhost:57087/main_module.bootstrap.js:19:10
at Array.forEach (<anonymous>)
at window.$dartRunMain (http://localhost:57087/main_module.bootstrap.js:18:32)
at <anonymous>:1:8
at Object.runMain (http://localhost:57087/dwds/src/injected/client.js:8825:21)
at http://localhost:57087/dwds/src/injected/client.js:22713:19
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:57087/dwds/src/injected/client.js:3851:15)
at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:57087/dwds/src/injected/client.js:11063:12)
at Object._asyncStartSync (http://localhost:57087/dwds/src/injected/client.js:3815:20)
at main__closure1.$call$body$main__closure (http://localhost:57087/dwds/src/injected/client.js:22725:16)
at main__closure1.call$1 (http://localhost:57087/dwds/src/injected/client.js:22652:19)
at StaticClosure._rootRunUnary [as call$2$5] (http://localhost:57087/dwds/src/injected/client.js:4185:16)
at _CustomZone.runUnary$2$2 (http://localhost:57087/dwds/src/injected/client.js:12436:39)
at _CustomZone.runUnaryGuarded$1$2 (http://localhost:57087/dwds/src/injected/client.js:12383:14)
at _ControllerSubscription._sendData$1 (http://localhost:57087/dwds/src/injected/client.js:11959:19)
at _DelayedData.perform$1 (http://localhost:57087/dwds/src/injected/client.js:12148:59)
at _PendingEvents_schedule_closure.call$0 (http://localhost:57087/dwds/src/injected/client.js:12197:14)
at Object._microtaskLoop (http://localhost:57087/dwds/src/injected/client.js:4023:24)
at StaticClosure._startMicrotaskLoop (http://localhost:57087/dwds/src/injected/client.js:4029:11)
at _AsyncRun__initializeScheduleImmediate_internalCallback.call$1 (http://localhost:57087/dwds/src/injected/client.js:10932:9)
at invokeClosure (http://localhost:57087/dwds/src/injected/client.js:1259:26)
at MutationObserver.<anonymous> (http://localhost:57087/dwds/src/injected/client.js:1278:18)
Please import firebase dependencies in your index.html:
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js" />
Refer here.

Ionic - Uncaught SyntaxError: Unexpected token On APK

I have an error since yesterday I try to fix. I successfully built an android apk using:
ionic cordova build android --prod --release
But the app stuck on white screen on device and emulator (GenyMotion). I inspected the logcat of GenyMotion. I figured out these:
> I/chromium( 5497): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token )", source: http://localhost/runtime.fcad956485f9614ff8b1.js (1)
> D/SystemWebChromeClient( 5497): http://localhost/polyfills.49d987a1d15d60566c3f.js: Line 1 : Uncaught SyntaxError: Unexpected token =>
> I/chromium( 5497): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token =>", source: http://localhost/polyfills.49d987a1d15d60566c3f.js (1)
> D/SystemWebChromeClient( 5497): http://localhost/main.2be168d95557cbdc0a3f.js: Line 1 : Uncaught SyntaxError: Unexpected token =>
> I/chromium( 5497): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token =>", source: http://localhost/main.2be168d95557cbdc0a3f.js (1)
I don't know why. They are no errors when building.
My package.json
...
"#angular/common": "~12.0.1",
"#angular/core": "~12.0.1",
"#angular/forms": "~12.0.1",
"#angular/platform-browser": "~12.0.1",
"#angular/platform-browser-dynamic": "~12.0.1",
"#ionic/angular": "^5.5.2",
"ionic": "^5.4.16",
"cordova-android": "^9.0.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-ionic-webview": "^5.0.0",
...
"#typescript-eslint/eslint-plugin": "4.16.1",
"#typescript-eslint/parser": "4.16.1",
"typescript": "~4.2.4"
My tsconfig.json.
...
"target": "es2015",
"module": "es2020",
"lib": ["es2018", "dom"]
...
After a real battle in order to fix the issue since 3 days,
i solved the problem.
Ionic 5 angular 12 use es2015 as a target when building.
I set "target" to es5 in tsconfig.json and errors in runtime.**.js, polyfills.**.json disappeared
es5 transform ES6 function to standard functions.
More info at
https://www.typescriptlang.org/tsconfig
Here is pretty clear. You have a syntax error. I suppose you can check logs for ionic cordova build android --prod. Probably It will show which files and lines generate these problems.
If you use linter you can try to run npm run lint to check any problems with your code.
ionic + angular has update the type script compiler in the recent update as
Root folder > tcconfig.json > compilerOptions > target > es2020 - This is causing the issue in android version 29
Chang the target as es2015 to resolve the issue

Why do I get this error while building an APK with Cordova?

I'm trying to make an APK of a web app, I wrapped it into Cordova.
I followed various tutorials, installed Gradle and made it work.
When i run cordova build android ---verbose from CMD, I get this error:
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\USER\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
Running command: C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradlew cdvBuildDebug -b C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\build.gradle
Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from 'C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradle\wrapper\gradle-wrapper.properties'.
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:61)
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:45)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:62)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 16: C:UsersUSERDownloadsgradle-6.3-bin.zip
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parse(URI.java:3058)
at java.net.URI.<init>(URI.java:588)
at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:80)
at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:67)
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:54)
... 2 more
Command finished with error code 1: C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradlew cdvBuildDebug,-b,C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\build.gradle
C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradlew: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from 'C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradle\wrapper\gradle-wrapper.properties'.
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:61)
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:45)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:62)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 16: C:UsersUSERDownloadsgradle-6.3-bin.zip
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parse(URI.java:3058)
at java.net.URI.<init>(URI.java:588)
at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:80)
at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:67)
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:54)
... 2 more
Error: C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradlew: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from 'C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\platforms\android\gradle\wrapper\gradle-wrapper.properties'.
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:61)
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:45)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:62)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 16: C:UsersUSERDownloadsgradle-6.3-bin.zip
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parse(URI.java:3058)
at java.net.URI.<init>(URI.java:588)
at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:80)
at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:67)
at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:54)
... 2 more
at ChildProcess.whenDone (C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\node_modules\cordova-common\src\superspawn.js:135:23)
at ChildProcess.emit (events.js:310:20)
at ChildProcess.cp.emit (C:\Users\USER\Desktop\Tlf Cordova\AngularToMobileProject-master\node_modules\cordova-common\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
Using Gradle 6.3
I tried a lot of tutorials and StackOverflow solution, but none of them work for me.
My gradle-wrapper.properties
Tue Oct 16 17:39:45 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=C:\Users\USER\Downloads\gradle-6.3-bin.zip
I am using gradle 5.1.1 for cordova9.0.
There is no problems.

Random System.ArgumentException: 'jobject' must not be IntPtr.Zero

We have random System.ArgumentException with Xamarin on android. It is completely random - it can occur anytime and anywhere, on any platform. We registered it on 5.1, 5.0, 4.4.4.
It has no adequate stacktrace, it has no place where it thrown, I can't catch it with anything. I think it might be somehow related to async void, we use MVVMCross in the project and there are many async void Init and async void DoMvxCommand methods. But all of them enclosed in try-catch blocks.
I crucially need any advice how to fix or at least find the reason of this crash. Here is the latest crash log
undefined INFO: ActivityManager : Displayed com.website.app/md599d9a15f782f9118e8e70c354562b227.SuccessPaymentView: +220ms
undefined WARN: ContextImpl : Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1629 com.android.server.InputMethodManagerService$6.run:2728 java.lang.Thread.run:818 <bottom of call stack> <bottom of call stack>
undefined WARN: ActivityManager : mDVFSHelper.release()
undefined INFO: Timeline : Timeline: Activity_windows_visible id: ActivityRecord{1aca0d50 u0 com.website.app/md599d9a15f782f9118e8e70c354562b227.SuccessPaymentView t5672} time:169720248
undefined INFO: MonoDroid : UNHANDLED EXCEPTION:
undefined INFO: MonoDroid : System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined INFO: MonoDroid : Parameter name: jobject
undefined INFO: MonoDroid : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined INFO: MonoDroid : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined INFO: MonoDroid : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined INFO: MonoDroid : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined INFO: MonoDroid : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined INFO: MonoDroid : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined DEBUG: LockPatternUtilsCache : getCarrierLockPlusMode()
undefined DEBUG: LockPatternUtilsCache : value : false
undefined WARN: Xamarin.Insights : Warning: Unhandled exception: System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined WARN: Xamarin.Insights : Parameter name: jobject
undefined WARN: Xamarin.Insights : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined WARN: Xamarin.Insights : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined WARN: Xamarin.Insights : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined WARN: Xamarin.Insights : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined WARN: Xamarin.Insights : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined WARN: Xamarin.Insights : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined WARN: art : JNI RegisterNativeMethods: attempt to register 0 native methods for md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable
undefined DEBUG: AndroidRuntime : Shutting down VM
undefined WARN: System.err : java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
undefined WARN: System.err : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
undefined WARN: System.err : Caused by: java.lang.reflect.InvocationTargetException
undefined WARN: System.err : at java.lang.reflect.Method.invoke(Native Method)
undefined WARN: System.err : at java.lang.reflect.Method.invoke(Method.java:372)
undefined WARN: System.err : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
undefined WARN: System.err : ... 1 more
undefined WARN: System.err : Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined WARN: System.err : Parameter name: jobject
undefined WARN: System.err : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined WARN: System.err : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined WARN: System.err : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined WARN: System.err : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined WARN: System.err : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined WARN: System.err : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined WARN: System.err : at mono.java.lang.RunnableImplementor.n_run(Native Method)
undefined WARN: System.err : at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
undefined WARN: System.err : at android.os.Handler.handleCallback(Handler.java:739)
undefined WARN: System.err : at android.os.Handler.dispatchMessage(Handler.java:95)
undefined WARN: System.err : at android.os.Looper.loop(Looper.java:145)
undefined WARN: System.err : at android.app.ActivityThread.main(ActivityThread.java:5832)
undefined WARN: System.err : ... 4 more
undefined WARN: FlurryAgent : Error logged: uncaught
undefined WARN: FlurryAgent : Flurry session ended
undefined ERROR: AndroidRuntime : FATAL EXCEPTION: main
undefined ERROR: AndroidRuntime : Process: com.website.app, PID: 27622
undefined ERROR: AndroidRuntime : java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
undefined ERROR: AndroidRuntime : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
undefined ERROR: AndroidRuntime : Caused by: java.lang.reflect.InvocationTargetException
undefined ERROR: AndroidRuntime : at java.lang.reflect.Method.invoke(Native Method)
undefined ERROR: AndroidRuntime : at java.lang.reflect.Method.invoke(Method.java:372)
undefined ERROR: AndroidRuntime : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
undefined ERROR: AndroidRuntime : ... 1 more
undefined ERROR: AndroidRuntime : Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.ArgumentException: 'jobject' must not be IntPtr.Zero.
undefined ERROR: AndroidRuntime : Parameter name: jobject
undefined ERROR: AndroidRuntime : at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
undefined ERROR: AndroidRuntime : at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
undefined ERROR: AndroidRuntime : at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
undefined ERROR: AndroidRuntime : at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
undefined ERROR: AndroidRuntime : at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
undefined ERROR: AndroidRuntime : at (wrapper dynamic-method) object.81971695-c4eb-4dd7-9e27-0dec45822877 (intptr,intptr) <0x0003b>
undefined ERROR: AndroidRuntime : at mono.java.lang.RunnableImplementor.n_run(Native Method)
undefined ERROR: AndroidRuntime : at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
undefined ERROR: AndroidRuntime : at android.os.Handler.handleCallback(Handler.java:739)
undefined ERROR: AndroidRuntime : at android.os.Handler.dispatchMessage(Handler.java:95)
undefined ERROR: AndroidRuntime : at android.os.Looper.loop(Looper.java:145)
undefined ERROR: AndroidRuntime : at android.app.ActivityThread.main(ActivityThread.java:5832)
undefined ERROR: AndroidRuntime : ... 4 more
undefined WARN: ActivityManager : Force finishing activity com.website.app/md599d9a15f782f9118e8e70c354562b227.SuccessPaymentView
undefined DEBUG: PowerManagerService : [input device light] setInputDeviceLightOn is called : 1
undefined WARN: ActivityManager : Force finishing activity com.website.app/md599d9a15f782f9118e8e70c354562b227.PaymentFormView
undefined INFO: SQLiteSecureOpenHelper : getWritableDatabase(pwd)
undefined INFO: SQLiteSecureOpenHelper : getDatabaseLocked(b,b,pwd)...
undefined INFO: dumpstate : begin
undefined DEBUG: StatusBarManagerService : manageDisableList userId=0 what=0x0 pkg=WindowManager.LayoutParams
undefined INFO: SurfaceFlinger : id=3018 createSurf (49x49),1 flag=4, Application Error: com.website.app
undefined DEBUG: CrashAnrDetector : processName: com.website.app
undefined DEBUG: CrashAnrDetector : broadcastEvent : com.website.app data_app_crash
undefined INFO: SQLiteSecureOpenHelper : getWritableDatabase(pwd)
undefined INFO: SQLiteSecureOpenHelper : getDatabaseLocked(b,b,pwd)...
undefined WARN: ContextImpl : Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1643 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:296 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102
undefined INFO: WifiStateMachine : CMD_RSSI_POLL : calculateWifiScore in!
undefined INFO: WifiStateMachine : CMD_RSSI_POLL : calculateWifiScore out!
undefined INFO: WifiStateMachine : CMD_RSSI_POLL : out!
undefined ERROR: android.os.Debug : !#Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error
I had a very similar issue with Android throwing NullRefenceExceptions seemingly randomly (which was actually because things were running asynchronously/concurrently) and they would never break at the correct spot and the StackTrace was completely worthless. See the thread and solution here.
Anyway, 2 parts of the solution that allowed me to figure out the issue were:
Turn on the setting in Visual Studio in order to break/throw on the specific exception. To do this, head to this post. The post describes going to Visual Studio -> Debug -> Exceptions... (or Ctrl + Alt + E)
Then, to find that exception, expand 'Common Language Runtime Exceptions' -> 'System' -> then check the 'Thrown' box next 'System.ArgumentException'. Now it will, hopefully, break on the line where that exception actually happens. Also you will definitely want to turn this off once the issue has been fixed so that you do not start hitting exceptions that you do not really need to handle.
Override Android's exception handler event, called UnhandledExceptionRaiser, and then set a breakpoint within the event in order to help you catch some of these exceptions before your app crashes. The event info can be found in this post (I ended up just putting that event into MainActivity.cs.
Here is my exception event code:
AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) => {
args.Handled = false;
};
I just put a break point on args.Handled and look through the details but you could also print out the exception or something.
Finally, one more thing that I found on my own but have heard others mention, is that you can usually find more helpful exception source info by digging into the exception details and finding captured_traces.
To find this, you need to keep expanding the exception instance's base property, in the exception details window, until you are in System.Exception. Then follow the steps below (though sometimes you have to go into the inner exception before following the below steps):
System.Exception -> Non-public members -> captured_traces -> then you usually want [0] but sometimes there are others to look through -> Non-public members -> frames -> now you usually either want [0] or you want the last one in the list -> Non-public members -> and finally you will be able to see the file in the fileName property and the line number in the 'lineNumber' property (imagine that).
Now I am sure there is a fancy way to extract this info with reflection or something without digging through the exception details. If anyone knowns how, I would love to hear it!

Categories

Resources