Android NetworkUsage Sample Project Not Working: Lost Connection - android

I am trying to run the NetworkUsage sample project app on Android Studio. I downloaded the project from NetworkUsage.zip and imported it into Android Studio. The project builds without a problem, but when it runs on the emulator, but ends up with a message in the UI: "Lost Connection" followed by "Unable to Load Content. Check Your Network Connection".
When tracing through the execution, I see that when onStart() is called, it calls updateConnectedFlags(). Within this method,
activeInfo != null && activeInfo.isConnected()
is a true statement, but execution of:
wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI;
mobileConnected = activeInfo.getType() == ConnectivityManager.TYPE_MOBILE;
results in wifiConnected = false and mobileConnected being true. That seems a bit odd that the mobileConnected would be true since this is an emulator running. Afterwords, the method onReceive() in the class NetworkReceiver is called, but the following statement fails:
if (WIFI.equals(sPref) && networkInfo != null
&& networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
because networkInfo.getType() = 0 and ConnectivityManager.TYPE_WIFI = 1 (networkInfo is not null and sPref = WIFI). This results in "Lost Connection".
The only runtime errors I see when I run the project are:
03-14 11:28:36.078 2918-2918/com.example.android.networkusage W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
03-14 11:28:36.227 2918-2939/com.example.android.networkusage W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
03-14 11:28:36.211 2918-2918/com.example.android.networkusage W/chromium﹕ [WARNING:resource_bundle.cc(315)] locale_file_path.empty()
03-14 11:28:36.267 2918-2918/com.example.android.networkusage I/chromium﹕ [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful, fd=32 off=46092 len=2953
03-14 11:28:36.269 2918-2918/com.example.android.networkusage I/chromium﹕ [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:33 off:228796 len:643667
03-14 11:28:36.404 2918-2918/com.example.android.networkusage E/chromium﹕ [ERROR:gl_surface_egl.cc(150)] No suitable EGL configs found.
03-14 11:28:36.404 2918-2918/com.example.android.networkusage E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
03-14 11:28:36.404 2918-2918/com.example.android.networkusage E/chromium﹕ [ERROR:browser_main_loop.cc(940)] GLSurface::InitializeOneOff failed
03-14 11:28:36.714 2918-2945/com.example.android.networkusage W/chromium﹕ [WARNING:proxy_service.cc(901)] PAC support disabled because there is no system implementation
03-14 11:28:36.750 2918-2918/com.example.android.networkusage W/chromium﹕ [WARNING:data_reduction_proxy_settings.cc(403)] SPDY proxy OFF at startup
03-14 11:28:36.910 2918-2918/com.example.android.networkusage W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
03-14 11:28:36.948 2918-2918/com.example.android.networkusage W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
I am running Android Studio on a Mac. What might be the reason that this sample is failing? Does anyone have experience with the ConnectivityManager that says that wifi does not work with an emulator? I would like to take advantage of this sample software.

Related

'Unfortunately, app has stopped' is shown twice on the device and 'Application terminated' in android studio with no error being shown

I am developing an app using Android Studio.
The problem is that app gets crashed twice within few minutes of running it and besides Application terminated. and normal logs no error is shown in the logcat.
Here's complete logcat:
02/12 22:31:34: Launching app
Cold swapped changes.
$ adb shell am start -n "com.abc.xxx/com.abc.xxx.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 13399 on device micromax-micromax_aq4502-2864004C04884I2
I/art: Late-enabling -Xcheck:jni
W/System: ClassLoader referenced unknown path: /data/app/com.abc.xxx-2/lib/arm
I/InstantRun: Instant Run Runtime started. Android package is com.abc.xxx, real application class is null.
W/System: ClassLoader referenced unknown path: /data/app/com.abc.xxx-2/lib/arm
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/art: Background sticky concurrent mark sweep GC freed 11281(1218KB) AllocSpace objects, 22(696KB) LOS objects, 15% free, 5MB/6MB, paused 13.077ms total 70.659ms
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi-v7a
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi
I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader p[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/00000012/DynamiteModulesC_GmsCore_prodmnc_hdpi_release.apk"],nativeLibraryDirectories=[/data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi-v7a, /data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi, /vendor/lib, /system/lib]]]
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/FA: App measurement is starting up, version: 10084
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
D/FA: Debug-level message logging enabled
D/FA: AppMeasurement singleton hash: 198168520
V/FA: Collection enabled
V/FA: App package, google app id: com.abc.xxx, 1:987905869088:android:e7f50263e7b8aa58
I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.getsportalapp.sportal
V/FA: Registered activity lifecycle callback
I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbks#e551d72
I/FirebaseInitProvider: FirebaseApp initialization successful
V/FA: Using measurement service
V/FA: Connecting to remote service
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/com.facebook.appevents.AppEventsLogger: activateApp events are being logged automatically. There's no need to call activateApp explicitly, this is safe to remove.
I/GAC: Building GoogleApiClient
I/CrashlyticsCore: Initializing Crashlytics 2.3.15.167
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 824779068
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
D/signedIn: onAuthStateChanged:signed_in:ShXMXdc5kHUQZWG3lGudJtt2
I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:5
I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 5
I/OpenGLRenderer: Initialized EGL, version 1.4
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
E/RecyclerView: No adapter attached; skipping layout
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 2
E/RecyclerView: No adapter attached; skipping layout
D/getInvitation: getInvitation: no deep link found.
D/called: again
D/cLat: 2.8418744
D/cLng: 8.7791019
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/Settings: Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000010/n/armeabi
D/DynamitePackage: Instantiated singleton DynamitePackage.
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/DynamiteModule: Considering local module com.google.android.gms.piccard.dynamite:0 and remote module com.google.android.gms.piccard.dynamite:12
I/DynamiteModule: Selected remote version of com.google.android.gms.piccard.dynamite, version >= 12
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000010/n/armeabi
W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
I/Ads: Starting ad request.
I/WebViewFactory: Loading com.google.android.webview version 53.0.2785.124 (code 278512400)
D/diffAnother: -6283000
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 5738-5744)
I/cr_LibraryLoader: Expected native library version number "53.0.2785.124", actual native library version number "53.0.2785.124"
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {611ead6}
I/cr_LibraryLoader: Expected native library version number "53.0.2785.124", actual native library version number "53.0.2785.124"
I/chromium: [INFO:library_loader_hooks.cc(151)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
W/cr_media: Requires BLUETOOTH permission
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
I/cr_Ime: ImeThread is not enabled.
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13399
I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:8 and remote module com.google.android.gms.tagmanager:9
I/DynamiteModule: Selected remote version of com.google.android.gms.tagmanager, version >= 9
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
I/GoogleTagManager: Tag Manager initilization took 213ms
V/FA: Using measurement service
V/FA: Connecting to remote service
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 1
I/Ads: Scheduling ad refresh 45000 milliseconds from now.
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
I/cr_Ime: ImeThread is not enabled.
I/Ads: Ad finished loading.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13399
I/chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0)
I/chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0)
I/chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0)
D/diffAnother: 1129000
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/Ads: Starting ad request.
D/diffAnother: -6300000
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
I/cr_Ime: ImeThread is not enabled.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13399
I/Ads: Scheduling ad refresh 45000 milliseconds from now.
I/Ads: Ad finished loading.
V/FA: Using measurement service
V/FA: Connecting to remote service
D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=29568, _sc=MainActivity, _si=-6311178554893906199}]
V/FA: Using measurement service
V/FA: Connection attempt already in progress
V/FA: Activity paused, time: 824808635
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 2
W/com.facebook.appevents.AppEventsLogger: activateApp events are being logged automatically. There's no need to call activateApp explicitly, this is safe to remove.
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
D/call1: called
D/call2: called
D/call1: called
D/call2: called
D/error1: ERROR1
D/error1: ERROR1
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
V/RenderScript: 0xb8457a88 Launching thread(s), CPUs 4
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
V/FA: Inactivity, disconnecting from the service
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
I/Ads: Ad is not visible. Not refreshing ad.
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
I/Ads: Ad is not visible. Not refreshing ad.
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
Application terminated.
I tried integrating crashlytics but even it doesn't show any error when the app crashes in this manner.
The question is how will I be able to fix the error if I don't even know what the error is?
Please help me with this.
I think the issue is related to your ad view.
In last line it is showing that ad is not visible.

