Android app crashes showing webview logs - android

My android app often goes not responding and then crashes printing the following log:
12-16 00:43:49.788 27523-27523/com.robocats.main W/linker: /data/app/com.google.android.webview-2/lib/arm64/libwebviewchromium.so: unused DT entry: type 0x6ffffffe arg 0x38c70
12-16 00:43:49.788 27523-27523/com.robocats.main W/linker: /data/app/com.google.android.webview-2/lib/arm64/libwebviewchromium.so: unused DT entry: type 0x6fffffff arg 0x3
12-16 00:43:49.908 27523-27523/com.robocats.main I/WebViewFactory: Loading com.google.android.webview version 55.0.2883.91 (code 288309150)
12-16 00:43:49.928 27523-27523/com.robocats.main I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
12-16 00:43:49.928 27523-27523/com.robocats.main I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
12-16 00:43:49.938 27523-27523/com.robocats.main I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
12-16 00:43:49.938 27523-27523/com.robocats.main I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
12-16 00:43:49.948 27523-27523/com.robocats.main I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 5331-5332)
12-16 00:43:49.948 27523-27523/com.robocats.main I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
12-16 00:43:49.958 27523-27523/com.robocats.main I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
12-16 00:43:49.978 27523-27523/com.robocats.main I/chromium: [INFO:library_loader_hooks.cc(163)] Chromium logging enabled: level = 0, default verbosity = 0
12-16 00:43:50.028 27523-27523/com.robocats.main I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
12-16 00:43:50.328 27523-27523/com.robocats.main D/CognitoCachingCredentialsProvider: Loading credentials from SharedPreferences
12-16 00:43:57.608 27523-27534/com.robocats.main I/art: Thread[7,tid=27534,WaitingInMainSignalCatcherLoop,Thread*=0x55982e3fc0,peer=0x12c000a0,"Signal Catcher"]: reacting to signal 3
12-16 00:43:58.088 27523-27534/com.robocats.main I/art: Wrote stack traces to '/data/anr/traces.txt'
The logs are coming from webview, but I'm not at all using webview in my application. Any pointers here?

Related

Error while implementing admob

I have implemented admob in my app.when the activity loads ,logcat shows some errors which i am not able to relate to admob.
LogCat:
W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
I/art: DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm64/data#data#com.google.android.gms#app_chimera#m#00000040#DynamiteModulesA_GmsCore_prodlmp_xhdpi_release.apk#classes.dex' for file location '/data/data/com.google.android.gms/app_chimera/m/00000040/DynamiteModulesA_GmsCore_prodlmp_xhdpi_release.apk': Failed to open oat filename for reading: No such file or directory
D/DynamitePackage: Instantiated singleton DynamitePackage.
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
D/WebViewFactory: primaryArchIs64bit = true
I/WebViewFactory: Loading com.google.android.webview version 64.0.3282.137 (code 328213750)
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/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/cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 8604-8606)
I/chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_LibraryLoader: Expected native library version number "64.0.3282.137", actual native library version number "64.0.3282.137"
I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
I/cr_base: Android Locale: en_IN requires .pak files: []
E/chromium: [ERROR:instance.cc(49)] Unable to locate service manifest for metrics
E/chromium: [ERROR:service_manager.cc(890)] Failed to resolve service name: metrics
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$7>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$7>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$3>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$3>
D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingActionModeCallback>
I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingActionModeCallback>
**W/cr_media: Requires BLUETOOTH permission
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
W/AudioCapabilities: Unsupported mime audio/evrc
W/AudioCapabilities: Unsupported mime audio/qcelp
W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
W/AudioCapabilities: Unsupported mime audio/qcelp
W/AudioCapabilities: Unsupported mime audio/evrc
W/VideoCapabilities: Unsupported mime video/mp4v-esdp
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es**
I/Ads: Updating ad debug logging enablement.
I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("*********") to get test ads on this device.
W/Ads: Not retrying to fetch app settings
I/Choreographer: Skipped 184 frames! The application may be doing too much work on its main thread.
W/Ads: Invoke Firebase method getInstance error.
W/Ads: The Google Mobile Ads SDK will not integrate with Firebase. Admob/Firebase integration requires the latest Firebase SDK jar, but Firebase SDK is either missing or out of date
D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
W/Ads: Update ad debug logging enablement as false
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/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#3020318e time:246760805
W/cr_CrashFileManager: /data/data/com.sns.kids.maths.games/cache/WebView/Crash Reports does not exist or is not a directory
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)
I/Ads: Scheduling ad refresh 70000 milliseconds from now.
I/Ads: Ad finished loading.
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 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)
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)
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#16ae39cd time:246768461
The logcat says it requires bluetooth permission.I am getting this only when i am adding admob code.When i remove the admob it disappears.
Admob Code :
private void showBannerAds() {
MobileAds.initialize(this,getResources().getString(R.string.admob_appid));
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}

