After loading webarchiev into WebView app crashes - android

After trying to load WebArchievs for some sites I get this error.
06-12 11:03:36.604 6257-6257/<packageName> D/﹕ Page started file:///data/data/<packageName>/files/savedData3.mht
06-12 11:03:36.644 6257-6281/<packageName> V/RenderScript﹕ Application requested CPU execution
06-12 11:03:36.649 6257-6281/<packageName> V/RenderScript﹕ 0xb8ec6f88 Launching thread(s), CPUs 2
06-12 11:03:36.662 6257-6332/<packageName> E/chromium﹕ ### WebView Version 43.0.2357.121 (code 2357121)
06-12 11:03:36.662 6257-6332/<packageName> A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 6332 (Thread-36203)
Saving WebArchiev:
getWebView().saveWebArchive(<pathToFile>);
Loading WebArchiv:
getWebView().loadUrl(<pathToFile>);

Related

Why Android Volley library is unable to connect asp.net web api?

I am trying to call asp.net web api from Android Client using Volley library. The .net API is working fine and listening ports are:
http://localhost:5000 and https://localhost:5001 in my local machine.
But,When, I try to run android client keeping the base url as http://10.0.2.2:5000/api/login
I found below error in console->
04/23 23:13:41: Launching 'app' on Nexus 6 API 24.
Install successfully finished in 9 s 435 ms.
$ adb shell am start -n "com.example.tourexpwip/com.example.tourexpwip.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3662 on device 'Nexus_6_API_24 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/art: Late-enabling -Xcheck:jni
W/art: Unexpected CPU variant for X86 using defaults: x86
W/System: ClassLoader referenced unknown path: /data/app/com.example.tourexpwip-1/lib/x86
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.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
I/System.out: URL: http://10.0.2.2:5000/api/login/
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/: HostConnection::get() New Host Connection established 0xa67ec7c0, tid 3662
E/Volley: [210] NetworkUtility.shouldRetryException: Unexpected response code 307 for http://10.0.2.2:5000/api/login/
D/: HostConnection::get() New Host Connection established 0xa67ecac0, tid 3683
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xb5c05660: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xb5c05660: ver 2 0 (tinfo 0xb5c032b0)
W/System.err: com.android.volley.ServerError
at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:201)
W/System.err: at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)
W/System.err: at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
I/Choreographer: Skipped 68 frames! The application may be doing too much work on its main thread.
D/EGL_emulation: eglMakeCurrent: 0xb5c05660: ver 2 0 (tinfo 0xb5c032b0)
I/Choreographer: Skipped 35 frames! The application may be doing too much work on its main thread.
The controller class for login in ASP.NET web api->
namespace TourExpWIP1.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class LoginController : ControllerBase
{
NetCoreAuthenticationContext dbContext = new NetCoreAuthenticationContext();
public string Post([FromBody] TblUser value)
{
if (dbContext.TblUser.Any(user => user.UserName.Equals(value.UserName)))
{
TblUser user = dbContext.TblUser.Where(u => u.UserName.Equals(value.UserName)).First();
var client_post_hash_password = Convert.ToBase64String(
Common.SaltHashPassword(
Encoding.ASCII.GetBytes(value.Password),
Convert.FromBase64String(user.Salt)));
if (client_post_hash_password.Equals(user.Password))
return JsonConvert.SerializeObject(user);
else return JsonConvert.SerializeObject("Wrong Password");
}
else
{
return JsonConvert.SerializeObject("user does not exists in db");
}
}
}
}
Try this
1.In Android Manifiest, in tag application add:
inside tag application add this tag:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<application
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
...
/>
2.With a corresponding network_security_config.xml in app/src/main/res/xml/:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
More details please find from here- Link

google photos crashing when selecting from image chooser

