Twitter autenthication android without twitter app - android

I'm using fabric twitter authentication for an android app ,and it works only if I have the twitter official app installed in the phone without the twitter app I get this exception when I try to authenticate.
Is mandatory to have install the twitter app on your phone to authenticate with twitter?
06-09 19:00:41.574 12893-13421/client.tclient.com.client E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/client.tclient.com.client/shared_prefs/com.crashlytics.prefs.xml
06-09 19:00:43.574 12893-12893/client.tclient.com.client E/ApkAssets: Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
06-09 19:00:43.575 12893-12893/client.tclient.com.client E/ApkAssets: Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin
06-09 19:00:44.342 12893-12893/client.tclient.com.client E/Twitter: Invalid json: <?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $
at com.google.gson.JsonParser.parse(JsonParser.java:65)
at com.google.gson.JsonParser.parse(JsonParser.java:45)
at com.twitter.sdk.android.core.TwitterApiException.parseApiError(TwitterApiException.java:136)
at com.twitter.sdk.android.core.TwitterApiException.readApiError(TwitterApiException.java:125)
at com.twitter.sdk.android.core.TwitterApiException.<init>(TwitterApiException.java:58)
at com.twitter.sdk.android.core.TwitterApiException.convert(TwitterApiException.java:110)
at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1572)
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1421)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:544)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:427)
at com.google.gson.JsonParser.parse(JsonParser.java:60)
at com.google.gson.JsonParser.parse(JsonParser.java:45) 
at com.twitter.sdk.android.core.TwitterApiException.parseApiError(TwitterApiException.java:136) 
at com.twitter.sdk.android.core.TwitterApiException.readApiError(TwitterApiException.java:125) 
at com.twitter.sdk.android.core.TwitterApiException.<init>(TwitterApiException.java:58) 
at com.twitter.sdk.android.core.TwitterApiException.convert(TwitterApiException.java:110) 
at com.twitter.sdk.android.core.Callback.failure(Callback.java:45) 
at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
06-09 19:00:44.343 12893-12893/client.tclient.com.client E/Twitter: Failed to get request token
com.twitter.sdk.android.core.TwitterApiException: 401 Authorization Required
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at retrofit.Platform$Android$2$1.run(Platform.java:142)
at java.lang.Thread.run(Thread.java:818)
06-09 19:00:44.383 12893-12893/client.tclient.com.client E/Twitter: Authorization completed with an error
com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token
at com.twitter.sdk.android.core.identity.OAuthController$1.failure(OAuthController.java:95)
at com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1.failure(OAuth1aService.java:213)
at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

You are trying to parse XML as JSON, also, the error is:
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
Desktop applications only support the oauth_callback value 'oob'
Also provide more info about your implementation.

Related

GraphQLHttpFailureDomain - Facebook Login on real device

I'm having serios issues with facebook log in using a real device. I'm getting this error
-10-29 15:23:28.622 21689-21689/apps.vanilla.edvin.myapplication W/System.err: CONNECTION_FAILURE: TigonError(3): GraphQLHttpFailureDomain(401) HTTP Error
at com.facebook.login.LoginManager.onActivityResult(LoginManager.java:219)
at com.facebook.login.LoginManager$1.onActivityResult(LoginManager.java:174)
at com.facebook.internal.CallbackManagerImpl.onActivityResult(CallbackManagerImpl.java:92)
at com.vanillapps.caietvirtual.Start.Autentication.LoginFragment.onActivityResult(LoginFragment.java:269)
at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:160)
at android.app.Activity.dispatchActivityResult(Activity.java:7289)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4516)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4563)
at android.app.ActivityThread.-wrap22(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Using the emulator, login works without issues.
Any suggestions regarding my issue? Thanks.

Creating a JAXBContext on Android raises ClassCastException

Good evening,
I have written a java library using JAXB (javax.xml.bind:jaxb-api:2.1), which works just fine in my desktop-application.
Now I want to use this library on android, but when I try to create the JAXBContext:
JAXBContext context =
JAXBContext.newInstance(ObjectFactory.class.getPackage().getName(),
this.getClass().getClassLoader());
I get this error (see stacktrace below).
I would appreciate any hint in which direction I have to look.
Thanks in advance!!
Stacktrace:
W/System.err: java.util.MissingResourceException: Can't find bundle for base name javax.xml.bind.Messages, locale de_DE
W/System.err: at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1501)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1324)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:723)
at javax.xml.bind.Messages.format(Messages.java:71)
at javax.xml.bind.Messages.format(Messages.java:56)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:148)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:371)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
W/System.err: at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
at org.foo.mylibraryapi.persistence.adapter.ModelReader.readDocument(ModelReader.java:67)
at org.foo.mylibraryapi.persistence.adapter.ModelReader.readDocument(ModelReader.java:30)
at org.foo.mylibrary.ui.FileLoader.load(FileLoader.java:14)
at org.foo.ambitusapp.MainActivity.onActivityResult(MainActivity.java:180)
at android.app.Activity.dispatchActivityResult(Activity.java:6946)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4126)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4173)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
W/System.err: Caused by: java.lang.ClassCastException: javax.xml.bind.Messages cannot be cast to ResourceBundle
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2576)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1438)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1402)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1356)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1356)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1298)
... 22 more