Firebase SDK is out of date, no ad showing

I found here Android Studio - SDK is out of date or is missing templates I need to update in my SDK tools.
I see no option for Firebase.
I followed the AdMob instructions. A 403 "unable to show ad" error showed, then I switched my ad unit type to "Banner" and used the test banner unit id "ca-app-pub-3940256099942544/6300978111".
My onCreate in main activity:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, "my addmob id ");
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
initialiseView();
}
My layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"
android:layout_below="#+id/linearLayout">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
and my logs:
W/GooglePlayServicesUtil: Google Play Store is missing.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play services is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("C8DCA36186E6C4138C4E71BB102F78D2") to get test ads on this device.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/Ads: Invoke Firebase method getInstance error.
W/Ads: The Google Mobile Ads SDK will not integrate with Firebase. Admob/Firebase integration requires the latest Firebase SDK jar, but Firebase SDK is either missing or out of date
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/System: ClassLoader referenced unknown path: /system/app/webview/lib/x86
W/art: Before Android 4.1, method double java.util.concurrent.ThreadLocalRandom.internalNextDouble(double, double) would have incorrectly overridden the package-private method in java.util.Random
W/art: Before Android 4.1, method int java.util.concurrent.ThreadLocalRandom.internalNextInt(int, int) would have incorrectly overridden the package-private method in java.util.Random
W/art: Before Android 4.1, method long java.util.concurrent.ThreadLocalRandom.internalNextLong(long, long) would have incorrectly overridden the package-private method in java.util.Random
I/WebViewFactory: Loading com.android.webview version 51.0.2704.91 (code 275509110)
I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 8593-8599)
I/cr_LibraryLoader: Expected native library version number "51.0.2704.91", actual native library version number "51.0.2704.91"
D/MediaPlayer: setSubtitleAnchor in MediaPlayer
D/MediaPlayer: setSubtitleAnchor in MediaPlayer
D/MediaPlayer: setSubtitleAnchor in MediaPlayer
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.internal.zzflm>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/customtabs/CustomTabsServiceConnection;
I/art: at boolean com.google.android.gms.internal.zznn.zzi(android.content.Context) ((null):-1)
I/art: at void com.google.android.gms.internal.zzabv.<init>(android.content.Context, com.google.android.gms.internal.zzabu) ((null):-1)
I/art: at java.lang.Object com.google.android.gms.internal.zzabx.call() ((null):-1)
I/art: at void com.google.android.gms.internal.zzago.run() ((null):-1)
I/art: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:428)
I/art: at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
I/art: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133)
I/art: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607)
I/art: at void java.lang.Thread.run() (Thread.java:761)
I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.customtabs.CustomTabsServiceConnection" on path: DexPathList[[zip file "/data/app/zapbear.quantumproductions.com.zappybear-2/base.apk"],nativeLibraryDirectories=[/data/app/zapbear.quantumproductions.com.zappybear-2/lib/x86, /system/lib, /vendor/lib]]
I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
I/art: at boolean com.google.android.gms.internal.zznn.zzi(android.content.Context) ((null):-1)
I/art: at void com.google.android.gms.internal.zzabv.<init>(android.content.Context, com.google.android.gms.internal.zzabu) ((null):-1)
I/art: at java.lang.Object com.google.android.gms.internal.zzabx.call() ((null):-1)
I/art: at void com.google.android.gms.internal.zzago.run() ((null):-1)
I/art: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:428)
I/art: at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
I/art: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133)
I/art: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607)
I/art: at void java.lang.Thread.run() (Thread.java:761)
I/art: [ 11-20 01:41:39.886 2681: 2681 D/ ]
HostConnection::get() New Host Connection established 0xd9e15090, tid 2681
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {f36c082}
I/cr_LibraryLoader: Expected native library version number "51.0.2704.91", actual native library version number "51.0.2704.91"
I/chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
E/ApkAssets: Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
E/ApkAssets: Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008d57
W/cr_media: Requires BLUETOOTH permission
I/cr_DRP: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
I/cr_Ime: ImeThread is not enabled.
E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
[ 11-20 01:41:40.059 2681: 2747 D/ ]
HostConnection::get() New Host Connection established 0xf2e305a0, tid 2747
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
[ 11-20 01:41:40.076 2681: 2779 D/ ]
HostConnection::get() New Host Connection established 0xd54ee1b0, tid 2779
W/EGL_emulation: eglSurfaceAttrib not implemented
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd9ee1e80, error=EGL_SUCCESS
V/assigned screenW: 1080.0
V/The jump force is: 21.637500000000003
E/chromium: [ERROR:gles2_cmd_decoder.cc(2167)] [GroupMarkerNotSet(crbug.com/242999)!:54DB7FD8]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Create: <- error from previous GL command
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 2681
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
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.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.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.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.html (0)
W/GooglePlayServicesUtil: Google Play services is missing.
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
W/Ads: Not enough space to show ad. Needs 320x49 dp, but only has 320x0 dp.
E/chromium: [ERROR:gles2_cmd_decoder.cc(2167)] [GroupMarkerNotSet(crbug.com/242999)!:5420DED3]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Create: <- error from previous GL command
I/cr_Ime: ImeThread is not enabled.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 2681
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
W/Ads: Not enough space to show ad. Needs 320x49 dp, but only has 320x0 dp.
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
I/cr_Ime: ImeThread is not enabled.
I/Ads: Ad finished loading.
but I see no ad, just my app as usual.

