I cannot run Tensorflow model in Android - Fatal 6 SIGABRT - android

I trained a tensorflow model (fully convolutional network for pixel-by-pixel image segmentation). I am trying to run it in Android studio but it always crashes. I couldn't find any solution of the issue on Stackoverflow or TF git repo.
This is what I get in Logcat:
10-06 15:38:28.613 8273-8291/? I/TensorFlowInferenceInterface: Checking to see if TensorFlow native methods are already loaded
10-06 15:38:28.614 8273-8291/? E/art: No implementation found for long org.tensorflow.contrib.android.RunStats.allocate() (tried Java_org_tensorflow_contrib_android_RunStats_allocate and Java_org_tensorflow_contrib_android_RunStats_allocate__)
10-06 15:38:28.614 8273-8291/? I/TensorFlowInferenceInterface: TensorFlow native methods not found, attempting to load via tensorflow_inference
10-06 15:38:28.627 8273-8291/? W/native: cpu_feature_guard.cc:33 The TensorFlow library was compiled to use SSE instructions, but these aren't available on your machine.
10-06 15:38:28.627 8273-8291/? W/native: cpu_feature_guard.cc:33 The TensorFlow library was compiled to use SSE2 instructions, but these aren't available on your machine.
10-06 15:38:28.627 8273-8291/? W/native: cpu_feature_guard.cc:33 The TensorFlow library was compiled to use SSE3 instructions, but these aren't available on your machine.
10-06 15:38:28.630 8273-8291/? I/TensorFlowInferenceInterface: Successfully loaded TensorFlow native methods (RunStats error may be ignored)
10-06 15:38:28.670 8273-8291/? I/TensorFlowInferenceInterface: Model load took 12ms, TensorFlow version: 1.2.0
10-06 15:38:28.670 8273-8291/? I/TensorFlowInferenceInterface: Successfully loaded model from 'dummy_segmentation_model.pb'
[ 10-06 15:38:28.715 8273: 8292 D/ ]
HostConnection::get() New Host Connection established 0x88320100, tid 8292
10-06 15:38:28.716 8273-8292/? I/OpenGLRenderer: Initialized EGL, version 1.4
10-06 15:38:28.716 8273-8292/? D/OpenGLRenderer: Swap behavior 1
10-06 15:38:28.716 8273-8292/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
10-06 15:38:28.716 8273-8292/? D/OpenGLRenderer: Swap behavior 0
10-06 15:38:28.720 8273-8292/? D/EGL_emulation: eglCreateContext: 0xa85850c0: maj 3 min 1 rcv 4
10-06 15:38:28.814 8273-8292/? D/EGL_emulation: eglMakeCurrent: 0xa85850c0: ver 3 1 (tinfo 0xa8583210)
10-06 15:38:28.815 8273-8292/? E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
10-06 15:38:28.815 8273-8292/? E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
10-06 15:38:28.815 8273-8292/? E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
10-06 15:38:28.858 8273-8292/? D/EGL_emulation: eglMakeCurrent: 0xa85850c0: ver 3 1 (tinfo 0xa8583210)
10-06 15:38:31.349 8273-8292/com.cognexa.showimage D/EGL_emulation: eglMakeCurrent: 0xa85850c0: ver 3 1 (tinfo 0xa8583210)
10-06 15:38:31.360 8273-8292/com.cognexa.showimage D/OpenGLRenderer: endAllActiveAnimators on 0x9ae1f780 (RippleDrawable) with handle 0x892d4200
10-06 15:38:34.727 8273-8292/com.cognexa.showimage D/EGL_emulation: eglMakeCurrent: 0xa85850c0: ver 3 1 (tinfo 0xa8583210)
10-06 15:38:38.684 8273-8273/com.cognexa.showimage A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 8273 (gnexa.showimage)
[ 10-06 15:38:38.684 1295: 1295 W/ ]
debuggerd: handling request: pid=8273 uid=10080 gid=10080 tid=8273
This is the important part of Android code, where I feed the image of size 600x600 to tensorflow model and where it crashes:
Bitmap.Config conf = Bitmap.Config.ARGB_8888;
Mat mat = new Mat();
Bitmap bmp32 = image_bitmap.copy(conf, true);
Utils.bitmapToMat(bmp32, mat);
Mat mat_resized = new Mat();
Size size = new Size(600, 600);
Imgproc.resize(mat, mat_resized, size);
Bitmap bmp_resized = Bitmap.createBitmap(600, 600, conf);
Utils.matToBitmap(mat_resized, bmp_resized);
int w = bmp_resized.getWidth();
int h = bmp_resized.getHeight();
bmp_resized.getPixels(intValues, 0, w, 0, 0, w, h);
int lenint = intValues.length;
for (int i = 0; i < intValues.length; ++i) {
final int val = intValues[i];
floatValues[i * 3 + 0] = (((val >> 16) & 0xFF) - imageMean) / imageStd;
floatValues[i * 3 + 1] = (((val >> 8) & 0xFF) - imageMean) / imageStd;
floatValues[i * 3 + 2] = ((val & 0xFF) - imageMean) / imageStd;
}
// Copy the input data into TensorFlow.
Trace.beginSection("feed");
tfHelper.feed(inputName, floatValues, 1, 600, 600, 3);
Trace.endSection();
// Run the inference call.
Trace.beginSection("run");
tfHelper.run(outputNames, logStats);
Trace.endSection();
where tfHelper is an instance of org.tensorflow.contrib.android.TensorFlowInferenceInterface.
If I comment last 3 lines, the app doesn't crash.
I think it isn't a memory issue, as I tried it also with a small version of the model (which is only ~50kB ).
Thanks!

