I have a working scenario on Android version that I tested, 2.3.6- 4.2.2.
Firstly, manually I set an html string to WebView, which opens a new web page.
However, on Android 4.4.2 and 5.0, Webview returns errors about an SSL certificate. What difference are these versions?
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>MDpay default response template for web</title>
</head>
<body bgcolor="#02014E" OnLoad="OnLoadEvent();" >
<form name="downloadForm" action="https://asdasd/sds/sds" method="POST">
<input type="hidden" name="PaReq" value="eJxVkdFuwjAMRX+l4gNIkwXWImMJhqZVCIYAadpjlBpabQRI0w329UtKge0pPlbsa1/DurBEkxXp2hLCjKpKbSkq82GHJ32R9tIOwmK0pCPCF9mq3Bvk3bgrgFasd1ldKOMQlD6Oszn2pIhFCqxF2JHNJigSKXgcA7sgGLUjzMx2rMxH9DCJ1lQ5YE0W9L42zpAGLAAwO7aizpElS8+lTm+2fRHpMfNtp73p99JtpnS88ydi+x1NgQWfkCuHKGIueSC84iLQSwHYeomD2oXVHG9fI/8vn7qNgGHoDO6QLPO3wR4Gy0ZfcZU+lY3Ajod9ob8D7/PLYacKo2RlwwvsPsKTy/BTO2CbVJynvDgZsOhVendCHM3vQIACxWsPRRrz+asdoUw= ">
<input type="hidden" name="TermUrl" value="https://asdsad.com.tr/fim/sds?msgid=343434">
<input type="hidden" name="MD" value="528920:AA98DF8F43526CA06adssadgsbstrdvfhgED3475469BE0D51:4540:##150150100">
<!-- To support javascript unaware/disabled browsers -->
<noscript>
<center>Please click the submit button below.<br>
<input type="submit" name="submit" value="Submit">
</center>
</noscript>
</form>
<SCRIPT LANGUAGE="Javascript" >function OnLoadEvent() {document.downloadForm.submit();}
</SCRIPT>
</body>
</html>
I also added Logs from LogCat:
12-12 10:46:55.168 5150-5150/com.ingbanktr.cuzdan.debug I/WebViewFactory﹕ Loading com.google.android.webview version 37 (1576899-arm) (code 110101)
12-12 10:46:55.192 5150-5150/com.ingbanktr.cuzdan.debug I/LibraryLoader﹕ Loading: webviewchromium
12-12 10:46:55.197 5150-5150/com.ingbanktr.cuzdan.debug I/LibraryLoader﹕ Time to load native libraries: 15 ms (timestamps 7729-7744)
12-12 10:46:55.197 5150-5150/com.ingbanktr.cuzdan.debug I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
12-12 10:46:55.216 5150-5150/com.ingbanktr.cuzdan.debug V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {36e534e6}
12-12 10:46:55.217 5150-5150/com.ingbanktr.cuzdan.debug I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
12-12 10:46:55.218 5150-5150/com.ingbanktr.cuzdan.debug I/chromium﹕ [INFO:library_loader_hooks.cc(106)] Chromium logging enabled: level = 0, default verbosity = 0
12-12 10:46:55.234 5150-5150/com.ingbanktr.cuzdan.debug I/BrowserStartupController﹕ Initializing chromium process, renderers=0
12-12 10:46:55.235 5150-5150/com.ingbanktr.cuzdan.debug W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
12-12 10:46:55.248 5150-5150/com.ingbanktr.cuzdan.debug W/chromium﹕ [WARNING:resource_bundle.cc(315)] locale_file_path.empty()
12-12 10:46:55.249 5150-5542/com.ingbanktr.cuzdan.debug W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
12-12 10:46:55.249 5150-5150/com.ingbanktr.cuzdan.debug I/chromium﹕ [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful, fd=79 off=216848 len=3250
12-12 10:46:55.249 5150-5150/com.ingbanktr.cuzdan.debug I/chromium﹕ [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:80 off:229480 len:643667
12-12 10:46:55.330 5150-5548/com.ingbanktr.cuzdan.debug W/chromium﹕ [WARNING:proxy_service.cc(901)] PAC support disabled because there is no system implementation
12-12 10:46:55.332 5150-5150/com.ingbanktr.cuzdan.debug W/chromium﹕ [WARNING:data_reduction_proxy_settings.cc(403)] SPDY proxy OFF at startup
12-12 10:46:55.348 5150-5150/com.ingbanktr.cuzdan.debug W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
12-12 10:46:55.354 5150-5150/com.ingbanktr.cuzdan.debug W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
12-12 10:46:55.360 5150-5150/com.ingbanktr.cuzdan.debug W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
12-12 10:46:55.360 5150-5150/com.ingbanktr.cuzdan.debug W/art﹕ Attempt to remove local handle scope entry from IRT, ignoring
12-12 10:46:55.543 5150-5150/com.ingbanktr.cuzdan.debug V/onPageStarted﹕ data:text/html,<!DOCTYPE HTML PUBLIC ....
12-12 10:46:55.543 5150-5150/com.ingbanktr.cuzdan.debug V/onLoadResource﹕ data:text/html,<!DOCTYPE HTML PUBLIC ...
12-12 10:46:55.575 5150-5150/com.ingbanktr.cuzdan.debug V/doUpdateVisitedHistory﹕ data:text/html,<!DOCTYPE HTML PUBLIC ...
12-12 10:46:55.615 5150-5150/com.ingbanktr.cuzdan.debug V/onPageFinished﹕ data:text/html,<!DOCTYPE HTML PUBLIC ...
12-12 10:46:55.619 5150-5150/com.ingbanktr.cuzdan.debug V/onPageStarted﹕ https://asd.test.com.tr/mdpayacs/pareq
12-12 10:46:55.620 5150-5150/com.ingbanktr.cuzdan.debug V/onLoadResource﹕ https://asd.test.com.tr/mdpayacs/pareq
12-12 10:46:55.721 5150-5150/com.ingbanktr.cuzdan.debug I/chromium﹕ [INFO:SkUtilsArm.cpp(179)] Device supports ARM NEON instructions!
12-12 10:46:56.040 5150-5541/com.ingbanktr.cuzdan.debug I/X509Util﹕ Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
12-12 10:46:56.048 5150-5150/com.ingbanktr.cuzdan.debug V/onPageFinished﹕ https://asd.test.com.tr/mdpayacs/pareq
12-12 10:46:58.416 5150-5150/com.ingbanktr.cuzdan.debug V/onPageStarted﹕ https://asd.test.com.tr/mdpayacs/pareq
12-12 10:46:58.428 5150-5150/com.ingbanktr.cuzdan.debug V/onLoadResource﹕ https://asd.test.com.tr/mdpayacs/pareq
12-12 10:46:58.766 5150-5150/com.ingbanktr.cuzdan.debug V/onPageFinished﹕ https://asd.test.com.tr/mdpayacs/pareq
From KitKat and up the webview is based on Chromium rather than Android's specific branch of Webkit.
https://developer.chrome.com/multidevice/webview/overview
This problem is about SSL Certificate. I downloaded certificate from server, and I installed it to my device. It's about verified root certificates on your device.
Related
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.
I'm attempting to bundle Crosswalk with my Android application so that I can include its webview on a Fragment. The business case being that any HTML we want to run on the view will work across all android versions (the HTML could be a complex activity such as a game). I'm looking for an example which could manage this or how I could change my project to suit that purpose.
I've followed the tutorial here (https://crosswalk-project.org/documentation/android/embedding_crosswalk.html) to get started, this allows me to build an APK that correctly shows web content on my Samsung S4, which uses the ARM chipset, however I now also would like to cover x86. I've got an emulator to test with but I'm not having much luck. I've also attempted to follow the steps here (How to add crosswalk webview in my own android library module?).
I've tried the following:
Different permutations of the including the modules provided on their download page.
Including both the ARM and x86 libraries (Android Studio complains that the classes are defined twice which is what I would expect).
Copying the 'x86' from src/main/jniLibs from within the x86 module and pasting it into the arm module which my application references.
Using 'XWalkActivity' (https://crosswalk-project.org/apis/embeddingapidocs_v7/index.html) not only did this not work on x86 but also stopped working on my ARM device.
The closest I've got is the code at the bottom of this post which allows me to install the application on my emulator but does not load the web content.
Few key things to note from my stack track (at the end of this question).
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_external_extension.cc(58)] Error loading extension '/data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkdummy.so': couldn't get XW_Initialize function.
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_extension_server.cc(407)] Failed to initialize extension: /data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkdummy.so
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_external_extension.cc(58)] Error loading extension '/data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkcore.so': couldn't get XW_Initialize function.
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_extension_server.cc(407)] Failed to initialize extension: /data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkcore.so
This looks problematic however this also occurs when I run it on my ARM device and that works as expected. Does anyone know what these are and the implications?
12-12 17:09:43.013 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Init embedded mode
12-12 17:09:43.013 12271-12271/com.firstapp.crosswalktest D/XWalkLib: [App Version] build:22.52.561.4, api:7, min_api:7
12-12 17:09:43.014 12271-12271/com.firstapp.crosswalktest D/XWalkLib: [Lib Version] build:22.52.561.4, api:7, min_api:5
12-12 17:09:43.014 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Crosswalk download mode: false
12-12 17:09:43.014 12271-12271/com.firstapp.crosswalktest D/XWalkLib: XWalk core version matched
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 144-145)
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest I/cr_LibraryLoader: Expected native library version number "", actual native library version number ""
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Native library is built for IA
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: XWalk core architecture matched
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Running in embedded mode
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Init core bridge
This looks like the set up that XWalk goes through, note that 'XWalk core architecture matched'; I would read from this that it has the native libraries it needs so perhaps something else is the issue?
Stack trace from once the application loads:
12-12 17:09:39.436 2087-2087/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: Micro detection mode: [mDetectionMode: [1]].
12-12 17:09:39.436 2087-2087/com.google.android.googlequicksearchbox:search I/AudioController: Using mInputStreamFactoryBuilder
12-12 17:09:39.440 2087-12244/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Starting detection.
12-12 17:09:39.440 2087-11832/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.staticplugins.z.c#eee8318
12-12 17:09:39.441 1246-1624/? W/APM_AudioPolicyManager: getInputForAttr() failed opening input: samplingRate 16000, format 1, channelMask 10
12-12 17:09:39.441 2087-11832/com.google.android.googlequicksearchbox:search E/AudioRecord: Could not get audio input for session 265, record source 1999, sample rate 16000, format 0x1, channel mask 0x10, flags 0
12-12 17:09:39.442 2087-11832/com.google.android.googlequicksearchbox:search E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -22.
12-12 17:09:39.442 2087-11832/com.google.android.googlequicksearchbox:search E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
12-12 17:09:39.442 2087-11832/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_started com.google.android.apps.gsa.staticplugins.z.c#eee8318
12-12 17:09:39.443 2087-11832/com.google.android.googlequicksearchbox:search E/ActivityThread: Failed to find provider info for com.google.android.apps.gsa.testing.ui.audio.recorded
12-12 17:09:39.445 2087-2087/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: onReady
12-12 17:09:39.447 2087-12244/com.google.android.googlequicksearchbox:search W/SpeechLevelGenerator: Really low audio levels detected. The audio input may have issues.
12-12 17:09:39.453 2087-11832/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_close com.google.android.apps.gsa.staticplugins.z.c#eee8318
12-12 17:09:39.453 2087-12244/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Detection finished
12-12 17:09:39.454 2087-12244/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
12-12 17:09:39.455 2087-2242/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Stopping hotword detection.
12-12 17:09:39.455 2087-12244/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.a.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.i.a.a(SourceFile:342)
at com.google.android.apps.gsa.staticplugins.recognizer.i.a$1.run(SourceFile:1367)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.g(SourceFile:2531)
at com.google.android.apps.gsa.speech.audio.ap.read(SourceFile:555)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.al.run(SourceFile:362)
at com.google.android.apps.gsa.speech.audio.ak$1.run(SourceFile:471)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
12-12 17:09:39.455 2087-12244/com.google.android.googlequicksearchbox:search I/AudioController: internalShutdown
12-12 17:09:39.457 2087-2087/com.google.android.googlequicksearchbox:search I/MicroDetector: Keeping mic open: false
12-12 17:09:39.457 2087-2087/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #onError(false)
12-12 17:09:39.457 2087-12243/com.google.android.googlequicksearchbox:search I/DeviceStateChecker: DeviceStateChecker cancelled
12-12 17:09:42.710 12251-12251/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-12 17:09:42.711 12251-12251/? D/AndroidRuntime: CheckJNI is ON
12-12 17:09:42.711 12251-12251/? E/cutils-trace: Error opening trace file: Permission denied (13)
12-12 17:09:42.736 12251-12251/? W/art: Unexpected CPU variant for X86 using defaults: x86
12-12 17:09:42.739 12251-12251/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-12 17:09:42.745 12255-12255/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-12 17:09:42.746 12255-12255/? D/AndroidRuntime: CheckJNI is ON
12-12 17:09:42.746 12255-12255/? E/cutils-trace: Error opening trace file: Permission denied (13)
12-12 17:09:42.748 12251-12251/? E/memtrack: Couldn't load memtrack module (No such file or directory)
12-12 17:09:42.748 12251-12251/? E/android.os.Debug: failed to load memtrack module: -2
12-12 17:09:42.749 12251-12251/? I/Radio-JNI: register_android_hardware_Radio DONE
12-12 17:09:42.758 12251-12251/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
12-12 17:09:42.759 12251-12251/? D/AndroidRuntime: Shutting down VM
12-12 17:09:42.761 12251-12262/? W/art: Thread attaching while runtime is shutting down: Binder:12251_1
12-12 17:09:42.761 12251-12262/? I/AndroidRuntime: NOTE: attach of thread 'Binder:12251_1' failed
12-12 17:09:42.776 12255-12255/? W/art: Unexpected CPU variant for X86 using defaults: x86
12-12 17:09:42.780 12255-12255/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-12 17:09:42.793 12255-12255/? E/memtrack: Couldn't load memtrack module (No such file or directory)
12-12 17:09:42.793 12255-12255/? E/android.os.Debug: failed to load memtrack module: -2
12-12 17:09:42.794 12255-12255/? I/Radio-JNI: register_android_hardware_Radio DONE
12-12 17:09:42.799 12255-12255/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
12-12 17:09:42.803 1461-1914/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.firstapp.crosswalktest/.MainActivity} from uid 2000 on display 0
12-12 17:09:42.811 12255-12255/? D/AndroidRuntime: Shutting down VM
12-12 17:09:42.815 12271-12271/? I/art: Not late-enabling -Xcheck:jni (already on)
12-12 17:09:42.816 12271-12271/? W/art: Unexpected CPU variant for X86 using defaults: x86
12-12 17:09:42.822 1461-1476/system_process I/ActivityManager: Start proc 12271:com.firstapp.crosswalktest/u0a76 for activity com.firstapp.crosswalktest/.MainActivity
12-12 17:09:42.943 1461-1476/system_process W/art: Long monitor contention with owner android.display (1509) at int com.android.server.wm.WindowManagerService.relayoutWindow(com.android.server.wm.Session, android.view.IWindow, int, android.view.WindowManager$LayoutParams, int, int, int, int, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect, android.content.res.Configuration, android.view.Surface)(WindowManagerService.java:2850) waiters=0 in void com.android.server.wm.WindowManagerService.resumeKeyDispatching(android.os.IBinder) for 120ms
12-12 17:09:42.944 1461-1495/system_process W/art: Long monitor contention with owner Binder:1461_2 (1476) at void com.android.server.am.ActivityManagerService.activityPaused(android.os.IBinder)(ActivityManagerService.java:6915) waiters=0 in void com.android.server.am.ActivityManagerService.dispatchUidsChanged() for 132ms
12-12 17:09:42.958 2087-2087/com.google.android.googlequicksearchbox:search W/SearchService: Abort, client detached.
12-12 17:09:43.013 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Init embedded mode
12-12 17:09:43.013 12271-12271/com.firstapp.crosswalktest D/XWalkLib: [App Version] build:22.52.561.4, api:7, min_api:7
12-12 17:09:43.014 12271-12271/com.firstapp.crosswalktest D/XWalkLib: [Lib Version] build:22.52.561.4, api:7, min_api:5
12-12 17:09:43.014 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Crosswalk download mode: false
12-12 17:09:43.014 12271-12271/com.firstapp.crosswalktest D/XWalkLib: XWalk core version matched
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 144-145)
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest I/cr_LibraryLoader: Expected native library version number "", actual native library version number ""
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Native library is built for IA
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: XWalk core architecture matched
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Running in embedded mode
12-12 17:09:43.045 12271-12271/com.firstapp.crosswalktest D/XWalkLib: Init core bridge
12-12 17:09:43.057 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.ButtonCompat is not int.
12-12 17:09:43.057 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.TextViewWithLeading is not int.
12-12 17:09:43.066 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.ButtonCompat is not int.
12-12 17:09:43.066 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.TextViewWithLeading is not int.
12-12 17:09:43.069 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.ButtonCompat is not int.
12-12 17:09:43.069 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.TextViewWithLeading is not int.
12-12 17:09:43.076 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.ButtonCompat is not int.
12-12 17:09:43.076 12271-12271/com.firstapp.crosswalktest W/XWalkInternalResources: org.xwalk.core.R$styleable.TextViewWithLeading is not int.
12-12 17:09:43.082 12271-12271/com.firstapp.crosswalktest I/cr_LibraryLoader: Expected native library version number "", actual native library version number ""
12-12 17:09:43.082 12271-12271/com.firstapp.crosswalktest I/chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
12-12 17:09:43.084 12271-12271/com.firstapp.crosswalktest I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
[ 12-12 17:09:43.098 12271:12271 D/ ]
HostConnection::get() New Host Connection established 0x9b4409a0, tid 12271
12-12 17:09:43.150 12271-12300/com.firstapp.crosswalktest W/cr_media: Requires BLUETOOTH permission
12-12 17:09:43.153 12271-12271/com.firstapp.crosswalktest E/chromium: [ERROR:xwalk_platform_notification_service.cc(143)] Not implemented reached in virtual bool xwalk::XWalkPlatformNotificationService::GetDisplayedPersistentNotifications(content::BrowserContext*, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >*)
12-12 17:09:43.167 12271-12271/com.firstapp.crosswalktest E/chromium: [ERROR:xwalk_browser_context.cc(87)] Failed to read preference, error num: 0
12-12 17:09:43.168 12271-12271/com.firstapp.crosswalktest D/XWalkContent: CompositingSurfaceType is SurfaceView
12-12 17:09:43.209 12271-12271/com.firstapp.crosswalktest W/art: Attempt to remove non-JNI local reference, dumping thread
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_external_extension.cc(58)] Error loading extension '/data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkdummy.so': couldn't get XW_Initialize function.
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_extension_server.cc(407)] Failed to initialize extension: /data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkdummy.so
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_external_extension.cc(58)] Error loading extension '/data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkcore.so': couldn't get XW_Initialize function.
12-12 17:09:43.243 12271-12294/com.firstapp.crosswalktest W/chromium: [WARNING:xwalk_extension_server.cc(407)] Failed to initialize extension: /data/app/com.firstapp.crosswalktest-2/lib/x86/libxwalkcore.so
12-12 17:09:43.267 12271-12271/com.firstapp.crosswalktest I/cr_Ime: ImeThread is not enabled.
12-12 17:09:43.282 12271-12318/com.firstapp.crosswalktest I/chromium: [INFO:xwalk_extension_renderer_controller.cc(42)] EXTENSION PROCESS DISABLED.
12-12 17:09:43.301 12271-12323/com.firstapp.crosswalktest E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
12-12 17:09:43.320 12271-12323/com.firstapp.crosswalktest I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
[ 12-12 17:09:43.326 12271:12323 D/ ]
HostConnection::get() New Host Connection established 0xa8b89800, tid 12323
12-12 17:09:43.333 1228-1268/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
12-12 17:09:43.487 12271-12326/com.firstapp.crosswalktest I/OpenGLRenderer: Initialized EGL, version 1.4
12-12 17:09:43.487 12271-12326/com.firstapp.crosswalktest D/OpenGLRenderer: Swap behavior 1
[ 12-12 17:09:43.488 12271:12326 D/ ]
HostConnection::get() New Host Connection established 0x87a05940, tid 12326
12-12 17:09:43.562 12271-12271/com.firstapp.crosswalktest W/art: Attempt to remove non-JNI local reference, dumping thread
12-12 17:09:43.958 1461-1509/system_process I/ActivityManager: Displayed com.firstapp.crosswalktest/.MainActivity: +1s147ms
12-12 17:09:43.994 12271-12271/com.firstapp.crosswalktest E/chromium: [ERROR:layer_tree_host_impl.cc(2233)] Forcing zero-copy tile initialization as worker context is missing
12-12 17:09:44.093 12271-12271/com.firstapp.crosswalktest W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 12271
12-12 17:09:44.102 12271-12323/com.firstapp.crosswalktest E/chromium: [ERROR:buffer_manager.cc(438)] [.DisplayCompositor-0x84d23400]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
12-12 17:09:44.352 1228-1228/? W/SurfaceFlinger: couldn't log to binary event log: overflow.
12-12 17:09:44.640 12271-12323/com.firstapp.crosswalktest E/chromium: [ERROR:texture_manager.cc(2942)] [.RenderCompositor-0x88b75800]GL ERROR :GL_INVALID_OPERATION : glTexImage2D: <- error from previous GL command
12-12 17:09:45.247 12271-12291/com.firstapp.crosswalktest D/NetworkSecurityConfig: No Network Security Config specified, using platform default
My project structure:
MainActivity.java
package com.firstapp.crosswalktest;
import org.xwalk.core.XWalkPreferences;
import org.xwalk.core.XWalkView;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
private XWalkView mXWalkView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
mXWalkView = (XWalkView) findViewById(R.id.activity_main);
mXWalkView.load("http://crosswalk-project.org/", null);
}
}
activity_main.xml
<org.xwalk.core.XWalkView android:id="#+id/activity_main"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</org.xwalk.core.XWalkView>
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.
I have a webiew app on android which loads some websites but not the one I need it to.
I have no idea if this is a problem with the website host or something I can do in my app. Basically I have an online portfolio I'm making for university and I want to make myself look better by building it into an app. The portfolio site includes a mobile version so it's already set up for that and works fine in the chrome browser on my phone.
It used to work with an old site and it loads google so I know I have the internet permission right. Not sure if it's something to do with my new site or I just need to change something to make it work.
In the chrome browser it looks as it should, which isn't good at the moment because I wanted to do this first before I added content to it. This is how it looks. (Can't post a screenshot directly as I don't have enough rep, sorry)
Here is my main app code:
package com.broadbentstudios;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.parse.ParseAnalytics;
#SuppressLint("SetJavaScriptEnabled")
public class ParseStarterProjectActivity extends Activity {
WebView webView;
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webView = (WebView) findViewById(R.id.mainWebView);
webView.setBackgroundColor(0x00000000);
webView.setHorizontalScrollBarEnabled(false);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setUseWideViewPort(true);
webView.loadUrl("http://www.broadbentstudios.com/");
webView.setWebViewClient(new WebViewClient() {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
});
}
#Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && webView!=null && webView.canGoBack()) {
webView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
{
ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
}
Screenshot of my site when using my app with the code above.
Here is the logcat.
04-12 18:51:45.686: D/PowerManagerService(1196): acquireWakeLockInternal: lock=903227323, flags=0x1, tag="LocationManagerService", ws=WorkSource{1000 com.qualcomm.location}, uid=1000, pid=1196
04-12 18:51:45.686: D/PowerManagerService(1196): acquireWakeLockInternal: lock=662236910, flags=0x1, tag="LocationManagerService", ws=WorkSource{10013 com.google.android.gms}, uid=1000, pid=1196
04-12 18:51:45.687: D/PowerManagerService(1196): acquireWakeLockInternal: lock=531027438, flags=0x1, tag="LocationManagerService", ws=WorkSource{10013 com.google.android.gms}, uid=1000, pid=1196
04-12 18:51:45.687: D/PowerManagerService(1196): releaseWakeLockInternal: lock=959227632 [LocationManagerService], flags=0x0
04-12 18:51:45.687: D/PowerManagerService(1196): releaseWakeLockInternal: lock=546372682 [LocationManagerService], flags=0x0
04-12 18:51:45.688: D/PowerManagerService(1196): releaseWakeLockInternal: lock=662236910 [LocationManagerService], flags=0x0
04-12 18:51:45.688: D/PowerManagerService(1196): releaseWakeLockInternal: lock=531027438 [LocationManagerService], flags=0x0
04-12 18:51:45.689: D/PowerManagerService(1196): releaseWakeLockInternal: lock=197382963 [LocationManagerService], flags=0x0
04-12 18:51:45.689: D/PowerManagerService(1196): releaseWakeLockInternal: lock=903227323 [LocationManagerService], flags=0x0
04-12 18:51:45.734: I/LibraryLoader(28664): Time to load native libraries: 34 ms (timestamps 2209-2243)
04-12 18:51:45.734: I/LibraryLoader(28664): Expected native library version number "",actual native library version number ""
04-12 18:51:45.747: V/WebViewChromiumFactoryProvider(28664): Binding Chromium to main looper Looper (main, tid 1) {24dd5d0b}
04-12 18:51:45.747: I/LibraryLoader(28664): Expected native library version number "",actual native library version number ""
04-12 18:51:45.747: I/chromium(28664): [INFO:library_loader_hooks.cc(108)] Chromium logging enabled: level = 0, default verbosity = 0
04-12 18:51:45.757: I/BrowserStartupController(28664): Initializing chromium process, singleProcess=true
04-12 18:51:45.758: W/art(28664): Attempt to remove local handle scope entry from IRT, ignoring
04-12 18:51:45.768: W/AudioManagerAndroid(28664): Requires BLUETOOTH permission
04-12 18:51:45.769: W/chromium(28664): [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
04-12 18:51:45.770: I/chromium(28664): [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful, fd=59 off=45928 len=3221
04-12 18:51:45.770: I/chromium(28664): [INFO:aw_browser_main_parts.cc(76)] Loading webviewchromium.pak from, fd:60 off:390788 len:1143511
04-12 18:51:45.775: D/libEGL(28664): loaded /vendor/lib/egl/libEGL_adreno.so
04-12 18:51:45.776: D/libEGL(28664): loaded /vendor/lib/egl/libGLESv1_CM_adreno.so
04-12 18:51:45.788: D/libEGL(28664): loaded /vendor/lib/egl/libGLESv2_adreno.so
04-12 18:51:45.803: I/Adreno-EGL(28664): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1.C2.05.00.00.046.002_msm8974_LA.BF.1.1.1.C2__release_AU ()
04-12 18:51:45.803: I/Adreno-EGL(28664): OpenGL ES Shader Compiler Version: E031.25.03.00
04-12 18:51:45.803: I/Adreno-EGL(28664): Build Date: 01/06/15 Tue
04-12 18:51:45.803: I/Adreno-EGL(28664): Local Branch: mybranch6793908
04-12 18:51:45.803: I/Adreno-EGL(28664): Remote Branch: quic/LA.BF.1.1.1.c2
04-12 18:51:45.803: I/Adreno-EGL(28664): Local Patches: NONE
04-12 18:51:45.803: I/Adreno-EGL(28664): Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1.C2.05.00.00.046.002 + NOTHING
04-12 18:51:45.868: W/chromium(28664): [WARNING:data_reduction_proxy_settings.cc(328)] SPDY proxy OFF at startup
04-12 18:51:45.890: W/art(28664): Attempt to remove local handle scope entry from IRT, ignoring
04-12 18:51:45.895: W/AwContents(28664): onDetachedFromWindow called when already detached. Ignoring
04-12 18:51:45.917: E/QCOMSysDaemon(28750): Can't open /dev/block/platform/msm_sdcc.1/by-name/bootselect: (No such file or directory)
04-12 18:51:45.917: I/QCOMSysDaemon(28750): Starting qcom system daemon
04-12 18:51:45.917: E/Diag_Lib(28750): Diag_LSM_Init: Failed to open handle to diag driver, error = 2
04-12 18:51:45.917: E/QCOMSysDaemon(28750): Diag_LSM_Init failed : 0
04-12 18:51:45.953: D/OpenGLRenderer(28664): Render dirty regions requested: true
04-12 18:51:45.956: D/Atlas(28664): Validating map...
04-12 18:51:45.962: E/com.parse.push(28664): successfully subscribed to the broadcast channel.
04-12 18:51:45.963: D/PowerManagerService(1196): acquireWakeLockInternal: lock=553909931, flags=0x1, tag="Intent { act=com.google.android.c2dm.intent.REGISTRATION flg=0x10 pkg=com.broadbentstudios cmp=com.broadbentstudios/com.parse.GcmBroadcastReceiver (has extras) }", ws=null, uid=10221, pid=28664
04-12 18:51:45.992: I/OpenGLRenderer(28664): Initialized EGL, version 1.4
04-12 18:51:45.997: D/OpenGLRenderer(28664): Enabling debug mode 0
04-12 18:51:46.009: D/PowerManagerService(1196): releaseWakeLockInternal: lock=553909931 [Intent { act=com.google.android.c2dm.intent.REGISTRATION flg=0x10 pkg=com.broadbentstudios cmp=com.broadbentstudios/com.parse.GcmBroadcastReceiver (has extras) }], flags=0x0
04-12 18:51:46.029: I/Timeline(28664): Timeline: Activity_idle id: android.os.BinderProxy#19326283 time:33412539
04-12 18:51:46.030: D/PowerManagerService(1196): releaseWakeLockInternal: lock=110279535 [ActivityManager-Launch], flags=0x0
04-12 18:51:46.038: I/ActivityManager(1196): Displayed com.broadbentstudios/.ParseStarterProjectActivity: +864ms
04-12 18:51:46.038: I/Timeline(1196): Timeline: Activity_windows_visible id: ActivityRecord{3eff1853 u0 com.broadbentstudios/.ParseStarterProjectActivity t1645} time:33412548
04-12 18:51:46.055: D/ForegroundUtils(4725): Foreground changed, PID: 4813 UID: 10182 foreground: false
04-12 18:51:46.055: D/ForegroundUtils(4725): Foreground UID/PID combinations:
04-12 18:51:46.055: D/ForegroundUtils(4725): UID: 10221 PID: 28664
04-12 18:51:46.386: D/AbstractMetricsFactoryImpl(28721): record : No data points in metrics event
04-12 18:51:46.637: W/BindingManager(28664): Cannot call determinedVisibility() - never saw a connection for the pid: 28664
04-12 18:51:47.134: I/chromium(28664): [INFO:CONSOLE(0)] "'webkitIDBRequest' is deprecated. Please use 'IDBRequest' instead.", source: (0)
04-12 18:51:47.422: I/chromium(28664): [INFO:CONSOLE(1)] "HARD RESET!!", source: http://www.broadbentstudios.com/application/_output/pb.out.front.js?v=7 (1)
04-12 18:51:47.440: I/chromium(28664): [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'clear' of null", source: http://www.broadbentstudios.com/application/_output/pb.out.front.js?v=7 (1)
04-12 18:51:48.338: D/audio_hw_primary(253): out_standby: enter: stream (0xb5801780) usecase(1: low-latency-playback)
Any help would be great, even if it's just so I know if it's my app or the site that is causing the problems.
Finally found the answer after a lot of searching. For anybody in a similar situation, as well as enabling javascript you also need to enable Dom storage by adding in;
webView.getSettings().setDomStorageEnabled(true);
Change webView to whatever yours is called and you should be good to go.
Hope this helps someone.
Your website has a JavaScript error. Did you try something about that error in the log you shared?
Uncaught TypeError: Cannot read property 'clear' of null", source:
http://www.broadbentstudios.com/application/_output/pb.out.front.js?v=7
(1)
I recently create one repository with a basic web view application for android with some error handling for no internet connection
https://github.com/jgarciabt/SmartWebView
You can clone it and start your application from it, maybe that is easier.
I'm running my application on Samsung Note with android version 4.0.4.
It's not crashing on devices like Samsung POP which is running android 2.2. And on Motorola Xoom running Androi 3.1.
When I'm installing my application It shows black screen then after some time shows popup that application is stop, and my application splash screen loading behind this dialog when I press ok that dialog disappears and I can go to my Application login screen.
12-13 18:33:53.823: I/ActivityThread(14608): Pub com.android.mypype.urbanairship.provider: com.urbanairship.UrbanAirshipProvider
12-13 18:33:53.833: I/Inside MyPype(14608): Application Class
12-13 18:33:54.423: D/myPype - UALib(14608): Airship Take Off! Lib Version: 2.0.1 / App key = xsXcmKOoRe6gog9onrQHjA
12-13 18:33:54.423: D/myPype - UALib(14608): In Production? false
12-13 18:33:54.713: D/myPype - UALib(14608): Initializing Push.
12-13 18:33:54.718: D/myPype - UALib(14608): Initializing Analytics.
12-13 18:33:54.938: I/SqliteDatabaseCpp(14608): sqlite returned: error code = 5, msg = database is locked, db=xxx
12-12 11:57:09.553: E/SqliteDatabaseCpp(3608): sqlite3_exec - Failed to set synchronous mode = 1(Normal)
12-12 11:57:09.553: E/SQLiteDatabase(3608): Failed to open the database. closing it.
12-12 11:57:09.553: E/SQLiteDatabase(3608): android.database.sqlite.SQLiteDatabaseLockedException: database is locked
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1132)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1083)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1170)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:844)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:228)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at com.urbanairship.analytics.EventDataManager.<init>(Unknown Source)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at com.urbanairship.analytics.Analytics.<init>(Unknown Source)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at com.urbanairship.UAirship.takeOff(Unknown Source)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at com.android.mypype.MypypeApplication.onCreate(MypypeApplication.java:133)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:972)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3965)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.app.ActivityThread.access$1300(ActivityThread.java:127)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.os.Looper.loop(Looper.java:137)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at android.app.ActivityThread.main(ActivityThread.java:4511)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at java.lang.reflect.Method.invoke(Method.java:511)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
12-12 11:57:09.553: E/SQLiteDatabase(3608): at dalvik.system.NativeStart.main(Native Method)
12-12 11:57:09.553: E/myPype - UALib(3608): Unable to open Analytics Event DB
12-12 11:57:37.958: E/myPype - UALib(3608): Unable to get DB size. Database not open.
12-12 11:57:37.963: E/myPype - UALib(3608): Unable to insert event. Database not open.
In above error why It's pointing to Application class Urbanairship.takeOff() method.
I am searching for this issue but doesn't get anything yet. I am not able to figure it out. I tried synchronizing Locks on database operation in openHelper calss.
any help will be appreciated.
In my Application class I added below code to for Urbanairship.
#Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
// This can be done in code as illustrated here,
// or you can add these settings to a properties file
// called airshipconfig.properties
// and place it in your "assets" folder
AirshipConfigOptions options = AirshipConfigOptions
.loadDefaultOptions(this);
// Take off initializes the services
UAirship.takeOff(this, options);
PushManager.enablePush();
}
I figure it out but not the solution it's just a fix.
I just handle the exception so app can't get crash.
How sad no one went through this actually it's for higher versions such as 4.0.4.
So, I got one thing that it may be Urbairships new lib. fault because it's trying to write database (i read some events or something).
I don't understand how to solve so I handled this exception.
So, solution is you have to write your code under try-catch block and specify exception for handling in catch.