When choosing google photos from image chooser it is opening but immediately it is crashing. it is happening only in lenovo k8.
i tried to find why it is crashing but failed.
here is the crash report what i'm getting
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 11675 (RenderThread)
I/crash_dump64: obtaining output fd from tombstoned
I//system/bin/tombstoned: received crash request for pid 11588
I/crash_dump64: performing dump of process 11588 (target tid = 11675)
A/DEBUG: Build fingerprint: 'lenovo/manning_retail/manning:8.0.0/OMB27.43-67/73:user/release-keys'
A/DEBUG: ABI: 'arm64'
A/DEBUG: pid: 11588, tid: 11675, name: RenderThread >>> com.google.android.apps.photos <<<
A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
A/DEBUG: Cause: null pointer dereference
E/libPerfService: Could not open '/proc/driver/thermal/ta_fg_pid'
E/libPerfService: error : 2, No such file or directory
E/ActivityManager: Found activity ActivityRecord{5561e27 u0 com.google.android.apps.photos/.picker.external.ExternalPickerActivity t-1 f} in proc activity list using null instead of expected ProcessRecord{abb7d68 11588:com.google.android.apps.photos/u0a104}
I/BufferQueueConsumer: [ActionableToast:825225c#0](this:0x7072ba1000,id:5379,api:1,p:11588,c:-1) disconnect(C)
E/lowmemorykiller: Error writing /proc/11588/oom_score_adj; errno=22
I/BufferQueueConsumer: [com.google.android.apps.photos/com.google.android.apps.photos.picker.external.ExternalPickerActivity#0](this:0x7072a60800,id:5378,api:1,p:11588,c:-1) disconnect(C)
V/WindowManager: findFocusedWindow: No focusable windows.
E/ProfileFrag: onActivityResult requestCode 100
E/ProfileFrag: onActivityResult resultCode 0
E/ProfileFrag: onActivityResult data null
D/ProcSpeedReader: Failed to read freq stats from null
I/ActivityManager: Killing 11588:com.google.android.apps.photos/u0a104 (adj 199): crash
please help me to solve this
Thanks in advance

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

How to make a post request to a rails app using android and retrofit

I have setup rails api using the scaffold generator. so my controller looks like this
Rails PostsController
class PostsController < ApplicationController
before_action :set_post, only: [:show, :update, :destroy]
def index
#posts = Post.all
render json: #posts
end
def show
render json: #post
end
def create
#post = Post.new(post_params)
if #post.save
render json: #post, status: :created, location: #post
else
render json: #post.errors, status: :unprocessable_entity
end
end
def update
if #post.update(post_params)
render json: #post
else
render json: #post.errors, status: :unprocessable_entity
end
end
def destroy
#post.destroy
end
private
def set_post
#post = Post.find(params[:id])
end
def post_params
params.require(:post).permit(:title, :body, :userId)
end
end
running this curl command
curl -i -X POST -H "Content-Type:application/json" www.example.com/posts/ -d '{"title":"foo", "body":"bar"}'
{"id":4,"title":"foo","body":"bar","created_at":"2017-06-12T19:11:26.752Z","updated_at":"2017-06-12T19:11:26.752Z"}
I then setup the android app following this tutorial Sending Data With Retrofit 2 HTTP Client for Android
running the app using the link on the tutorial works.when I replace it with my rails app url I get the following
06-12 21:44:01.352 31991-31991/? I/zygote: Not late-enabling -Xcheck:jni (already on)
06-12 21:44:01.365 31991-31991/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
06-12 21:44:01.403 31991-31999/? E/zygote: Failed writing handshake bytes (-1 of 14): Broken pipe
06-12 21:44:01.403 31991-31999/? I/zygote: Debugger is no longer active
06-12 21:44:01.494 31991-31991/? I/InstantRun: starting instant run server: is main process
06-12 21:44:01.600 31991-31991/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
06-12 21:44:01.614 31991-32018/? D/OpenGLRenderer: HWUI GL Pipeline
[ 06-12 21:44:01.635 31991:32018 D/ ]
HostConnection::get() New Host Connection established 0xa95e4f00, tid 32018
06-12 21:44:01.637 31991-32018/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-12 21:44:01.637 31991-32018/? D/OpenGLRenderer: Swap behavior 1
06-12 21:44:01.637 31991-32018/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
06-12 21:44:01.637 31991-32018/? D/OpenGLRenderer: Swap behavior 0
06-12 21:44:01.640 31991-32018/? D/EGL_emulation: eglCreateContext: 0xa718b220: maj 2 min 0 rcv 2
06-12 21:44:01.655 31991-32018/? D/EGL_emulation: eglMakeCurrent: 0xa718b220: ver 2 0 (tinfo 0xa95ccb10)
06-12 21:44:01.668 31991-32018/? W/android.hardware.graphics.mapper#2.0::Mapper: getService: found null hwbinder interface
06-12 21:44:01.672 31991-32018/? I/vndksupport: sphal namespace is not configured for this process. Loading /system/lib/hw/gralloc.ranchu.so from the current namespace instead.
06-12 21:44:01.707 31991-32018/? D/EGL_emulation: eglMakeCurrent: 0xa718b220: ver 2 0 (tinfo 0xa95ccb10)
and submitting the form give me
06-12 21:46:52.742 31991-31997/com.kainet.retropost I/zygote: Do partial code cache collection, code=122KB, data=90KB
06-12 21:46:52.743 31991-31997/com.kainet.retropost I/zygote: After code cache collection, code=122KB, data=90KB
06-12 21:46:52.743 31991-31997/com.kainet.retropost I/zygote: Increasing code cache capacity to 512KB
How can I fix this?
I replaced the base_url from
public static final String BASE_URL = "http://www.example.com/api/v1";
to
public static final String BASE_URL = "http://www.example.com/";
and the interface from
public interface APIService {
#POST("/posts")
#FormUrlEncoded
Call<Imei> sendPost(#Field("title") String title);
}
to
public interface APIService {
#POST("/api/v1/posts")
#FormUrlEncoded
Call<Imei> sendPost(#Field("title") String title);
}

Vitamio crashes on Android 6.0

We are using Vitamio in our project as a MediaPlayer. When we change target SDK to API level 23 it crashes.
Logcat is as follows:
10-10 22:12:04.858: E/Vitamio[4.2.1]Player: LOAD FFMPEG ERROR: dlopen failed: /data/data/com.project/libs/libffmpeg.so: has text relocations
10-10 22:12:04.864: E/Vitamio[4.2.1]Player: FIND_NAME_SYM vvo, render_yuv
10-10 22:12:04.869: A/libc(9372): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 9372
There is an issue about this problem in Vitamio's github page : https://github.com/yixia/VitamioBundle/issues/312
Is there any workaround for this problem?

Categories

Resources