Related

react-native logcat Why keep showing: D/EGL_adreno: eglMakeCurrent?

I don't know what this log means.
After this log appears, the application becomes very slow. (UI FPS < 40 )
may I know what is the reason?
04-21 23:43:21.306 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:21.317 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:21.856 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:21.867 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:22.404 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:22.412 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:22.957 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
04-21 23:43:22.965 15554-15570/***.***.*** D/EGL_adreno: eglMakeCurrent: 0xaf434ac0: ver 3 1 (tinfo 0xaf4394a0)
In the mobile application internally, the open gl library handles draw your UI content. You can safely ignore these logs

Multiple Linkify patterns - App not responding Android

I am trying to linkify my textview. The text is loaded from the database and linkify is called.
Linkify.addLinks(text, Linkify.WEB_URLS);
Pattern phone = Pattern.compile("\\+?\\d[\\d -]{8,12}\\d");
Linkify.addLinks(text,phone, "tel:");
Pattern email = Pattern.compile("[a-zA-Z0-9._-]+#[a-z]+\\.+[a-z]+\\.*[a-z]*");
Linkify.addLinks(text,email, "mailto:");
I have tried like this.
Linkify.addLinks(text, Linkify.WEB_URLS);
But this actually have the scheme "http" or "https". So when I click a link like http://something.com/file.pdf , the url is not correcly matched and the pdf is not displayed.
So I tried pattern for web also.
Pattern phone = Pattern.compile("\\+?\\d[\\d -]{8,12}\\d");
Linkify.addLinks(text,phone, "tel:");
Pattern email = Pattern.compile("[a-zA-Z0-9._-]+#[a-z]+\\.+[a-z]+\\.*[a-z]*");
Linkify.addLinks(text,email, "mailto:");
Pattern web = Pattern.compile("^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$");
Linkify.addLinks(text, web,"");
But when I tried this code, the activity is not loaded and the app terminates as not responding. Logcat doesn't show anything about what happens. So I don't know why the error occur. Do anyone has the idea why this happen and how to solve this?
The log is here:
03-30 07:28:51.839 28870-28875/com.example.application I/zygote: Do full code cache collection, code=103KB, data=58KB
03-30 07:28:51.841 28870-28875/com.example.application I/zygote: After code cache collection, code=99KB, data=50KB
03-30 07:28:52.074 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:53.163 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:54.646 28870-28875/com.example.application I/zygote: Do partial code cache collection, code=118KB, data=79KB
03-30 07:28:54.647 28870-28875/com.example.application I/zygote: After code cache collection, code=118KB, data=79KB
Increasing code cache capacity to 512KB
03-30 07:28:54.651 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:54.739 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:54.755 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:55.523 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:56.039 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:57.658 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:57.938 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:59.678 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:28:59.951 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:00.717 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:01.017 28870-28875/com.example.application I/zygote: Do full code cache collection, code=247KB, data=175KB
03-30 07:29:01.019 28870-28875/com.example.application I/zygote: After code cache collection, code=244KB, data=139KB
03-30 07:29:01.441 28870-28881/com.example.application I/zygote: NativeAllocBackground concurrent copying GC freed 2967(269KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 1867KB/3MB, paused 934us total 273.344ms
03-30 07:29:01.724 28870-28881/com.example.application I/zygote: NativeAllocBackground concurrent copying GC freed 4946(323KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 1592KB/3MB, paused 1.114ms total 154.884ms
03-30 07:29:01.883 28870-28870/com.example.application I/Choreographer: Skipped 44 frames! The application may be doing too much work on its main thread.
03-30 07:29:01.910 28870-28875/com.example.application I/zygote: Do partial code cache collection, code=245KB, data=148KB
03-30 07:29:01.911 28870-28875/com.example.application I/zygote: After code cache collection, code=245KB, data=148KB
Increasing code cache capacity to 1024KB
03-30 07:29:01.928 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:02.125 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:02.145 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:03.070 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:03.994 28870-28875/com.example.application I/zygote: JIT allocated 56KB for compiled code of void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
03-30 07:29:04.124 28870-28890/com.example.application D/EGL_emulation: eglMakeCurrent: 0x990fc120: ver 2 0 (tinfo 0xa517c0a0)
03-30 07:29:06.973 28870-28881/com.example.application I/zygote: NativeAllocBackground concurrent copying GC freed 1952(196KB) AllocSpace objects, 0(0B) LOS objects, 50% free, 1785KB/3MB, paused 647us total 112.103ms

ClassLoader referenced unknown path /data/app/.../1/lib/arm64

I am concerned what the System warning in my android app means.
ch.ethz.inf.vs.a4.minker.einz W/System: ClassLoader referenced unknown path: /data/app/ch.ethz.inf.vs.a4.minker.einz-1/lib/arm64
This warning comes up when I run the app and then don't do anything - just displaying the main Activity. The app does not crash, but I'd like to know why these warnings are showing up.
This is the complete logcat when I run the application on my Sony Xperia device, but the Emulator creates similar logs.
11-25 17:02:48.261 27908-27908/ch.ethz.inf.vs.a4.minker.einz I/art: Late-
enabling -Xcheck:jni
11-25 17:02:48.295 27908-27908/ch.ethz.inf.vs.a4.minker.einz W/System: ClassLoader referenced unknown path: /data/app/ch.ethz.inf.vs.a4.minker.einz-1/lib/arm64
11-25 17:02:48.319 27908-27908/ch.ethz.inf.vs.a4.minker.einz 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
11-25 17:02:48.400 27908-27936/ch.ethz.inf.vs.a4.minker.einz I/Adreno: QUALCOMM build : ce5aeb9, I750f7f2fa6
Build Date : 03/24/17
OpenGL ES Shader Compiler Version: XE031.09.00.03
Local Branch :
Remote Branch : quic/LA.BF64.1.2.3_rb1.11
Remote Branch : NONE
Reconstruct Branch : NOTHING
11-25 17:02:48.405 27908-27936/ch.ethz.inf.vs.a4.minker.einz I/OpenGLRenderer: Initialized EGL, version 1.4
11-25 17:02:48.406 27908-27936/ch.ethz.inf.vs.a4.minker.einz D/OpenGLRenderer: Swap behavior 1
11-25 17:02:48.435 27908-27908/ch.ethz.inf.vs.a4.minker.einz I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#d84f7af time:215890379
Log on Emulator (Nexus 5 API 23 (Android 6.0, API23))
11-25 16:18:02.052 16216-16216/? I/art: Not late-enabling -Xcheck:jni (already on)
11-25 16:18:02.092 16216-16216/ch.ethz.inf.vs.a4.minker.einz W/System: ClassLoader referenced unknown path: /data/app/ch.ethz.inf.vs.a4.minker.einz-1/lib/x86
11-25 16:18:02.105 16216-16216/ch.ethz.inf.vs.a4.minker.einz 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
11-25 16:18:02.141 16216-16241/ch.ethz.inf.vs.a4.minker.einz D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 11-25 16:18:02.153 16216:16216 D/ ]
HostConnection::get() New Host Connection established 0xab1a4140, tid 16216
11-25 16:18:02.227 16216-16241/ch.ethz.inf.vs.a4.minker.einz I/OpenGLRenderer: Initialized EGL, version 1.4
11-25 16:18:02.227 16216-16241/ch.ethz.inf.vs.a4.minker.einz W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
11-25 16:18:02.285 16216-16241/ch.ethz.inf.vs.a4.minker.einz D/EGL_emulation: eglCreateContext: 0xaee144e0: maj 3 min 1 rcv 4
11-25 16:18:02.298 16216-16241/ch.ethz.inf.vs.a4.minker.einz D/EGL_emulation: eglMakeCurrent: 0xaee144e0: ver 3 1 (tinfo 0xaee126f0)
11-25 16:18:02.299 16216-16241/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
11-25 16:18:02.299 16216-16241/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
11-25 16:18:02.299 16216-16241/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
11-25 16:18:02.370 16216-16241/ch.ethz.inf.vs.a4.minker.einz D/EGL_emulation: eglMakeCurrent: 0xaee144e0: ver 3 1 (tinfo 0xaee126f0)
Log on Emulator Nexus 5X API 26 x86 (Android 8.0.0, API 26)
11-25 16:19:22.549 6786-6786/? I/zygote: Not late-enabling -Xcheck:jni (already on)
11-25 16:19:22.560 6786-6786/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
11-25 16:19:22.730 6786-6804/ch.ethz.inf.vs.a4.minker.einz D/OpenGLRenderer: HWUI GL Pipeline
11-25 16:19:22.773 6786-6804/ch.ethz.inf.vs.a4.minker.einz I/OpenGLRenderer: Initialized EGL, version 1.4
11-25 16:19:22.773 6786-6804/ch.ethz.inf.vs.a4.minker.einz D/OpenGLRenderer: Swap behavior 1
11-25 16:19:22.773 6786-6804/ch.ethz.inf.vs.a4.minker.einz W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
11-25 16:19:22.773 6786-6804/ch.ethz.inf.vs.a4.minker.einz D/OpenGLRenderer: Swap behavior 0
11-25 16:19:22.783 6786-6804/ch.ethz.inf.vs.a4.minker.einz D/EGL_emulation: eglCreateContext: 0x989fda40: maj 3 min 1 rcv 4
11-25 16:19:22.811 6786-6804/ch.ethz.inf.vs.a4.minker.einz D/EGL_emulation: eglMakeCurrent: 0x989fda40: ver 3 1 (tinfo 0xa4a8b850)
11-25 16:19:22.812 6786-6804/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
11-25 16:19:22.812 6786-6804/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
11-25 16:19:22.812 6786-6804/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
11-25 16:19:22.812 6786-6804/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
11-25 16:19:22.812 6786-6804/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
11-25 16:19:22.812 6786-6804/ch.ethz.inf.vs.a4.minker.einz E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
11-25 16:19:22.884 6786-6804/ch.ethz.inf.vs.a4.minker.einz D/EGL_emulation: eglMakeCurrent: 0x989fda40: ver 3 1 (tinfo 0xa4a8b850)
This answer mentioned disabling instantRun, which I have already done because of my version of IntelliJ not supporting the latest version of gradle yet (last time I checked with support). It also mentions WiFi, but that doesn't seem to make a difference.
This answer mentions clearing app cache and data, but this also does not make a difference.
It might be worth mentioning that the first time I run the app, IntelliJ shows the following error in the logcat. This happens both on the emulator and my real device. With "the first time", I mean that it does not show the error when I click run again and select "restart app". This behaviour is not 100% consistent though.
11-25 16:14:41.358 14185-14185/? I/art: Not late-enabling -Xcheck:jni (already on)
11-25 16:14:41.371 14185-14189/? E/art: Failed sending reply to debugger: Broken pipe
11-25 16:14:41.371 14185-14189/? I/art: Debugger is no longer active
11-25 16:14:41.403 14185-14185/? W/System: ClassLoader referenced unknown path: /data/app/ch.ethz.inf.vs.a4.minker.einz-2/lib/x86
What could be reasons for these warnings? I am afraid that if I ignore them, I will at some point spend days debugging only to find out that these warnings would have told me.
you need to set the flag of intent.
Intent intent = new Intent(context,Route.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);

AdView Causing Chrome Crash?

I have an adview in one of my activitites. When I go to this activity, I get a dialog on the emulator telling me Chrome has stopped and the ad doesn't show anything.
I've checked over the code itself and I'm fairly sure it matches what it should -
Activity.xml
<com.google.android.gms.ads.AdView
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="#string/banner_ad_unit_id"></com.google.android.gms.ads.AdView>
Activity.java
mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
Here is the logcat -
09-08 09:26:47.779 5777-5777/? D/EGL_emulation: eglCreateContext: 0x872ca5e0: maj 2 min 0 rcv 2
09-08 09:26:47.783 5777-5777/? D/EGL_emulation: eglMakeCurrent: 0x872ca5e0: ver 2 0 (tinfo 0x8379e7b0)
09-08 09:26:47.784 5892-5892/? E/asset: setgid: Operation not permitted
09-08 09:26:47.795 5878-5878/? W/ResourceType: Entry identifier 0xc is larger than entry count 0x8
09-08 09:26:47.795 5878-5878/? D/AndroidRuntime: Shutting down VM
09-08 09:26:47.795 5878-5878/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.chrome:sandboxed_process0, PID: 5878
android.content.res.Resources$NotFoundException: Array resource ID #0x7f03000c
at android.content.res.Resources.obtainTypedArray(Resources.java:617)
at android.content.res.Resources.preloadFonts(Resources.java:379)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5815)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:121)
09-08 09:26:47.799 1584-1600/? I/ActivityManager: Showing crash dialog for package com.androidandyuk.autobuddy u0
09-08 09:26:47.825 1357-1357/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
09-08 09:26:47.826 1584-2280/? I/OpenGLRenderer: Initialized EGL, version 1.4
09-08 09:26:47.826 1584-2280/? D/OpenGLRenderer: Swap behavior 1
09-08 09:26:47.826 1584-2280/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
09-08 09:26:47.826 1584-2280/? D/OpenGLRenderer: Swap behavior 0
09-08 09:26:47.842 1357-1357/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
09-08 09:26:47.842 1584-2280/? D/EGL_emulation: eglCreateContext: 0xa44a4be0: maj 2 min 0 rcv 2
09-08 09:26:47.848 1357-1357/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
09-08 09:26:47.849 1584-2280/? D/EGL_emulation: eglMakeCurrent: 0xa44a4be0: ver 2 0 (tinfo
On my Pixel XL, it doesn't crash, but no ad is shown, so I guess something isn't right?
We had the same crash in our app. A temporary solution was to disable the use of the preloaded_fonts tag in AndroidManifest.xml.
There appears to be a bug in Android 8.0 Oreo at present as this does not happen in earlier API's.

Androis studio - APP aborting shortly after starting [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 5 years ago.
I just finished a project in android studio and I have a problem here. When generating the application and installing on the smartphone (android nougat 7.1.1 oneplus3) it simply aborts. In the emulator it gives the message that the application stops and aborts. I need the help of you more experienced. I'm a beginner. Here's the LOGCAT lines below when you try to open the application:
08-16 13:51:44.610 13313-13313/agdesenvolvimentoweb.projetopiloto I/art: Not late-enabling -Xcheck:jni (already on)
08-16 13:51:44.610 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Unexpected CPU variant for X86 using defaults: x86_64
08-16 13:51:45.249 13313-13313/agdesenvolvimentoweb.projetopiloto W/System: ClassLoader referenced unknown path: /data/app/agdesenvolvimentoweb.projetopiloto-1/lib/x86_64
08-16 13:51:45.281 13313-13313/agdesenvolvimentoweb.projetopiloto I/InstantRun: starting instant run server: is main process
08-16 13:51:45.576 13313-13313/agdesenvolvimentoweb.projetopiloto 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
08-16 13:51:45.647 13313-13313/agdesenvolvimentoweb.projetopiloto W/System: ClassLoader referenced unknown path: /system/app/Chrome/lib/x86_64
08-16 13:51:45.648 13313-13313/agdesenvolvimentoweb.projetopiloto D/ApplicationLoaders: ignored Vulkan layer search path /system/app/Chrome/lib/x86_64:/system/app/Chrome/Chrome.apk!/lib/x86_64:/system/lib64:/vendor/lib64 for namespace 0x7fcbeb8400f0
08-16 13:51:45.650 13313-13313/agdesenvolvimentoweb.projetopiloto I/WebViewFactory: Loading com.android.chrome version 55.0.2883.91 (code 288309162)
08-16 13:51:45.670 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 9774-9776)
08-16 13:51:45.670 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
08-16 13:51:45.678 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
08-16 13:51:45.678 13313-13313/agdesenvolvimentoweb.projetopiloto I/chromium: [INFO:library_loader_hooks.cc(163)] Chromium logging enabled: level = 0, default verbosity = 0
08-16 13:51:45.683 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
[ 08-16 13:51:45.692 13313:13313 D/ ]
HostConnection::get() New Host Connection established 0x7fcbd18d6000, tid 13313
[ 08-16 13:51:45.694 13313:13313 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
08-16 13:51:45.696 13313-13313/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbde5c12a0: maj 2 min 0 rcv 2
08-16 13:51:45.697 13313-13313/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbde5c12a0: ver 2 0 (tinfo 0x7fcbd18f1c20)
08-16 13:51:45.798 13313-13359/agdesenvolvimentoweb.projetopiloto W/cr_media: Requires BLUETOOTH permission
08-16 13:51:45.807 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_Ime: ImeThread is enabled.
08-16 13:51:45.885 13313-13368/agdesenvolvimentoweb.projetopiloto I/OpenGLRenderer: Initialized EGL, version 1.4
08-16 13:51:45.885 13313-13368/agdesenvolvimentoweb.projetopiloto D/OpenGLRenderer: Swap behavior 1
[ 08-16 13:51:45.885 13313:13368 D/ ]
HostConnection::get() New Host Connection established 0x7fcbcdea13c0, tid 13368
[ 08-16 13:51:45.888 13313:13368 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
08-16 13:51:45.892 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf532c0: maj 2 min 0 rcv 2
08-16 13:51:45.904 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf532c0: ver 2 0 (tinfo 0x7fcbcdfb3920)
08-16 13:51:45.979 13313-13374/agdesenvolvimentoweb.projetopiloto E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
[ 08-16 13:51:45.980 13313:13374 D/ ]
HostConnection::get() New Host Connection established 0x7fcbcd52f2e0, tid 13374
[ 08-16 13:51:45.982 13313:13374 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
08-16 13:51:45.995 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf55ca0: maj 2 min 0 rcv 2
08-16 13:51:45.998 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf55ca0: ver 2 0 (tinfo 0x7fcbcd54d900)
08-16 13:51:46.018 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
08-16 13:51:46.050 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Attempt to remove non-JNI local reference, dumping thread
08-16 13:51:46.054 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf532c0: ver 2 0 (tinfo 0x7fcbcdfb3920)
08-16 13:51:46.067 13313-13374/agdesenvolvimentoweb.projetopiloto I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
08-16 13:51:46.088 13313-13324/agdesenvolvimentoweb.projetopiloto W/art: Suspending all threads took: 12.371ms
08-16 13:51:46.167 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf569c0: maj 2 min 0 rcv 2
08-16 13:51:46.169 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf569c0: ver 2 0 (tinfo 0x7fcbcd54d900)
08-16 13:51:46.175 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-16 13:51:46.180 13313-13374/agdesenvolvimentoweb.projetopiloto E/libEGL: called unimplemented OpenGL ES API
08-16 13:51:46.707 13313-13313/agdesenvolvimentoweb.projetopiloto W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13313
08-16 13:51:46.709 13313-13313/agdesenvolvimentoweb.projetopiloto I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
08-16 13:51:46.716 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Attempt to remove non-JNI local reference, dumping thread
08-16 13:51:46.752 13313-13313/agdesenvolvimentoweb.projetopiloto E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
08-16 13:51:46.753 13313-13313/agdesenvolvimentoweb.projetopiloto D/AndroidRuntime: Shutting down VM
--------- beginning of crash
08-16 13:51:46.753 13313-13313/agdesenvolvimentoweb.projetopiloto E/AndroidRuntime: FATAL EXCEPTION: main
Process: agdesenvolvimentoweb.projetopiloto, PID: 13313
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ProgressDialog.dismiss()' on a null object reference
at agdesenvolvimentoweb.projetopiloto.MainActivity$MyWebViewClient.onPageFinished(MainActivity.java:161)
at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:545)
at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:201)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Your setting dismiss() on your progress bar somewhere in your code with out having initialised it.
do
if(progress!= null)
progress.dismiss()
First, put only your application's log.
Second, you are trying to dismiss a progress dialog when its not initialized.
java.lang.NullPointerException: Attempt to invoke virtual
method 'void android.app.ProgressDialog.dismiss()' on a null object reference
I'd start my inspections with MainActivity.java:161

Categories

Resources