androidTestCompile runtime dependency doesn't work on android 5.0+

So I wrote an instrumental test that performs some changes in my database on my localhost server. I used just jdbc raw query, nothing special.
On Android < 5.0 instrumental tests run ok
On Android starting from 5.0 (doesn't matter if it's an emulator or real device) instrumentalTests classLoader throws java.lang.NoClassDefFoundError: com.mysql.jdbc.jdbc2.optional.MysqlDataSource. Note my tests do not even start.
I do have mysql in dependencies and I don't use proguard in debug mode that can strip it out.
If I specify mysql-connector-java as compile instead of androidTestCompile it works after android 5.0 as well. So the problem is androidTestCompile doesn't append mysql lib to instrumental environment.
Why does android 5.0 doesn't detect androidTestCompile dependency? Here's what I got:
build.gradle:
dependencies {
//...
androidTestCompile "mysql:mysql-connector-java:5.1.6"
}
androidTest/java/my.package.Mytest:
Note that I load mysql lib via Class.forName
import java.sql.*; // some java.sql imports, no mysql dependencies in imports.
#RunWith(AndroidJUnit4.class)
#LargeTest
public class LoginTest {
#Rule
public final ActivityTestRule<MainScreen> main = new ActivityTestRule<>(MainScreen.class);
#Test
public void checkLoginFlow() throws InterruptedException {
// Login/Sign up flow
assertEquals("App is not loaded", MainScreen.class, getCurrentActivity());
Connection conn = null;
PreparedStatement stmt = null;
try{
Class.forName("com.mysql.jdbc.Driver");
....
Here's the full log:
Testing started at 1:12 PM ...
01/17 13:12:50: Launching UITest
$ adb push /tmp/MyApp/app/outputs/apk/app-debug.apk /data/local/tmp/com.MyApp
$ adb shell pm install -r "/data/local/tmp/com.MyApp"
pkg: /data/local/tmp/com.MyApp
Success
$ adb push /tmp/MyApp/app/outputs/apk/app-debug-androidTest.apk /data/local/tmp/com.MyApp.test
$ adb shell pm install -r "/data/local/tmp/com.MyApp.test"
pkg: /data/local/tmp/com.MyApp.test
Success
Running tests
$ adb shell am instrument -w -r -e debug true com.MyApp.test/android.support.test.runner.AndroidJUnitRunner
Waiting for application to come online: com.MyApp | com.MyApp.test
Waiting for application to come online: com.MyApp | com.MyApp.test
Waiting for application to come online: com.MyApp | com.MyApp.test
Waiting for application to come online: com.MyApp | com.MyApp.test
Connecting to com.MyApp
I/art: Debugger is active
Connected to the target VM, address: 'localhost:8657', transport: 'socket'
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1434)
I/AndroidJUnitRunner: Debugger connected.
I/MonitoringInstrumentation: Instrumentation Started!
I/MonitoringInstrumentation: Setting context classloader to 'dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.MyApp.test-2/base.apk", zip file "/data/app/com.MyApp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.MyApp.test-2/lib/x86_64, /data/app/com.MyApp-2/lib/x86_64, /vendor/lib64, /system/lib64]]]', Original: 'dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.MyApp.test-2/base.apk", zip file "/data/app/com.MyApp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.MyApp.test-2/lib/x86_64, /data/app/com.MyApp-2/lib/x86_64, /vendor/lib64, /system/lib64]]]'
I/MonitoringInstrumentation: No JSBridge.
I/UsageTrackerFacilitator: Usage tracking enabled
I/TestRequestBuilder: Scanning classpath to find tests in apks [/data/app/com.MyApp.test-2/base.apk]
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.integration.c3p0.MysqlConnectionTester>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.integration.c3p0.MysqlConnectionTester>
E/TestLoader: Could not find class: com.mysql.jdbc.integration.c3p0.MysqlConnectionTester
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter>
E/TestLoader: Could not find class: com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker>
E/TestLoader: Could not find class: com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlXAConnection>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlXAConnection>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection>
E/TestLoader: Could not find class: com.mysql.jdbc.jdbc2.optional.JDBC4MysqlXAConnection
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.SuspendableXAConnection>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.SuspendableXAConnection>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.JDBC4SuspendableXAConnection>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.JDBC4SuspendableXAConnection>
E/TestLoader: Could not find class: com.mysql.jdbc.jdbc2.optional.JDBC4SuspendableXAConnection
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlDataSource>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlDataSource>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource>
E/TestLoader: Could not find class: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.mysql.jdbc.jdbc2.optional.MysqlDataSource>
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: Instr: android.support.test.runner.AndroidJUnitRunner
Process: com.MyApp, PID: 4088
java.lang.NoClassDefFoundError: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at android.support.test.internal.runner.TestLoader.doLoadClass(TestLoader.java:92)
at android.support.test.internal.runner.TestLoader.loadIfTest(TestLoader.java:113)
at android.support.test.internal.runner.TestRequestBuilder.loadClassesFromClassPath(TestRequestBuilder.java:801)
at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:747)
at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:354)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:260)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Started running tests
Test running failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError'
Tests ran to completion.

