Android app crashes instantly after adding RealmReactPackage - android

I followed the instructions from the realm page and did these steps:
npm install realm
react-native link realm --> For iOS everything works out without any further steps at this point.
Opened android studio and updated changes in settings.gradle, app/build.gradle and imported the RealmReactPackage in MainApplication.java
If I build and start the app, everything is working out fine. Then I add new RealmReactPackage() to the list to the other ReactPackages.
If I start the app now, the app crashes immediately. The logcat doesn't say any reason for the crash, but I add the output anyways below.
Things I tried already:
Clear caches
Restart packager
Deinstall app from emulator
Clear node-modules and run npm install again and repeat the steps from above
My setup:
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-navigation": "v2.0.1937"
Node version 9.5.0
Android Studio version: 3.1.3
What I didn't do so far:
There is one instruction at the realm site under Examples:
Note that on Android, you need the NDK installed and must have set the ANDROID_NDK environment variable.
export ANDROID_NDK=/usr/local/Cellar/android-ndk/r10e
My Question is, is this relevant for my config or just for the examples?
LogCat Output:
07-03 17:51:04.909 1664 1676 I ActivityManager: START u0 {flg=0x10100000 cmp=com.cowoperation/.MainActivity} from uid 2000
07-03 17:51:04.938 1664 2392 I ActivityManager: Start proc 32299:com.cowoperation/u0a91 for activity com.cowoperation/.MainActivity
07-03 17:51:05.319 32299 32325 V FA : App package, google app id: com.cowoperation, 1:314188610363:android:2d8c823aa5045bd7
07-03 17:51:05.320 32299 32299 V fb-UnpackingSoSource: locked dso store /data/user/0/com.cowoperation/lib-main
07-03 17:51:05.320 32299 32325 I FA : adb shell setprop debug.firebase.analytics.app com.cowoperation
07-03 17:51:05.320 32299 32299 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.cowoperation/lib-main
07-03 17:51:05.321 32299 32299 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.cowoperation/lib-main
07-03 17:51:05.654 32299 32345 I zygote : Thread[30,tid=32345,Native,Thread*=0x88b19a00,peer=0x13214b48,"Thread-8"] recursive attempt to load library "/data/app/com.cowoperation-gxY-ptC8QV3xKg796vAtEA==/lib/x86/libfb.so"
07-03 17:51:05.808 1664 1690 I ActivityManager: Displayed com.cowoperation/.MainActivity: +878ms
07-03 17:51:05.880 32299 32325 V FA : Event recorded: Event{appId='com.cowoperation', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913}]}
07-03 17:51:05.979 32299 32345 E AndroidRuntime: Process: com.cowoperation, PID: 32299
07-03 17:51:05.979 32299 32345 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN5realm8jni_util9hack_initEv" referenced by "/data/app/com.cowoperation-gxY-ptC8QV3xKg796vAtEA==/lib/x86/librealmreact.so"...
07-03 17:51:05.980 32299 32345 E UncaughtException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN5realm8jni_util9hack_initEv" referenced by "/data/app/com.cowoperation-gxY-ptC8QV3xKg796vAtEA==/lib/x86/librealmreact.so"...
07-03 17:51:06.074 32299 32325 V FA : Event recorded: Event{appId='com.cowoperation', name='app_exception(_ae)', params=Bundle[{firebase_event_origin(_o)=crash, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913, timestamp=1530633065983, fatal=1}]}
07-03 17:51:06.153 32299 32325 V FA : Event recorded: Event{appId='com.cowoperation', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=596, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913}]}
07-03 17:51:06.359 1664 2392 W ActivityManager: Force finishing activity com.cowoperation/.MainActivity
07-03 17:51:06.373 1664 1684 I ActivityManager: Showing crash dialog for package com.cowoperation u0
07-03 17:51:06.569 32299 32325 V FA : Event recorded: Event{appId='com.cowoperation', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=266, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6439080053319785913}]}