AdMob in app not showing

I am trying to show a simple test ad in an android app. I was using this github project to test
https://github.com/googleads/googleads-mobile-android-examples/tree/master/admob/BannerExample
I have also gone through this example https://developers.google.com/admob/android/quick-start#configure_gradle
Im using IntelliJ and not Android Studio so havent been able to follow it exactly.
My problem is that the ads dont seem to be appearing. The logs are below and Ive added a couple of ** next to the lines that I think may be problematic. I have also added my code. I have not added anything to the manifest file (I havent seen any example where I have to)
I am using the emulator. Are there certain constraints on what emulator I can use? At the moment I never see any ad or any placeholder where the ad should be.
Any help greatly appreciated.
Thanks
CODE
Layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
tools:context=".EntryPoint">
<TextView android:text="#string/hello_world" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.gms.ads.AdView
android:id="#+id/ad_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="#string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
Code
private AdView mAdView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
mAdView = (AdView) findViewById(R.id.ad_view);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mAdView.loadAd(adRequest);
}
/** Called when leaving the activity */
#Override
public void onPause() {
if (mAdView != null) {
mAdView.pause();
}
super.onPause();
}
/** Called when returning to the activity */
#Override
public void onResume() {
super.onResume();
if (mAdView != null) {
mAdView.resume();
}
}
/** Called before the activity is destroyed */
#Override
public void onDestroy() {
if (mAdView != null) {
mAdView.destroy();
}
super.onDestroy();
}
LOGS
5222-5222/? I/art﹕ Not late-enabling -Xcheck:jni (already on)
5222-5222/? I/art﹕ Late-enabling JIT
5222-5222/? I/art﹕ JIT created with code_cache_capacity=2MB compile_threshold=1000
** 5222-5222/my.app W/System﹕ ClassLoader referenced unknown path: /data/app/my.app-2/lib/arm
** 5222-5222/my.app W/GooglePlayServicesUtil﹕ Google Play services is missing.
5222-5222/my.app I/WebViewFactory﹕ Loading com.android.webview version 44.0.2403.119 (code 246011900)
5222-5222/my.app W/System﹕ ClassLoader referenced unknown path: /system/app/webview/lib/arm
5222-5222/my.app I/LibraryLoader﹕ Time to load native libraries: 44 ms (timestamps 1048-1092)
5222-5222/my.app I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
5222-5250/my.app W/art﹕ Long monitor contention event with owner method=void java.lang.Thread.nativeCreate(java.lang.Thread, long, boolean) from Thread.java:4294967294 waiters=0 for 206ms
5222-5231/my.app W/art﹕ Suspending all threads took: 91.755ms
5222-5222/my.app V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {84fa4d0}
5222-5222/my.app I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
5222-5222/my.app I/chromium﹕ [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
5222-5222/my.app I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5222/my.app E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
5222-5222/my.app W/chromium﹕ [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
** 5222-5222/my.app E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
** 5222-5222/my.app E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
** 5222-5222/my.app E/chromium﹕ [ERROR:gl_surface_egl.cc(327)] No suitable EGL configs found.
** 5222-5222/my.app E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
5222-5222/my.app E/chromium﹕ [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
5222-5250/my.app W/art﹕ Long monitor contention event with owner method=void android.app.SharedPreferencesImpl$1.run() from SharedPreferencesImpl.java:90 waiters=1 for 280ms
5222-5247/my.app W/art﹕ Long monitor contention event with owner method=void java.lang.Thread.nativeCreate(java.lang.Thread, long, boolean) from Thread.java:4294967294 waiters=3 for 441ms
5222-5231/my.app W/art﹕ Suspending all threads took: 16.275ms
5222-5222/my.app E/DataReductionProxySettingListener﹕ No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
5222-5269/my.app W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
** 5222-5222/my.app I/Ads﹕ Starting ad request.
5222-5231/my.app W/art﹕ Suspending all threads took: 9.629ms
5222-5222/my.app I/Choreographer﹕ Skipped 41 frames! The application may be doing too much work on its main thread.
5222-5222/my.app D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
5222-5231/my.app W/art﹕ Suspending all threads took: 140.144ms
** 5222-5246/my.app W/GooglePlayServicesUtil﹕ Google Play services is missing.
** 5222-5246/my.app W/GooglePlayServicesUtil﹕ Google Play services is missing.
5222-5267/my.app W/chromium﹕ [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5222/my.app W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5303/my.app A/chromium﹕ [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
5222-5303/my.app W/google-breakpad﹕ ### ### ### ### ### ### ### ### ### ### ### ### ###
5222-5303/my.app W/google-breakpad﹕ Chrome build fingerprint:
5222-5303/my.app W/google-breakpad﹕ 1.04
5222-5303/my.app W/google-breakpad﹕ 5
5222-5303/my.app W/google-breakpad﹕ 023f32a1-4862-425f-a49b-e5b1792614ed
5222-5303/my.app W/google-breakpad﹕ ### ### ### ### ### ### ### ### ### ### ### ### ###
5222-5303/my.app E/chromium﹕ ### WebView Version 44.0.2403.119 (code 246011900)
5222-5303/my.app A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 5303 (GpuThread)
Thanks
Create emulator that is targeted to Google APIs, not to android.

Cordova 6.0.0 Unfortunaly, HelloWorld has stopped

I try to use cordova in windows for create a simple android app. I create the first project using command cordova create hello com.example.hello HelloWorld
I add the Android platform, I try to build and build success, but when I emulate the app don't start and receive the error on screen:
Unfortunaly, HelloWorld has stopped.
logcat:
03-16 16:44:19.073 2442-2442/com.example.hello W/System﹕ ClassLoader referenced unknown path: /data/app/com.example.hello-1/lib/x86
03-16 16:44:19.266 2442-2442/com.example.hello I/WebViewFactory﹕ Loading com.android.webview version 44.0.2403.119 (code 246011910)
03-16 16:44:19.310 2442-2442/com.example.hello W/System﹕ ClassLoader referenced unknown path: /system/app/webview/lib/x86
03-16 16:44:19.377 2442-2442/com.example.hello I/LibraryLoader﹕ Time to load native libraries: 62 ms (timestamps 9389-9451)
03-16 16:44:19.377 2442-2442/com.example.hello I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
03-16 16:44:19.392 2442-2442/com.example.hello I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
03-16 16:44:19.392 2442-2442/com.example.hello I/chromium﹕ [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
03-16 16:44:19.483 2442-2442/com.example.hello I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
03-16 16:44:19.484 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:19.486 2442-2442/com.example.hello E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
03-16 16:44:19.568 2442-2442/com.example.hello W/chromium﹕ [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
03-16 16:44:19.571 2442-2442/com.example.hello E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
03-16 16:44:19.571 2442-2442/com.example.hello E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:gl_surface_egl.cc(327)] No suitable EGL configs found.
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
03-16 16:44:19.628 2442-2468/com.example.hello W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
03-16 16:44:19.667 2442-2442/com.example.hello E/DataReductionProxySettingListener﹕ No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
03-16 16:44:19.757 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:19.762 2442-2442/com.example.hello W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
03-16 16:44:20.182 2442-2442/com.example.hello D/SystemWebViewEngine﹕ CordovaWebView is running on device made by: unknown
03-16 16:44:20.188 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.188 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.246 2442-2452/com.example.hello I/art﹕ Background sticky concurrent mark sweep GC freed 7609(505KB) AllocSpace objects, 3(60KB) LOS objects, 64% free, 861KB/2MB, paused 1.373ms total 448.240ms
03-16 16:44:20.310 2442-2466/com.example.hello W/chromium﹕ [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
03-16 16:44:20.368 2442-2442/com.example.hello D/gralloc_goldfish﹕ Emulator without host-side GPU emulation detected.
03-16 16:44:20.376 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.410 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.586 2442-2452/com.example.hello I/art﹕ Background partial concurrent mark sweep GC freed 1447(97KB) AllocSpace objects, 2(2MB) LOS objects, 35% free, 926KB/1438KB, paused 2.668ms total 209.255ms
03-16 16:44:20.587 2442-2480/com.example.hello A/chromium﹕ [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
03-16 16:44:20.587 2442-2480/com.example.hello A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 2480 (GpuThread)
This is almost exactly the same error as Error in Android Programming while connecting to Phonegap. It seems to be related to this bug from ionic.
According to them, "switching from Snapshot to Host GPU solved this problem."
This makes sense as three of the last errors are related to opengl.
Note to various moderators: I tried to close one as a duplicate of the other, but that can't be done because there's no answer. Tried looking on meta for 'duplicate unanswered' but they simply say not to do it. I figure I'll post a possible answer and if either one is accepted, I'll close the other as a dup.

Unable to run Android - DeviceReady in cordova

I am unable to run android's device ready function (not getting fired). How do I fix it? I have target sdk 22 and cordova 5.1.1 and android studio 1.0.1.
My index.html:
<!DOCTYPE html>
<html>
<head>
<title>Device Ready Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
</head>
<body onload="onLoad()">
</body>
</html>
index.js:
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
// device APIs are available
//
function onDeviceReady() {
window.addEventListener("batterystatus", onBatteryStatus, false);
}
// Handle the batterystatus event
//
function onBatteryStatus(info) {
console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
}
And where will this get logged : console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
If I run on command propmpt: cordova build:
Total time: 7.545 secs
C:\Users\salangar\hello\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\salangar\hello\platform
s\android\gradlew cdvBuildDebug -b C:\Users\salangar\hello\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\salangar\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Logcat display:
I/WebViewFactory﹕ Loading com.android.webview version 39 (1737576-arm) (code 300001)
07-02 11:10:44.806 HelloWorld I/LibraryLoader﹕ Time to load native libraries: 726 ms (timestamps 7130-7856)
07-02 11:10:44.824 HelloWorld I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
07-02 11:10:44.979 HelloWorld V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {951e68}
07-02 11:10:44.990 HelloWorld I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
07-02 11:10:45.113 HelloWorld I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
07-02 11:10:45.021 HelloWorld I/chromium﹕ [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
07-02 11:10:45.140 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:45.448 HelloWorld W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
07-02 11:10:45.575 HelloWorld W/chromium﹕ [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
07-02 11:10:45.590 HelloWorld I/chromium﹕ [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=31 off=46184 len=3037
07-02 11:10:45.614 HelloWorld I/chromium﹕ [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:32 off:229484 len:1089587
07-02 11:10:45.828 HelloWorld E/chromium﹕ [ERROR:gl_surface_egl.cc(165)] No suitable EGL configs found.
07-02 11:10:45.829 HelloWorld E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
07-02 11:10:45.835 HelloWorld E/chromium﹕ [ERROR:browser_main_loop.cc(988)] GLSurface::InitializeOneOff failed
07-02 11:10:46.790 HelloWorld W/chromium﹕ [WARNING:data_reduction_proxy_settings.cc(331)] SPDY proxy OFF at startup
07-02 11:10:47.032 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:47.115 HelloWorld W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
07-02 11:10:47.328 HelloWorld D/SystemWebViewEngine﹕ CordovaWebView is running on device made by: unknown
07-02 11:10:47.408 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:47.408 HelloWorld W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
07-02 11:10:47.712 HelloWorld I/art﹕ Background sticky concurrent mark sweep GC freed 3517(255KB) AllocSpace objects, 2(32KB) LOS objects, 31% free, 764KB/1117KB, paused 2.313ms total 499.804ms
07-02 11:10:48.445 HelloWorld D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
07-02 11:10:55.758 HelloWorld D/JsMessageQueue﹕ Set native->JS mode to OnlineEventsBridgeMode
07-02 11:10:56.152 HelloWorld I/art﹕ Background partial concurrent mark sweep GC freed 3730(208KB) AllocSpace objects, 1(16KB) LOS objects, 53% free, 887KB/1911KB, paused 1.825ms total 326.232ms
07-02 11:10:57.749 HelloWorld I/Choreographer﹕ Skipped 45 frames! The application may be doing too much work on its main thread.
07-02 11:11:00.752 HelloWorld I/Choreographer﹕ Skipped 54 frames! The application may be doing too much work on its main thread.
07-02 11:11:01.075 HelloWorld I/Choreographer﹕ Skipped 31 frames! The application may be doing too much work on its main thread.
07-02 11:11:01.545 HelloWorld I/chromium﹕ [INFO:CONSOLE(1188)] "deviceready has not fired after 5 seconds.", source: file:///android_asset/www/cordova.js (1188)
07-02 11:11:01.750 HelloWorld I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onPluginsReady", source: file:///android_asset/www/cordova.js (1181)
07-02 11:11:01.752 HelloWorld I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onCordovaReady", source: file:///android_asset/www/cordova.js (1181)
07-02 11:11:03.655 HelloWorld W/PluginManager﹕ THREAD WARNING: exec() call to CoreAndroid.show blocked the main thread for 161ms. Plugin should use CordovaInterface.getThreadPool().
07-02 11:11:04.699 HelloWorld I/chromium﹕ [INFO:CONSOLE(47)] "Received Event: deviceready", source: file:///android_asset/www/js/index.js (47)
07-02 11:11:27.708 HelloWorld I/Choreographer﹕ Skipped 33 frames! The application may be doing too much work on its main thread.
07-02 11:11:28.112 HelloWorld I/Choreographer﹕ Skipped 34 frames! The application may be doing too much work on its main thread.
07-02 11:11:58.646 HelloWorld I/Choreographer﹕ Skipped 33 frames! The application may be doing too much work on its main thread.
device ready function (not getting fired). How do I fix it?
You don't need to use onLoad() function to call deviceready event.
instead of this :-
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
just write :-
document.addEventListener("deviceready", onDeviceReady, false);
and another thing is you need to write the script cordova.js part inside the body tag and add the index.js file like the cordova.js.
where will this get logged : console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
This log is print in logcat.
Hope this help :) if you have any difficulties please let me know.

Android game sign-in (Google Play Services) authorization failed because Drive API not enabled, but my game does not need Drive API

When I attempt to sign-in to my game application using Google Play Services, the login fails (error logs included below), and a dialog pops up that says "Unknown issue with Google Play services." I have the google-play-services_lib properly setup as a library dependency in Android Studio and my Activity extends the BaseGameActivity class.
As you can see in the Logs, it says the error is because: "Access Not Configured. The API (Drive API) is not enabled for your project." It comes from com.google.android.gms.drive.auth.c. However, nowhere in my Manifest file or in my code do I use the Drive API. I don't need this API at all, and have not imported or included it anywhere. I am simply calling the beginUserInitiatedSignIn(); method from the BaseGameActivity class. Why is this error message being generated?
I have noticed one line from the logs in particular that doesn't make much sense, but seems to be related:
I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: , callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/games https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/appstate]
But I still can't wrap my head around why it's seemingly attempting to get data from the drive API. Any help would be really appreciated.
Here are the error logs as promised:
05-25 03:00:49.359 1250-1250/? V/GLSActivity﹕ AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
05-25 03:00:49.372 1448-1448/? D/ChimeraSrvcProxy﹕ Creating service proxy ComponentInfo{com.google.android.gms/com.google.android.gms.games.chimera.GamesAsyncServiceProxy}
05-25 03:00:49.372 1448-1448/? D/ChimeraSrvcProxy﹕ Proxying container service ComponentInfo{com.google.android.gms/com.google.android.gms.games.chimera.GamesAsyncServiceProxy} to Chimera service impl com.google.android.gms.games.service.PlayGamesAsyncService
05-25 03:00:49.372 1448-1448/? D/ChimeraCfgMgr﹕ Loading module com.google.android.gms.games from APK com.google.android.play.games
05-25 03:00:49.372 1448-1448/? D/ChimeraModuleLdr﹕ Module APK com.google.android.play.games already loaded
05-25 03:00:49.387 1250-9249/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:-4362>, callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/games https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/appstate]
05-25 03:00:49.392 1250-9249/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
05-25 03:00:49.412 1448-21701/? V/AuthAccountOperation﹕ offline access is not requested; requesting access token
05-25 03:00:49.428 1250-1990/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:-4362>, callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/games https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/appstate https://www.googleapis.com/auth/drive.appdata]
05-25 03:00:49.431 1250-1990/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
05-25 03:00:49.437 1448-21701/? V/AuthAccountOperation﹕ access token request successful
05-25 03:00:49.463 1448-21698/? W/BaseAppContext﹕ Using Auth Proxy for data requests.
05-25 03:00:49.466 1448-21698/? W/BaseAppContext﹕ Using Auth Proxy for data requests.
05-25 03:00:49.476 1250-1278/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:-4362>, callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/games https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/appstate]
05-25 03:00:49.481 1250-1278/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
05-25 03:00:49.490 1250-1990/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:-4362>, callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/games https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/appstate]
05-25 03:00:49.496 1250-1990/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
05-25 03:00:49.523 1448-21701/? V/AuthAccountOperation﹕ offline access is not requested; requesting access token
05-25 03:00:49.541 1250-9249/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:-4362>, callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/games https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/appstate https://www.googleapis.com/auth/drive.appdata]
05-25 03:00:49.543 1250-9249/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
05-25 03:00:49.552 1448-21701/? V/AuthAccountOperation﹕ access token request successful
05-25 03:00:49.754 746-1172/? I/art﹕ Explicit concurrent mark sweep GC freed 26211(1326KB) AllocSpace objects, 2(32KB) LOS objects, 22% free, 55MB/71MB, paused 1.903ms total 134.343ms
05-25 03:00:50.138 1046-1559/? D/skia﹕ --- SkImageDecoder::Factory returned null
05-25 03:00:50.139 1046-1559/? W/AssetUtil﹕ loadBitmapAssetFromResources: failed to decode bitmap resource for package com.twitter.android
05-25 03:00:50.204 1448-9053/? E/Volley﹕ [220] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/drive/v2beta/apps/self?prettyPrint=false&fields=id
05-25 03:00:50.210 3043-3105/? D/﹕ PORT_WriteDataCO: tx queue is full,tx.queue_size:10312,tx.queue.count:11,available:6683
05-25 03:00:50.222 1448-21694/? W/BaseAppContext﹕ Using Auth Proxy for data requests.
05-25 03:00:50.225 1448-21698/? E/ClientConnectionOperation﹕ Handling authorization failure
com.google.android.gms.drive.auth.c: Authorization failed: server returned error: Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration.. See https://developers.google.com/drive/handle-errors for details.
at com.google.android.gms.drive.auth.g.a(SourceFile:209)
at com.google.android.gms.drive.auth.g.a(SourceFile:139)
at com.google.android.gms.drive.api.g.<init>(SourceFile:226)
at com.google.android.gms.drive.api.a.k.a(SourceFile:46)
at com.google.android.gms.common.service.g.run(SourceFile:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
05-25 03:00:50.273 1250-2712/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:-4362>, callingPkg: com.soerenwalls.gravlfree, service: oauth2:https://www.googleapis.com/auth/games https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/appstate https://www.googleapis.com/auth/drive.appdata]
05-25 03:00:50.276 1250-2712/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
05-25 03:00:50.556 1448-9055/? E/Volley﹕ [222] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/drive/v2beta/apps/self?prettyPrint=false&fields=id
05-25 03:00:50.559 1448-21698/? E/ClientConnectionOperation﹕ Handling authorization failure
com.google.android.gms.drive.auth.c: Authorization failed: server returned error: Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration.. See https://developers.google.com/drive/handle-errors for details.
at com.google.android.gms.drive.auth.g.a(SourceFile:209)
at com.google.android.gms.drive.auth.g.a(SourceFile:139)
at com.google.android.gms.drive.api.g.<init>(SourceFile:226)
at com.google.android.gms.drive.api.a.k.a(SourceFile:46)
at com.google.android.gms.common.service.g.run(SourceFile:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
05-25 03:00:50.562 20197-20197/? W/GameHelper﹕ disconnect() called when client was already disconnected.
05-25 03:00:50.564 20197-20197/? E/GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information

Categories

Resources