Android webview within application not loading

The intent of this is to have a webpage firing within the app itself. The app runs without glitches, but the webpage is never seen. The .xml contains the webpage and a list beneath it.
The .xml file reads as
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<ListView
android:layout_width="fill_parent"
android:layout_height="500dp"
android:id="#android:id/list"/>
</LinearLayout>
The activity in the .java reads as
#Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView myWebView = new WebView(this);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl("https://google.com");
// Other AWS gibberish
}
I can get the webpage to fire as an separate application, but this is not what I want.
WebView webview = new WebView(this);
setContentView(webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://google.ca");
Edit: I have already added the internet permission to the manifest
<uses-permission android:name="android.permission.INTERNET" />
Some references I have been using here, here, here and documentation without success
Edit 2: Going through the device debug files and the following are being logged
10-18 22:07:59.296 7717-7717/com.amazon.mysampleapp I/WebViewFactory: Loading com.google.android.webview version 53.0.2785.124 (code 278512400)
10-18 22:07:59.306 7717-7826/com.amazon.mysampleapp I/System.out: (HTTPLog)-Static: SBServiceAPI: getService class android.os.ServiceManager
10-18 22:07:59.306 7717-7826/com.amazon.mysampleapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
10-18 22:07:59.306 7717-7826/com.amazon.mysampleapp I/System.out: (HTTPLog)-Static: isShipBuild true
10-18 22:07:59.306 7717-7826/com.amazon.mysampleapp I/System.out: (HTTPLog)-Thread-46729-141117018: SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
10-18 22:07:59.306 7717-7826/com.amazon.mysampleapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
10-18 22:07:59.336 7717-7826/com.amazon.mysampleapp I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false
10-18 22:07:59.336 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
10-18 22:07:59.336 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
10-18 22:07:59.336 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
10-18 22:07:59.346 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
10-18 22:07:59.366 7717-7717/com.amazon.mysampleapp I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 655-661)
10-18 22:07:59.366 7717-7717/com.amazon.mysampleapp I/cr_LibraryLoader: Expected native library version number "53.0.2785.124", actual native library version number "53.0.2785.124"
10-18 22:07:59.376 7717-7717/com.amazon.mysampleapp W/ResourceType: Failure getting entry for 0x01080ad1 (t=7 e=2769) (error -75)
10-18 22:07:59.386 7717-7717/com.amazon.mysampleapp I/cr_LibraryLoader: Expected native library version number "53.0.2785.124", actual native library version number "53.0.2785.124"
10-18 22:07:59.396 7717-7717/com.amazon.mysampleapp I/chromium: [INFO:library_loader_hooks.cc(151)] Chromium logging enabled: level = 0, default verbosity = 0
10-18 22:07:59.436 7717-7717/com.amazon.mysampleapp I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
10-18 22:07:59.606 7717-7826/com.amazon.mysampleapp I/DefaultDeliveryClient: Successful submission of 4 events
10-18 22:07:59.646 7717-7843/com.amazon.mysampleapp W/cr_media: Requires BLUETOOTH permission
10-18 22:07:59.686 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
10-18 22:07:59.696 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
10-18 22:07:59.736 7717-7717/com.amazon.mysampleapp D/ConnectivityManager: CallingUid : 10097, CallingPid : 7717
10-18 22:07:59.736 7717-7854/com.amazon.mysampleapp D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
10-18 22:07:59.766 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
10-18 22:07:59.766 7717-7717/com.amazon.mysampleapp I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
Instead of instantiating a new Webview at onCreate I think you may need to use the one specified in your layout:
#Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.NAME_OF_THE_XML_FILE); // change here to match the name of your xml file
// WebView myWebView = new WebView(this); instead of this, try this one below:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl("https://google.com");
// Other AWS gibberish
}