Related

Invalid ELF file

if I run my application on Android I always get this error and the application crashes immediately:
03-25 14:29:44.011 1833 7290 I ActivityManager: START u0 {flg=0x10000000 cmp=cz.jech.muzika/.Muzika} from uid 2000
03-25 14:29:44.093 1833 1998 I ActivityManager: Start proc 17399:cz.jech.muzika/u0a464 for activity cz.jech.muzika/.Muzika
03-25 14:29:44.098 17399 17399 E cz.jech.muzika: Not starting debugger since process cannot load the jdwp agent.
03-25 14:29:44.193 1833 2400 I WindowManager: SURFACE show Surface(name=Splash Screen cz.jech.muzika)/#0xbe60fc9: Splash Screen cz.jech.muzika
03-25 14:29:44.298 14007 17395 D InstalledAppProviderSer: insertAppIntoDb cz.jech.muzika
03-25 14:29:44.302 17399 17414 E AndroidRuntime: Process: cz.jech.muzika, PID: 17399
03-25 14:29:44.302 17399 17414 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: invalid ELF file "/data/app/cz.jech.muzika-iMRmvRSnmwPpVhRlaZJJwg==/lib/arm64/libswscale.so" load segment[4]: p_offset (0x41000) + p_filesz (0x0) ( = 0x41000) past end of file (0x40910)
03-25 14:29:44.306 1833 9531 W ActivityManager: Force finishing activity cz.jech.muzika/.Muzika
03-25 14:29:44.327 1833 4076 I ActivityManager: Process cz.jech.muzika (pid 17399) has died: vis TOP
03-25 14:29:44.336 1140 1237 W SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{485887d token=Token{1c63ed4 ActivityRecord{a8f0c27 u0 cz.jech.muzika/.Muzika t4527}}}#0
What could be the root cause of the error? The ffmpeg libraries I use are from here. What does the error "invalid ELF file" mean?
The file /lib/arm64/libswscale.so is corrupt. In particular, it has a PT_LOAD segment with offset that is past the end of the file (file size is 0x40910) and has 0 length.
One way the file may have become corrupt is if you did an FTP transfer and forgot to set binary mode. (Of course there are numerous other ways, such as decompressing the archive and running out of disk space.)
Your best bet is to re-extract the archive, check the length and md5sum of the file, and use scp or something other than ASCII FTP transfer, then verify that the md5sum is still the same on the target device.

Page does not render completely and keeps on flickering through appium but renders correctly when done manually