Android Studio 3.0.0-beta1 -- NoClassDefFoundError

Since upgrading Android Studio to v3.0.0-beta1 and amending classpath to 'com.android.tools.build:gradle:3.0.0-beta1' I am being hit with the following error each time my rxjava/retrofit code throws an error (a 401 HttpException in this example).
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:114)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: rx.exceptions.OnErrorFailedException: Error occurred when trying to propagate error to Observer.onError
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:187)
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.checkTerminated(OperatorObserveOn.java:273)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:216)
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
at android.os.Handler.handleCallback(Handler.java:746) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5443) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
Caused by: rx.exceptions.CompositeException: 2 exceptions occurred.
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:187) 
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115) 
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.checkTerminated(OperatorObserveOn.java:273) 
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:216) 
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107) 
at android.os.Handler.handleCallback(Handler.java:746) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5443) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
Caused by: rx.exceptions.CompositeException$CompositeExceptionCausalChain: Chain of Causes for CompositeException In Order Received =>
at android.util.Log.getStackTraceString(Log.java:522)
at com.android.internal.os.RuntimeInit.Clog_e(RuntimeInit.java:61)
at com.android.internal.os.RuntimeInit.-wrap0(RuntimeInit.java)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:86)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:118)
at android.os.Handler.handleCallback(Handler.java:746) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5443) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
Caused by: retrofit2.adapter.rxjava.HttpException: HTTP 401 Unauthorized
at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:43)
at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:38)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:173)
at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber$1.request(OperatorSubscribeOn.java:109)
at rx.Subscriber.setProducer(Subscriber.java:211)
at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.setProducer(OperatorSubscribeOn.java:105)
at rx.Subscriber.setProducer(Subscriber.java:205)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10346)
at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;
All error handlers have been set appropriately for RxJava calls.
Android sdk build tools v26.0.1
Tried clean, rebuild etc
Tried disabling Instant-Run
This issue was addressed by Google and fixed in Beta 2 update.
Friday, August 11, 2017
Android Studio 3.0 Beta 2 is now available in
the Canary and Dev channels. This release fixes an issue which
resulted in the compiler throwing a ClassNotFoundException when you
enable Java 8 language features and specify minSdkVersion 19 or
higher—this also caused some code analysis tools, such as ProGuard, to
fail. For more information, see issue #64527520.

Unable to launch Angular app on Android