Issue when trying to show Video in WebView

Hello everybody
I'm trying to show in a WebView a video from url, it is streaming and this is an example of the Url:
https://rapidresponse-us-oem-relay11.mios.com/relay/relay/relay/device/36050280/session/0144E086FE4180BB14CFA858AE7FE05757ED73/port_3480/data_request?id=serve_stream&cam=12&stream=29&res=low
I already did the IOS application and it works fine, so I know that the url don't have any problem.
I'm trying to show the video in the WebView with the following code:
if(message.getMessageType() == 0) {
webView_camera.getSettings().setDomStorageEnabled(true);
webView_camera.loadUrl(cameraUrl);
}
I tried to use this
webView_camera.setWebChromeClient(new WebChromeClient());
But it doesn't work either
When the application run only show int the webview the icon of failure to load an image.
I'm pretty new with this so any help will be appreciated it
UPDATE
This is the Logs that I get from android:
11-11 09:32:25.268 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/WebViewFactory: Loading com.google.android.webview version 46.0.2490.76 (code 249007600)
11-11 09:32:25.294 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/cr.library_loader: Time to load native libraries: 2 ms (timestamps 2963-2965)
11-11 09:32:25.294 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/cr.library_loader: Expected native library version number "46.0.2490.76", actual native library version number "46.0.2490.76"
11-11 09:32:25.306 8316-8316/com.realstatediary.jperera.rapidsentrymaster V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {b23e619}
11-11 09:32:25.307 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/cr.library_loader: Expected native library version number "46.0.2490.76", actual native library version number "46.0.2490.76"
11-11 09:32:25.309 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/chromium: [INFO:library_loader_hooks.cc(118)] Chromium logging enabled: level = 0, default verbosity = 0
11-11 09:32:25.329 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/cr.BrowserStartup: Initializing chromium process, singleProcess=true
11-11 09:32:25.336 8316-8316/com.realstatediary.jperera.rapidsentrymaster E/SysUtils: ApplicationContext is null in ApplicationStatus
11-11 09:32:25.417 8316-8316/com.realstatediary.jperera.rapidsentrymaster E/chromium: [ERROR:browser_gpu_channel_host_factory.cc(258)] Failed to init browser shader disk cache.
11-11 09:32:25.445 8316-8316/com.realstatediary.jperera.rapidsentrymaster E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
11-11 09:32:25.449 8316-8774/com.realstatediary.jperera.rapidsentrymaster W/cr.media: Requires BLUETOOTH permission
11-11 09:32:25.471 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
11-11 09:32:25.472 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
11-11 09:32:25.526 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
11-11 09:32:25.526 8316-8316/com.realstatediary.jperera.rapidsentrymaster I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
11-11 09:32:25.554 8316-8316/com.realstatediary.jperera.rapidsentrymaster W/art: Attempt to remove local handle scope entry from IRT, ignoring
11-11 09:32:25.562 8316-8316/com.realstatediary.jperera.rapidsentrymaster W/AwContents: onDetachedFromWindow called when already detached. Ignoring
11-11 09:32:30.958 8316-8316/com.realstatediary.jperera.rapidsentrymaster W/cr.BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 8316
11-11 09:33:18.836 8316-8398/com.realstatediary.jperera.rapidsentrymaster D/PULLBACK: Executing background pull from server
I finally did!
This the solution:
if(message.getMessageType() == 0) {
StringBuilder html = new StringBuilder();
html.append("<html>");
html.append("<head>");
html.append("</head>");
html.append("<body>");
html.append("<div id ='main'><img class=\"video_player_frame\"src=\""+cameraUrl+" style=\"top: 0px; border: none; width: 100%; height: 100%;\"></div>");
html.append("</body>");
html.append("</html>");
webView_camera.loadData(html.toString(),"text/html", "UTF-8");
}

Categories

Resources