I have a test case scenario to add medicine to a cart as below:
send medicine name in textbox
from the search results select the medicine by clicking ADD button
verify add medicine
Issue: When I click on the add button in step 2, the medicine gets added, but the page starts to flicker i.e. page keeps on rendering or refreshing (I don't know what to call in exactly), and so I am not able to perform the next steps.
One more concern is that the same scenario works perfectly when executed manually. The issue occurs only for execution done via appium. If I stop the appium server at the point where issue occurs, the flickering stops.
So seems to me like appium is messing something up.
My Android app is React Native app.
At the point of failure I can see below failure in adb logs:
Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
ADB logs:
09-19 15:20:05.274 2132 2132 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-19 15:20:05.690 2132 2132 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-19 15:20:10.719 2132 2132 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-19 15:20:10.770 15240 15240 I chatty : uid=10105(com.medlife.customer) expire 5 lines
09-19 15:20:10.784 2132 2132 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-19 15:20:10.809 2132 2132 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-19 15:20:10.916 2132 2132 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
ADB logs while executing on real device:
09-26 16:11:30.314 775 775 D SurfaceFlinger: duplicate layer name: changing com.medlife.customer/com.medlife.customer.MainActivity to com.medlife.customer/com.medlife.customer.MainActivity#1
09-26 16:11:30.524 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 45 lines
09-26 16:11:30.611 775 1301 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen com.medlife.customer#0
09-26 16:11:30.611 775 1301 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen com.medlife.customer#0
09-26 16:11:32.669 30011 30132 I chatty : uid=10273(com.medlife.customer) expire 5 lines
09-26 16:11:32.695 30011 30134 I chatty : uid=10273(com.medlife.customer) expire 4 lines
09-26 16:11:32.980 775 1301 W SurfaceFlinger: Attempting to set client state on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-26 16:11:32.980 775 1301 W SurfaceFlinger: Attempting to destroy on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-26 16:11:33.313 30011 30022 I chatty : uid=10273(com.medlife.customer) expire 3 lines
09-26 16:11:33.317 30011 30020 I chatty : uid=10273(com.medlife.customer) expire 36 lines
09-26 16:11:43.478 30011 30011 I chatty : uid=10273(com.medlife.customer) expire 12 lines
09-26 16:11:46.282 1451 1644 D ActivityManager: handleProcessStartedLocked mDoneFinishBooting && app.pid != 0 ---> notifyProcessStart, app.processName = android:ui, app.info = ApplicationInfo{58c1294 android}, app.hostingType = activity, getHostingName() = ComponentInfo{android/com.android.internal.app.ChooserActivity}, getIntentFlag() = 0, getIsPackageRunning() = false, app = ProcessRecord{ae3a8d2 30232:android:ui/1000}, getExtraData() = Bundle[{ACTIVITY_TASK_AFFINITY=android, ACTIVITY_INTENT=Intent { act=android.intent.action.CHOOSER flg=0x800000 cmp=android/com.android.internal.app.ChooserActivity (has extras) }, CALLER_PACKAGE=com.medlife.customer, ACTIVITY_INFO=ActivityInfo{382be16 com.android.internal.app.ChooserActivity}}]
09-26 16:11:47.830 1451 1714 D AR_ADV_APPS_USAGE_COL: com.medlife.customer -> resizable apps -> USAGE 17406
09-26 16:11:51.603 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 624 lines
09-26 16:11:54.508 30011 30011 I chatty : uid=10273(com.medlife.customer) expire 1 line
09-26 16:11:54.619 2492 2492 I AndroidIME: PasswordIme.onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Show : AutoCorrection = Disable : Microphone = Show : NoPersonalizedLearning = Disable
09-26 16:11:54.798 2492 2492 I ConversationToQueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-26 16:11:55.057 2492 2492 I AndroidIME: LatinIme.onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : NoPersonalizedLearning = Disable
09-26 16:11:55.191 2492 2492 I ConversationToQueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-26 16:11:59.524 30011 30020 I chatty : uid=10273(com.medlife.customer) expire 3 lines
09-26 16:12:09.589 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 541 lines
09-26 16:12:23.113 30011 30084 I chatty : uid=10273(com.medlife.customer) expire 21 lines
09-26 16:12:30.807 1451 2766 I ActivityManager: Force stopping com.medlife.customer appid=10273 user=0: from pid 30567
09-26 16:12:30.812 1451 2766 I ActivityManager: Killing 30011:com.medlife.customer/u0a273 (adj 0): stop com.medlife.customer
09-26 16:12:30.818 1451 2766 W ActivityManager: Force removing ActivityRecord{4610f1b u0 com.medlife.customer/.MainActivity t24974}: app died, no saved state
09-26 16:12:30.926 1451 1714 D AR_ADV_APPS_USAGE_COL: com.medlife.customer -> resizable apps -> USAGE 38817
09-26 16:12:31.912 1451 4565 I ActivityManager: Force stopping com.medlife.customer appid=10273 user=0: from pid 30594
09-26 16:13:41.434 3974 31010 D PowerCalculator: topApCounter com.medlife.customer
09-26 16:13:41.434 3974 31010 D PowerCalculator: topApCounter com.medlife.customer
09-26 16:13:41.434 3974 31010 D PowerCalculator: topApCounter com.medlife.customer
ADB logs post after disabling:
09-30 12:43:17.696 1992 3969 I ActivityManager: Force stopping com.medlife.customer appid=10102 user=0: from pid 5797
09-30 12:43:17.697 1992 3969 I ActivityManager: Killing 5609:com.medlife.customer/u0a102 (adj 0): stop com.medlife.customer
09-30 12:43:17.709 1992 3969 W ActivityManager: Force removing ActivityRecord{8440c12 u0 com.medlife.customer/.MainActivity t113}: app died, no saved state
09-30 12:43:18.010 1992 3969 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.medlife.customer/.MainActivity} from uid 2000
09-30 12:43:18.174 1992 2012 I ActivityManager: Start proc 5800:com.medlife.customer/u0a102 for activity com.medlife.customer/.MainActivity
09-30 12:43:18.505 5800 5819 I FA : adb shell setprop debug.firebase.analytics.app com.medlife.customer
09-30 12:43:18.975 5800 5879 I edlife.custome: Thread[44,tid=5879,Native,Thread*=0x75721b54ec00,peer=0x12fd1880,"create_react_context"] recursive attempt to load library "/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/lib/x86_64/libfb.so"
09-30 12:43:19.225 5800 5891 D : Successfully queried cache dir: /data/user_de/0/com.medlife.customer/code_cache
09-30 12:43:19.226 5800 5891 D RenderScript: Setting cache dir: /data/user_de/0/com.medlife.customer/code_cache
09-30 12:43:19.433 1928 1928 D SurfaceFlinger: duplicate layer name: changing com.medlife.customer/com.medlife.customer.MainActivity to com.medlife.customer/com.medlife.customer.MainActivity#1
09-30 12:43:19.614 5800 5883 I edlife.custome: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdService" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk"],nativeLibraryDirectories=[/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/lib/x86_64, /data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk!/lib/x86_64, /system/lib64]]
09-30 12:43:19.616 5800 5883 I edlife.custome: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdService" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk"],nativeLibraryDirectories=[/data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/lib/x86_64, /data/app/com.medlife.customer-3_0cUdZvnpi5RWm0mKBAwA==/base.apk!/lib/x86_64, /system/lib64]]
09-30 12:43:19.694 1992 2018 I ActivityManager: Displayed com.medlife.customer/.MainActivity: +1s549ms
09-30 12:43:21.337 1928 2346 W SurfaceFlinger: Attempting to set client state on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-30 12:43:21.337 1928 2346 W SurfaceFlinger: Attempting to destroy on removed layer: com.medlife.customer/com.medlife.customer.MainActivity#1
09-30 12:43:23.086 5800 5952 E cr_VariationsUtils: Failed reading seed file "/data/user/0/com.medlife.customer/app_webview/variations_seed": /data/user/0/com.medlife.customer/app_webview/variations_seed (No such file or directory)
09-30 12:43:34.090 2128 2128 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-30 12:43:34.395 2128 2128 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-30 12:43:37.846 2128 2128 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-30 12:43:37.856 2128 2128 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-30 12:43:38.429 2128 2128 I LatinIme: onActivate() : EditorInfo = Package = com.medlife.customer : Type = Text : Learning = Disable : Suggestion = Hide : AutoCorrection = Disable : Microphone = Show : Incognito = Disable
09-30 12:43:38.465 2128 2128 W Conv2QueryExtension: Conv2Query not enabled due to current app [com.medlife.customer] not in whitelist
09-30 12:46:28.724 1992 2665 I ActivityManager: Force stopping com.medlife.customer appid=10102 user=0: from pid 6074
09-30 12:46:28.724 1992 2665 I ActivityManager: Killing 5800:com.medlife.customer/u0a102 (adj 0): stop com.medlife.customer
09-30 12:46:28.725 1992 2665 W ActivityManager: Force removing ActivityRecord{f56adcb u0 com.medlife.customer/.MainActivity t114}: app died, no saved state
09-30 12:46:29.671 1992 2666 I ActivityManager: Force stopping com.medlife.customer appid=10102 user=0: from pid 6091
You need to increase the RAM and internal storage size that you are assigning to the emulator in order for that exception to go away. You are trying to do some action in the android code that's eating up the emulator's RAM and internal memory.

