I've an Android app which downloads file from Firebase Storage, It is working fine with Android API level 23 and above. However, For version like Android API level 16 it fails with following exception:
05-15 16:42:32.921 3909-3952/com.X.Y E/StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
Unable to open stream
java.io.IOException: Unable to open stream
at com.google.firebase.storage.StreamDownloadTask$zza.zzp(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask$zza.zza(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
at com.google.firebase.storage.zzq.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Caused by: android.os.RemoteException
at com.google.android.gms.internal.firebase_storage.zzp.<init>(Unknown Source)
at com.google.android.gms.internal.firebase_storage.zzp.zzb(Unknown Source)
at com.google.firebase.storage.StorageReference.zzd(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask.zzn(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask.zza(Unknown Source)
at com.google.firebase.storage.zzw.call(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask$zza.zzp(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask$zza.zza(Unknown Source)
at com.google.firebase.storage.StreamDownloadTask.run(Unknown Source)
at com.google.firebase.storage.StorageTask.zzl(Unknown Source)
at com.google.firebase.storage.zzq.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Code to download:
final StorageReference pathReference = mStoragePath.getReference().child(mRootPath + inPath);
final StreamDownloadTask downloadTask = pathReference.getStream();
Dependencies:
com.google.firebase:firebase-core:15.0.2
com.google.firebase:firebase-firestore:16.0.0
com.google.firebase:firebase-storage:15.0.2
This can maybe happen if google play services isn't updated on your phone. Make sure that you have the latest version.
If your version is up to date check in setContentLanguage you should use only 2 letters (E.g. "en"). Also you should check this answer in github which depend in your problem
Related
This is part of my trace:
java.lang.RuntimeException:Unable to create application kula.publics.objects.KulaApplication: net.sqlcipher.database.SQLiteDiskIOException: disk I/O error: COMMIT;
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5116)
......
Caused by:
net.sqlcipher.database.SQLiteDiskIOException:disk I/O error: COMMIT;
net.sqlcipher.database.SQLiteDatabase.native_execSQL(Native Method)
net.sqlcipher.database.SQLiteDatabase.execSQL(Unknown Source)
net.sqlcipher.database.SQLiteDatabase.endTransaction(Unknown Source)
net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(Unknown Source)
net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(Unknown Source)
kula.third.afinal.b.c(Unknown Source)
kula.third.afinal.b.<init>(Unknown Source)
kula.third.afinal.b.b(Unknown Source)
kula.third.afinal.b.a(Unknown Source)
kula.third.afinal.b.a(Unknown Source)
kula.eric.data.db.FlySubDbManager.getDb(Unknown Source)
kula.eric.data.db.FlyBaseDbManager.<init>(Unknown Source)
kula.eric.data.db.FlySubDbManager.<init>(Unknown Source)
kula.eric.data.db.FlySubDbManager.init(Unknown Source)
kula.eric.data.KulaFlyController.<init>(Unknown Source)
kula.eric.data.KulaFlyController.getInstance(Unknown Source)
I have checked my code, there is only one place to open the db file. It doesn't look like multi-threaded problem. And the crash mostly happened in Android 4.4.4.
Related library:
SQLiteOpenHelper in sqlcipher:
https://github.com/sqlcipher/android-database-sqlcipher/blob/master/src/net/sqlcipher/database/SQLiteOpenHelper.java
FinalDb in afinal:
https://github.com/yangfuhai/afinal/blob/master/src/net/tsz/afinal/FinalDb.java
I am using the AWS cognito SDK for Android, version 2.4.3. It works perfectly fine on debug version, but on release versions, in case of error, I cannot get a proper description on the exception. Instead, I get this
com.amazonaws.AmazonClientException: Unable to unmarshall error response (<init> [class java.lang.String]). Response Code: 400, Response Text: Bad Request
at com.amazonaws.http.AmazonHttpClient.a(Unknown Source)
at com.amazonaws.http.AmazonHttpClient.b(Unknown Source)
at com.amazonaws.http.AmazonHttpClient.a(Unknown Source)
at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.a(Unknown Source)
at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.a(Unknown Source)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.a(Unknown Source)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.a(Unknown Source)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodException: <init> [class java.lang.String]
at java.lang.Class.getConstructor(Class.java:531)
at java.lang.Class.getConstructor(Class.java:495)
at com.amazonaws.transform.AbstractErrorUnmarshaller.a(Unknown Source)
at com.amazonaws.transform.JsonErrorUnmarshaller.b(Unknown Source)
at com.amazonaws.services.cognitoidentityprovider.model.transform.InvalidParameterExceptionUnmarshaller.b(Unknown Source)
at com.amazonaws.http.JsonErrorResponseHandler.a(Unknown Source)
at com.amazonaws.http.JsonErrorResponseHandler.b(Unknown Source)
at com.amazonaws.http.JsonErrorResponseHandler.a(Unknown Source)
at com.amazonaws.http.AmazonHttpClient.a(Unknown Source)
at com.amazonaws.http.AmazonHttpClient.b(Unknown Source)
at com.amazonaws.http.AmazonHttpClient.a(Unknown Source)
at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.a(Unknown Source)
at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.a(Unknown Source)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.a(Unknown Source)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.a(Unknown Source)
at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
On debug version I get an exception indicating in detail the error. However, in both release and debug user registration succeeds in case all fields are well written. I am using proguard on release and I am aplying the rules from this file
Any help with this issue will be appreciated.
After trying different Proguard settings, following is the minimal configuration, additional to that suggested on AWS SDK repository, to make it work
-keep class com.amazonaws.services.cognitoidentityprovider.** { *; }
it must be added to app/proguard-rules.pro
Unmarshalling errors can also occur with classes in the AWS core library, not just com.amazonaws.services.cognitoidentityprovider. This rule will prevent this crash for all AWS lib exceptions:
-keep class * extends com.amazonaws.AmazonClientException { *; }
FirebaseStorage.getInstance().getReference() crashes the app. I have checked another similar post but that did not help as my google-services.json file is correctly downloaded from FireBase API and the FireBase assistant shows connection and status as 'OK'.
here's the log:
A/FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1737)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6487)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6082)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6022)
at android.app.ActivityThread.access$1700(ActivityThread.java:211)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1766)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal .os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal .os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzx; or its super classes (declaration of 'com.google.android.gms.common.util.zzx' appears in /data /data /com.example.bhrigu.simpleblog/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-10.0.0_c06534ef2c8c0d287af412696f22ee66b12bcbfa-classes.dex)
at com.google.firebase.iid.zzg.zzkg(Unknown Source)
There was indeed a conflict with the google-play version. Initially, I had used version 9.2.0 for Firebase libraries as I was getting errors with 10.0.0. However fixing the google-play version seems to have taken care of those ones as well. And I am able to run with all the updated libraries.
I'm planning to use GCM features for an Android app. I setup the proper Android app and the backend service deployed on localhost.
Everyting was fine and the notifications were displayed on my testing device. Next I tried to deploy the service on a different server with a real IP. Now I'm getting this strange error when I try to push the notification from the server side and I don't know how to fix it. Does anyone have a solution?
javax.net.ssl.SSLException: Server key
at com.sun.net.ssl.internal.ssl.Handshaker.throwSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
at com.google.android.gcm.server.Sender.post(Sender.java:479)
at com.google.android.gcm.server.Sender.post(Sender.java:458)
at com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:170)
at com.google.android.gcm.server.Sender.send(Sender.java:121)
at com.gebs.floatmanagement.web.servlet.MapGenerator.sendAndroidNotification(Unknown Source)
at com.gebs.floatmanagement.web.servlet.MapGenerator.processRequest(Unknown Source)
at com.gebs.floatmanagement.web.servlet.MapGenerator.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.spec.InvalidKeySpecException: does not support java.security.spec.ECPublicKeySpec
at com.certicom.ecc.jcae.ECKeyFactorySpi.engineGeneratePublic(Unknown Source)
at java.security.KeyFactory.generatePublic(Unknown Source)
at com.sun.net.ssl.internal.ssl.HandshakeMessage$ECDH_ServerKeyExchange.(Unknown Source)
... 35 more
I have deployed on my server some applications that override some SSL features and because of those the error has raised. Removing the services or migrating the app backend service on another server solved my problems.
I have an android application that parses the HTML content and displays the required tag.
It is working fine for the hardcoded HTML code.
But when I set up a HTTP connection for a URL, then it is not working in Emulator.
Let me know how to set up an HTTP connection in android and see the response in Emulator.
I want to give that response as an input to the parser.
I want it working and parsing in Emulator iteself.
The error that I am getting is
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at com.ltil.HtmlContentParser.main(HtmlContentParser.java:31)
starting the emulator with the option -http-proxy <proxy> allows you to specify a proxy