I am trying to post data from my android device to server through HTTPS Url, I am getting this error
java.io.FileNotFoundException:https://URL
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:186)
at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:246)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Can anyone help me?
Related
I am getting a strange error in android 4.4, this seems to be in webview, anybody have any idea to fix the bug, since the crash looks native, and i am not able figure out which class has the crash, so that i can handle the exception
java.lang.NullPointerException
at com.android.org.chromium.content.browser.ResourceExtractor.getOutputDirFromContext(ResourceExtractor.java:307)
at com.android.org.chromium.content.browser.ResourceExtractor.<init>(ResourceExtractor.java:266)
at com.android.org.chromium.content.browser.ResourceExtractor.get(ResourceExtractor.java:232)
at com.android.org.chromium.content.browser.BrowserStartupController.prepareToStartBrowserProcess(BrowserStartupController.java:266)
at com.android.org.chromium.content.browser.BrowserStartupController.startBrowserProcessesSync(BrowserStartupController.java:186)
at com.android.org.chromium.android_webview.AwBrowserProcess$1.run(AwBrowserProcess.java:49)
at com.android.org.chromium.base.ThreadUtils.runOnUiThreadBlocking(ThreadUtils.java:64)
at com.android.org.chromium.android_webview.AwBrowserProcess.start(AwBrowserProcess.java:45)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.startChromiumLocked(WebViewChromiumFactoryProvider.java:185)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.access$100(WebViewChromiumFactoryProvider.java:58)
at com.android.webview.chromium.WebViewChromiumFactoryProvider$1.run(WebViewChromiumFactoryProvider.java:123)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5635)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
I am trying connect to a local XMPP server (Vysper) from an Android App using this code:
// ...
ConnectionConfiguration connectionConfig = new ConnectionConfiguration("192.168.1.107", 5222);
// load file from "Pictures" directory from Internal Memory
File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
file.mkdirs();
connectionConfig.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
System.setProperty("javax.net.ssl.trustStore", file + "/clientkeystore");
Log.i("Info", file.getAbsolutePath());
XMPPConnection connection = new XMPPTCPConnection(connectionConfig);
SASLAuthentication.supportSASLMechanism("PLAIN", 0);
connection.connect();
//...
This is the stack trace:
01-27 20:41:07.489 3229-3229/ E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.bm.sam, PID: 3229
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3823)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.view.View$1.onClick(View.java:3818)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException: println needs a message
at android.util.Log.println_native(Native Method)
at android.util.Log.e(Log.java:232)
at com.bm.sam.LoginActivity.onClickLoginButton(LoginActivity.java:187)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.view.View$1.onClick(View.java:3818)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
I am using aSmack 4.0.6 and the Android API 19.
Android network permissions and file permissions have been granted:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
What is wrong?
Your error log says you have a Log.e that is empty, so check that Log first:
Caused by: java.lang.NullPointerException: println needs a message
at android.util.Log.println_native(Native Method)
at android.util.Log.e(Log.java:232)
So I open Dev Tools app to refresh emulator's sd card. The sd card has been re-created, is not read-only and I can create folders on it, move files, etc.
And when I click on "Scan SD Card" button
the app crashes.
Did anyone have issues like this on the Emulator? Emulator is running SDK 19 (4.4.2), it's x86 image with XXHDPI resolution.
I am running Android Studio 1.0 and AVD was created using Android Studio 0.8 or something.
It's odd that I cannot find similar issues on Internet, like it's happening to me only.
EDIT
Logcat Error I get is
Process: com.android.development, PID: 2035
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3823)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.view.View$1.onClick(View.java:3818)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED from pid=2035, uid=10021
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:2373)
at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1127)
at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:365)
at com.android.development.MediaScannerActivity.startScan(MediaScannerActivity.java:123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.view.View$1.onClick(View.java:3818)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Try running it from the 'ADB Command Prompt'
This command did the trick for me:
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard/DCIM/100ANDRO/
Now, I can see images uploaded from the Android Device Monitor.
video view is crashing when trying to chage the video url.
please see the log.
at android.media.MediaPlayer._reset(Native Method)
at android.media.MediaPlayer.reset(MediaPlayer.java:1391)
at android.widget.VideoView.release(VideoView.java:624)
at android.widget.VideoView.openVideo(VideoView.java:308)
at android.widget.VideoView.setVideoURI(VideoView.java:243)
at android.widget.VideoView.setVideoURI(VideoView.java:233)
at com.xxx.xxx.JavaScriptInterface$5.run(JavaScriptInterface.java:151)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5034)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:807)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:623)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: createWindowSurface failed EGL_BAD_ALLOC
at android.view.HardwareRenderer$GlRenderer.createSurface(HardwareRenderer.java:1359)
at android.view.HardwareRenderer$GlRenderer.createEglSurface(HardwareRenderer.java:1245)
at android.view.HardwareRenderer$GlRenderer.initialize(HardwareRenderer.java:1062)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1877)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1256)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6652)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813)
at android.view.Choreographer.doCallbacks(Choreographer.java:613)
at android.view.Choreographer.doFrame(Choreographer.java:583)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Yesterday, a user reported this bug in Google Play in one of my apps. Don't know why this occured. I am not sure atleast how to reproduce this. I found a similar question with no answers.