I get the following error when I try to luanch my Angular app in my android app.
06-15 13:49:15.037 9055-9055/? E/AppInfoBase: Exception when retrieving package:com.myPackage
android.content.pm.PackageManager$NameNotFoundException: com.myPackage
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:137)
at com.android.settings.applications.AppInfoBase.retrieveAppEntry(AppInfoBase.java:123)
at com.android.settings.applications.InstalledAppDetails.refreshUi(InstalledAppDetails.java:466)
at com.android.settings.applications.InstalledAppDetails.onActivityResult(InstalledAppDetails.java:435)
at android.app.Activity.dispatchActivityResult(Activity.java:6452)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
at android.app.ActivityThread.-wrap16(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-15 13:49:15.110 1900-1900/? E/NetworkScheduler.SchedulerReceiver: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
What is the issue? Unable to debug and trace :( I see the Android manifets file, its proper!

Not able to receive crash reports in Acralyzer from ACRA

Below I have given all the crash logs printed in Logcat. I am crashing the app with the below code on a button's onclicklistener. The server is running and the device and server are in same wifi network.
throw new RuntimeException("This is a crash");
I went throught the installation twice for Acralyzer and couldn't find my mistake. And I am hosting the server my own laptop.
If anyone need any more details I am willing to post it. All the server related details I used as a guide is here
There is no reports displayed in server as well.
Logcat Logs
E/ACRA: ACRA caught a RuntimeException for com.example.sys.myapplication
java.lang.RuntimeException: This is a crash
at com.example.sys.myapplication.MainActivity$3.onClick(MainActivity.java:111)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21168)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.sys.myapplication, PID: 16543
java.lang.RuntimeException: This is a crash
at com.example.sys.myapplication.MainActivity$3.onClick(MainActivity.java:111)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21168)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/System: ClassLoader referenced unknown path: /data/app/com.example.sys.myapplication-2/lib/arm
W/System: ClassLoader referenced unknown path: /data/app/com.example.sys.myapplication-2/lib/arm
E/InstantRun: IO Error creating local socket at com.example.sys.myapplication
java.io.IOException: Address already in use
at android.net.LocalSocketImpl.bindLocal(Native Method)
at android.net.LocalSocketImpl.bind(LocalSocketImpl.java:309)
at android.net.LocalServerSocket.<init>(LocalServerSocket.java:48)
at com.android.tools.fd.runtime.Server.<init>(Server.java:94)
at com.android.tools.fd.runtime.Server.create(Server.java:88)
at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:315)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4728)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
I/ACRA: Sending report /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T18:44:37.046+05:30.stacktrace
E/ACRA: Failed to send crash report for /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T18:44:37.046+05:30.stacktrace
org.acra.sender.ReportSenderException: Error while sending JSON report via Http POST
at org.acra.sender.HttpSender.send(HttpSender.java:236)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:102)
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:70)
at org.acra.sender.SenderService.onHandleIntent(SenderService.java:69)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.net.SocketTimeoutException: failed to connect to /192.168.1.15 (port 5984) after 5000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:169)
at libcore.io.IoBridge.connect(IoBridge.java:122)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:452)
at java.net.Socket.connect(Socket.java:884)
at com.android.okhttp.internal.Platform.connectSocket(Platform.java:117)
at com.android.okhttp.internal.http.SocketConnector.connectRawSocket(SocketConnector.java:160)
at com.android.okhttp.internal.http.SocketConnector.connectCleartext(SocketConnector.java:67)
at com.android.okhttp.Connection.connect(Connection.java:152)
at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:185)
at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:114)
at org.acra.util.HttpRequest.send(HttpRequest.java:142)
at org.acra.sender.HttpSender.send(HttpSender.java:233)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:102) 
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:70) 
at org.acra.sender.SenderService.onHandleIntent(SenderService.java:69) 
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.os.HandlerThread.run(HandlerThread.java:61) 
I/ACRA: Sending report /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T19:02:07.897+05:30.stacktrace
E/ACRA: Failed to send crash report for /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T19:02:07.897+05:30.stacktrace
org.acra.sender.ReportSenderException: Error while sending JSON report via Http POST
at org.acra.sender.HttpSender.send(HttpSender.java:236)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:102)
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:70)
at org.acra.sender.SenderService.onHandleIntent(SenderService.java:69)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.net.SocketTimeoutException: failed to connect to /192.168.1.15 (port 5984) after 5000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:169)
at libcore.io.IoBridge.connect(IoBridge.java:122)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:452)
at java.net.Socket.connect(Socket.java:884)
at com.android.okhttp.internal.Platform.connectSocket(Platform.java:117)
at com.android.okhttp.internal.http.SocketConnector.connectRawSocket(SocketConnector.java:160)
at com.android.okhttp.internal.http.SocketConnector.connectCleartext(SocketConnector.java:67)
at com.android.okhttp.Connection.connect(Connection.java:152)
at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:185)
at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:114)
at org.acra.util.HttpRequest.send(HttpRequest.java:142)
at org.acra.sender.HttpSender.send(HttpSender.java:233)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:102) 
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:70) 
at org.acra.sender.SenderService.onHandleIntent(SenderService.java:69) 
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.os.HandlerThread.run(HandlerThread.java:61) 
I/ACRA: Sending report /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T19:03:58.007+05:30.stacktrace
E/ACRA: Failed to send crash report for /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T19:03:58.007+05:30.stacktrace
org.acra.sender.ReportSenderException: Error while sending JSON report via Http POST
at org.acra.sender.HttpSender.send(HttpSender.java:236)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:102)
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:70)
at org.acra.sender.SenderService.onHandleIntent(SenderService.java:69)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.net.SocketTimeoutException: failed to connect to /192.168.1.15 (port 5984) after 5000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:169)
at libcore.io.IoBridge.connect(IoBridge.java:122)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:452)
at java.net.Socket.connect(Socket.java:884)
at com.android.okhttp.internal.Platform.connectSocket(Platform.java:117)
at com.android.okhttp.internal.http.SocketConnector.connectRawSocket(SocketConnector.java:160)
at com.android.okhttp.internal.http.SocketConnector.connectCleartext(SocketConnector.java:67)
at com.android.okhttp.Connection.connect(Connection.java:152)
at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:185)
at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:114)
at org.acra.util.HttpRequest.send(HttpRequest.java:142)
at org.acra.sender.HttpSender.send(HttpSender.java:233)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:102) 
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:70) 
at org.acra.sender.SenderService.onHandleIntent(SenderService.java:69) 
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.os.HandlerThread.run(HandlerThread.java:61) 
I/ACRA: Sending report /data/user/0/com.example.sys.myapplication/app_ACRA-approved/2016-05-05T19:20:27.024+05:30.stacktrace
The log is pretty clear:
java.net.SocketTimeoutException: failed to connect to /192.168.1.15 (port 5984)
ACRA can't reach the server.
You can check if you can reach the server from a normal mobile browser to identify the problems location.
For those who might struggle with the same issue, here's what I did. Couchdb by default listens only to the localhost. You can enable listening for remote device or other systems by setting from bind_address = 127.0.0.1 to bind_address = 0.0.0.0. The files can be found under C:\Program Files (x86)\Apache Software Foundation\CouchDB\etc\couchdb, default.ini and local.ini. Check in both as for me it was default.ini and local.ini file had it commented out. local.ini file settings will override default.ini file as stated in documentation of local.ini file.
btw this didn't solve my entire problem yet. Now I am able to send the request to the server. But the Acralyzer Dashboard shows no details of the inserted data. And I am not sure yet whether the data is inserted correctly or not.

Categories

Resources