ANDROID App crash when installed in device: JSException: Can't find variable: Promise (RN 0.57.1)

Android app installs but crashes on open in devices, but in debug mode works perfectly.
You can see the crash report below
2019-03-15 15:02:50.685 4431-4515/? E/WindowManager: win=Window{8cd349a u0 Splash Screen com.sample EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0, caller=com.android.server.wm.AppWindowToken.destroySurfaces:748 com.android.server.wm.AppWindowToken.destroySurfaces:732 com.android.server.wm.WindowState.onExitAnimationDone:5646 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:553 com.android.server.wm.DisplayContent.lambda$-com_android_server_wm_DisplayContent_21578:476
2019-03-15 15:02:51.555 970-1030/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.sample, PID: 970
com.facebook.react.common.JavascriptException: Can't find variable: props, stack:
value#285:1369
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
2019-03-15 15:02:51.989 4431-4515/? E/WindowManager: win=Window{bb689b5 u0 com.sample/com.sample.MainActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=8, caller=com.android.server.wm.AppWindowToken.destroySurfaces:748 com.android.server.wm.AppWindowToken.destroySurfaces:732 com.android.server.wm.WindowState.onExitAnimationDone:5646 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:553 com.android.server.wm.DisplayContent.lambda$-com_android_server_wm_DisplayContent_21578:476
Try to follow this issue: https://github.com/facebook/metro/issues/197:
When using react-native bundle (the command that runs when you build a
release), InitializeCore.js is not the first file that get required,
but instead it is required later, sometime during the generation of
the bridge method, randomly (which is why if you are lucky or not
using Promise // setTimeout early you'll be fine) iOS does not need
all those polyfills which is why the issue is only detected on android
in release mode.

problems white page with phonegap app in android

I develop an android app in phonegap
but when I open the app in succession then app opens and shows a blank white page?!
I do the follwoing: open, close(with backbutton),open,close then app open with blank page?!
logcat :
07-03 15:10:23.894: D/Config(11923): Unlimited access to network resources
07-03 15:10:23.904: I/CordovaLog(11923): Found start page location: index.html
07-03 15:10:23.904: I/CordovaLog(11923): Changing log level to DEBUG(3)
07-03 15:10:23.904: D/CordovaActivity(11923): CordovaActivity.onCreate()
07-03 15:10:23.914: D/CordovaWebView(11923): CordovaWebView is running on device made by: samsung
07-03 15:10:23.914: D/JsMessageQueue(11923): Set native->JS mode to 2
07-03 15:10:23.914: D/CordovaActivity(11923): CordovaActivity.init()
07-03 15:10:23.924: D/CordovaWebView(11923): >>> loadUrl(file:///android_asset/www/index.html)
07-03 15:10:23.924: D/PluginManager(11923): init()
07-03 15:10:23.924: D/CordovaWebView(11923): >>> loadUrlNow()
07-03 15:10:23.934: D/Config(11923): Unlimited access to network resources
07-03 15:10:23.934: I/CordovaLog(11923): Found start page location: index.html
07-03 15:10:23.934: I/CordovaLog(11923): Changing log level to DEBUG(3)
07-03 15:10:23.934: D/CordovaActivity(11923): Resuming the App
07-03 15:10:23.934: D/CordovaActivity(11923): CB-3064: The errorUrl is null
07-03 15:10:23.934: D/SecWifiDisplayUtil(11923): Metadata value : SecSettings2
07-03 15:10:23.934: D/ViewRootImpl(11923): #1 mView = com.android.internal.policy.PhoneWindow$DecorView{5319767 I.E...... R.....ID 0,0-0,0}
07-03 15:10:23.964: D/SoftKeyboardDetect(11923): Ignore this event
07-03 15:10:24.004: D/ViewRootImpl(11923): MSG_RESIZED_REPORT: ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
07-03 15:10:24.004: D/CordovaActivity(11923): onMessage(onPageStarted,file:///android_asset/www/index.html)
07-03 15:10:24.014: D/SoftKeyboardDetect(11923): Ignore this event
07-03 15:10:24.014: I/Timeline(11923): Timeline: Activity_idle id: android.os.BinderProxy#1404550 time:256529963
07-03 15:10:24.014: W/cr_BindingManager(11923): Cannot call determinedVisibility() - never saw a connection for the pid: 11923
07-03 15:10:24.184: E/AndroidProtocolHandler(11923): Unable to open asset URL: file:///android_asset/www/cordova_plugins.js
07-03 15:10:24.184: D/CordovaLog(11923): file:///android_asset/www/js/custom.js: Line 77 : Uncaught TypeError: Cannot read property 'connection' of undefined
07-03 15:10:24.184: I/chromium(11923): [INFO:CONSOLE(77)] "Uncaught TypeError: Cannot read property 'connection' of undefined", source: file:///android_asset/www/js/custom.js (77)
07-03 15:10:24.254: D/CordovaNetworkManager(11923): Connection Type: none
07-03 15:10:24.254: D/CordovaNetworkManager(11923): Connection Type: none
07-03 15:10:24.254: D/CordovaActivity(11923): onMessage(networkconnection,none)
07-03 15:10:24.254: D/CordovaActivity(11923): onMessage(spinner,stop)
07-03 15:10:24.334: D/CordovaWebViewClient(11923): onPageFinished(file:///android_asset/www/index.html)
07-03 15:10:24.334: D/CordovaActivity(11923): onMessage(onPageFinished,file:///android_asset/www/index.html)
07-03 15:10:39.174: D/CordovaActivity(11923): Paused the application!
07-03 15:10:39.174: D/CordovaWebView(11923): Handle the pause
07-03 15:10:39.194: V/ActivityThread(11923): updateVisibility : ActivityRecord{6130f7b token=android.os.BinderProxy#1404550 {da.com.ir/da.com.ir.Main}} show : true

Finding the source of ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null, message=null}

I'm currently running into a problem where the code
googleApiClient = new GoogleApiClient.Builder(activity, this,this)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.build();
works just fine, but
googleApiClient = new GoogleApiClient.Builder(activity, this,this)
.addApi(Drive.API)
.build();
doesn't want to connect, only returning
ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null, message=null}
There seems to be a lot of questions on this, but most of them only adress a specific scenario. So far it seems like my scenario would be unique, and therefore off-topic on this site. My product name is set in the developer console, the package matches and the signature is correct. The required apis are enabled, and no suggestion given in any topic seems to help out. It seems like only time, trial and error will solve this problem in my case.
Now the question arises however, how does one debug this problem? It seems to be such a common problem without a common resolution, so what steps would one take to find out how to resolve the problem?
Edit:
To get a bit more specific on this scenario, it seems like the problem lies somewhere with the com.google.android.gms service. That one crashes every time. Below this is the logcat of the following code:
new AsyncTask<Void,Void,Void>() {
#Override
protected Void doInBackground(Void... voids) {
Log.d("Snapshot", "3");
googleApiClient.blockingConnect();
Log.d("Snapshot", "4");
return null;
}
}.execute();
The errors in this logcat are consistent and occur every time, Of course with varying timestamps and process ID's, and some of this is probably unrelated to the issue, but to me it's near impossible to filter this out.
07-03 16:05:52.025 23176-24251/nl.dvandenberg.energymonitor D/Snapshot: 3
--------- beginning of system
07-03 16:05:52.026 891-6829/? W/AppOps: Bad call: specified package com.google.android.gms under uid 10252 but it is really 10010
07-03 16:05:52.043 335-1227/? D/AudioPolicyManager: startOutput()--
07-03 16:05:52.043 335-1227/? I/AudioFlinger: vl# new track,stream:1,masterVolume:1.000000,typeVolume:0.501188,vlf:0.501160,vrf:0.501160
07-03 16:05:52.046 335-987/? D/audio_hw_primary: start_output_stream: enter: stream(0xb59a3640)usecase(1: low-latency-playback) devices(0x2)
07-03 16:05:52.046 335-987/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: )
07-03 16:05:52.046 335-987/? D/hardware_info: hw_info_append_hw_type : device_name = speaker
07-03 16:05:52.046 335-987/? D/ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 15, path = 0
07-03 16:05:52.051 335-987/? E/msm8974_platform: wdd add mixer_path low-latency-playback i2s prop_value 15055
07-03 16:05:52.052 335-987/? D/audio_hw_primary: select_devices: done
07-03 16:05:52.175 891-1864/? D/ConnectivityService: listenForNetwork for NetworkRequest [ id=3904, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
07-03 16:05:52.175 891-1245/? D/ConnectivityService: handleRegisterNetworkRequest checking NetworkAgentInfo [WIFI () - 382]
07-03 16:05:52.175 891-1245/? D/ConnectivityService: apparently satisfied. currentScore=60
07-03 16:05:52.176 891-1245/? D/ConnectivityService: sending notification AVAILABLE for NetworkRequest [ id=3904, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
07-03 16:05:52.177 26026-26135/? D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
07-03 16:05:52.311 26026-26136/? W/DriveInitializer: Background init thread started
07-03 16:05:52.331 26141-26141/? D/StatusBar.MSimNetworkController: refreshViews phoneId =0mMSimDataConnected =false
07-03 16:05:52.331 26141-26141/? D/StatusBar.MSimNetworkController: refreshViews mMSimDataActivity =0
07-03 16:05:52.334 26141-26141/? D/StatusBar.MSimNetworkController: refreshViews: Data not connected!! Set no data type icon / Roaming for phoneId: 0
07-03 16:05:52.335 335-985/? D/AudioPolicyManager: stopOutput() output 4, stream 1, session 785
07-03 16:05:52.335 335-985/? D/AudioPolicyManager: stopOutput()--
07-03 16:05:52.360 26026-26137/? I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:1 and remote module com.google.android.gms.googlecertificates:1
07-03 16:05:52.360 26026-26137/? I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 1
07-03 16:05:52.391 26026-26137/? D/ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a
07-03 16:05:52.393 26026-26137/? D/ChimeraFileApk: Classloading successful. Optimized code found.
07-03 16:05:52.393 26026-26137/? I/asset: Success to oxygen resources /system/framework/oxygen-framework-res.apk
07-03 16:05:52.398 26026-26137/? D/GoogleCertificates: com.google.android.gms.googlecertificates module is loaded
07-03 16:05:52.455 26026-26139/? I/GCore-Chimera-Crash: Cg0KB3ZJbmZyYTQQor84Gl8KHWNvbS5nb29nbGUuYW5kcm9pZC
5wbGF5LmdhbWVzEhQzLjcuMjMgKDI4Njc2MzctMDM4KRjWq-AR
IiMKHGNvbS5nb29nbGUuYW5kcm9pZC5nbXMuZ2FtZXMQsKvgEQ
==
GCore-Chimera-Crash
--------- beginning of crash
07-03 16:05:52.458 26026-26139/? E/AndroidRuntime: FATAL EXCEPTION: highpool[0]
Process: com.google.android.gms, PID: 26026
java.lang.NullPointerException: Attempt to read from field 'kau jwg.a' on a null object reference
at jzf.a(:com.google.android.gms:336)
at kip.a(:com.google.android.gms:11149)
at kip.b(:com.google.android.gms:415)
at kiq.run(:com.google.android.gms:1054)
at loq.run(:com.google.android.gms:53)
at itt.run(:com.google.android.gms:453)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at iyg.run(:com.google.android.gms:17)
at java.lang.Thread.run(Thread.java:818)
07-03 16:05:52.460 26026-26139/? E/AndroidRuntime: Error reporting crash
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:200)
at android.os.Handler.<init>(Handler.java:114)
at android.content.AsyncQueryHandler.<init>(AsyncQueryHandler.java:125)
at net.oneplus.odm.insight.tracker.AbstractTracker$TrackerAsyncQueryHandler.<init>(AbstractTracker.java:110)
at net.oneplus.odm.insight.tracker.AbstractTracker.<init>(AbstractTracker.java:60)
at net.oneplus.odm.insight.tracker.AppTracker.<init>(AppTracker.java:24)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:99)
at icd.uncaughtException(:com.google.android.gms:54)
at ibx.uncaughtException(:com.google.android.gms:62)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
07-03 16:05:52.463 26026-26139/? I/Process: Sending signal. PID: 26026 SIG: 9
07-03 16:05:52.489 891-3957/? I/ActivityManager: Process com.google.android.gms (pid 26026) has died
07-03 16:05:52.489 891-5403/? E/WifiService: Multicaster binderDied
07-03 16:05:52.489 891-1250/? D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=3904, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy#d4be6da)
07-03 16:05:52.490 891-1245/? D/ConnectivityService: releasing NetworkRequest NetworkRequest [ id=3904, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
07-03 16:05:52.490 891-1245/? D/ConnectivityService: sending notification RELEASED for NetworkRequest [ id=3904, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
07-03 16:05:52.491 891-1245/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=3904, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
07-03 16:05:52.492 19485-19485/? V/GAV3: Thread[main,5,main]: service disconnected: ComponentInfo{com.google.android.gms/com.google.android.gms.analytics.service.AnalyticsService}
07-03 16:05:52.492 19485-19485/? V/GAV3: Thread[main,5,main]: Unexpected disconnect.
07-03 16:05:52.493 19485-19485/? V/GAV3: Thread[main,5,main]: service disconnected: ComponentInfo{com.google.android.gms/com.google.android.gms.analytics.service.AnalyticsService}
07-03 16:05:52.493 19485-19485/? V/GAV3: Thread[main,5,main]: Unexpected disconnect.
07-03 16:05:52.496 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/com.google.android.location.places.service.GeoDataService in 1000ms
07-03 16:05:52.496 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/.drive.api.ApiService in 11000ms
07-03 16:05:52.496 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/.analytics.service.AnalyticsService in 21000ms
07-03 16:05:52.497 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/.signin.service.SignInAsyncService in 31000ms
07-03 16:05:52.497 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/.measurement.service.MeasurementBrokerService in 31000ms
07-03 16:05:52.497 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/.signin.service.SignInBrokerService in 41000ms
07-03 16:05:52.497 891-3957/? W/ActivityManager: Scheduling restart of crashed service com.google.android.gms/.cast.media.CastMediaRouteProviderService in 51000ms
07-03 16:05:52.508 23176-23176/nl.dvandenberg.energymonitor D/Snapshot: Connection failed: ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null, message=null}
07-03 16:05:52.513 23176-23176/nl.dvandenberg.energymonitor I/AppCompatDelegate: The Activity's LayoutInflater already has a Factory installed so we can not install AppCompat's
07-03 16:05:52.529 891-5403/? V/WindowManager: not Base app: Adding window Window{3ad0e9e8 u0 nl.dvandenberg.energymonitor/nl.dvandenberg.energymonitor.SplashActivity} at 23 of 29
07-03 16:05:52.540 23176-24251/nl.dvandenberg.energymonitor D/Snapshot: 4
Edit 2:
I have managed to solve my own problem, by adding .addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN) to the builder. I've got no idea as to why this works or is needed, but as long as it works I'll take it.
I'm not posting this as an answer, as in this question I'd like to focus on how to find the source of this issue, not on making a list of possible solutions.

Categories

Resources