My application keeps crash report on Crashlytics for ArrayIndexOutOfBoundsException at com.huawei.agconnect.crash.internal.log.h$b.read. I've tried to search around but doesn't seems to get any info on this.
For my recent release, I update my agconnect libraries but still getting this crash. Here are the versions:
build.gradle project
classpath 'com.huawei.agconnect:agcp:1.7.2.300'
build.gradle app
implementation 'com.huawei.hms:base:6.6.0.300'
implementation 'com.huawei.agconnect:agconnect-core:1.7.2.300'
implementation 'com.huawei.hms:hianalytics:6.7.0.300'
implementation 'com.huawei.agconnect:agconnect-crash:1.7.2.300'
implementation 'com.huawei.hms:push:6.7.0.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.7.2.300'
From the report, all crashes are for Huawei devices and 90%+ are Android 10. The rest are Android 11.
This is the stacktrace shown in Crashlytics:
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException:
at com.huawei.agconnect.crash.internal.log.h$b.read(:51)
at com.huawei.agconnect.crash.internal.log.e$1.a(:15)
at com.huawei.agconnect.crash.internal.log.h.a(:21)
at com.huawei.agconnect.crash.internal.log.e.a(:28)
at com.huawei.agconnect.crash.internal.log.f.b(:8)
at com.huawei.agconnect.crash.internal.log.d.a(:215)
at com.huawei.agconnect.crash.internal.log.c.a(:10)
at com.huawei.agconnect.crash.internal.log.a$4.run(:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
Not exactly sure, but this line appears questionable to me:
implementation 'com.huawei.hms:base:6.6.0.300'
base should use the same HMS version 6.7.0.300, alike the other libraries.
If not, the only chance to pinpoint this is to check out the decompiled class com.huawei.agconnect.crash.internal.log.h$b.read at line 51 (give or take).
This would at least provide a clue, which array it tries to access there ...
Try to update all Huawei dependencies to 6.7.0.300 vesion.
After 1 month or so update to the latest Huawei Agconnect, I no longer receiving this crash report. Now this is the version I'm using:
implementation 'com.huawei.hms:base:6.8.0.300'
implementation 'com.huawei.agconnect:agconnect-core:1.7.3.300'
implementation 'com.huawei.hms:hianalytics:6.8.0.300'
implementation 'com.huawei.agconnect:agconnect-crash:1.7.3.300'
implementation 'com.huawei.hms:push:6.7.0.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.7.3.300'
Related
We have an android app in production and we use the Firebase Crashlytics.
Everything is good on Firebase Crashlytics page. The crashes stacktrace is deobfuscated. Only the stacktrace TITLE isn't deobfuscated. Look at the screenshot http://prntscr.com/xm0g6s . How to show human-readable TITLE? What is the problem and how to fix that?
PLEASE DO NOT REFER ON SIMILAR ISSUES like "How to deobfuscate your stacktrace" because my stacktrace actually is deobfuscated on Firebase Crashlytis page. Look at the screenshot
Dependencies I used:
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
ProGuard is ON in the release build. My proguard-rules.pro file: https://gist.github.com/SergeyKharuk/f7bc59c328662fd39232c80bfd87eba8
How is it possible that I get this message? It does not make any sense.
I'm using com.squareup.retrofit2:retrofit:2.9.0
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 30
at okhttp3.internal.platform.AndroidPlatform$Companion.buildIfSupported(AndroidPlatform.kt:370)
at okhttp3.internal.platform.Platform$Companion.findPlatform(Platform.kt:204)
at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:178)
2020-09-16 12:37:07.645 6480-6480/lv.ltt.gasogmp.dev_v3 E/AndroidRuntime: at
okhttp3.internal.platform.Platform.<clinit>(Platform.kt:179)
Add an explicit dependency on OkHttp 4.9.0. Or whatever is newest at the time you read this.
This bug is embarrassing but it's been fixed for so long that you shouldn’t be encountering it in new code.
Just Add the Dependency implementation 'com.squareup.okhttp3:okhttp:4.9.2'
PS - Check the latest version here before you add the dependency https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
Add implementation 'com.squareup.okhttp3:okhttp:4.9.2' inside android\app\build.gradle
dependencies {
........
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
..........
}
Upgrage Okhttp3 or retrofit version
Latest Okhttp3 version is 4.9.2
Latest Retrofit version is 2.9.0
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
I have some problem when integrating react-native-google-signin into native android code. I use react-native 0.59.8 and i can't upgrade to 0.60 so far. Therefore I followed an instruction for older react-native-google-signin version which is 2.1.1. Unfortunately it's not working for me. It gives me some errors concerning androidX but as far as I know react-native-google-signin started using androidX from version 3.0.0 upwards, but i use 2.1.1 version which should not use androidX.
Description
The problem starts in sync proccess in Android Studio which gives me the following error:
ERROR: Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-117 to override.
Now when I'm trying to build my project in Android Studio it gives me another error:
error: package android.support.v4.net does not exist
Interesingly, now problem concerns the package #react-native-community/netinfo which was working fine before I linked react-native-google-signin into my project. I would be very grateful if someone told me what's going on.
EDIT:
My dependencies section from android/app/build.gradle is as follows:
dependencies {
implementation project(':react-native-google-signin')
implementation project(':react-native-reanimated')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-firebase')
implementation project(':react-native-community-netinfo')
implementation project(':react-native-orientation')
implementation project(':react-native-keychain')
implementation project(':react-native-view-shot')
implementation project(':react-native-video')
implementation project(':react-native-fs')
implementation project(':react-native-blur')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'com.facebook.react:react-native:+'
implementation 'com.android.support:design:27.1.1'
implementation project(':react-native-navigation')
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation "com.google.firebase:firebase-messaging:17.5.0"
}
Please try the following:
Open your /android/app/build.gradle File, and check your dependencies.
Search for any instance of play-services of firebase, and see for two things:
the line starts with implements (instead of compile)
see if there are any get latest Version wildcard (that is the +-Sign) on it. (Example: implementation "com.google.android.gms:play-services-base:+"
(If you don't found any component implemented with +-Sign, go on further down from topic "GO-ON-HERE" ⇓ in this answer.)
Get those (in my example it is com.google.android.gms:play-services-base and search for it on MVNRepository to get an overview of available Versions.
Here you might choose the newest one, or one that definitely work with your used components and force your App to use it, by updating /android/app/build.gradle like this:
implementation ("com.google.android.gms:play-services-base:17.1.0"){ force = true }
(Note: I don't know, if it's play-services-base in your case, it's only an example)
⇒ GO-ON-HERE
After that, switch to /android and run ./gradlew :app:dependencies. This regenerate your dependency-tree for your Project.
Open the created Text-file and search for your updated Component:com.google.android.gms:play-services-base to see, where the component will be used.
You might find, that still some components use the +-Sign (com.google.android.gms:play-services-base:+) in the dependency. To fix your issue, you need to patch them (maybe use patch-package to simplify this process) to also use the Version for your component (in our example "play-services-base") you've choosed above.
Hope that helps you out.
Android app crashes when i run these two things together - OkHttpStack as base stack for new request queue in volley and firebase firestore dependency in gradle ('com.google.firebase:firebase-firestore:17.0.5')
Gives me this error, maybe firebase firestore dependency already includes okhttp dependency that's why this coming or maybe its not, but if this is the case what to be done or how to exclude it? or Otherwise i am not getting what the error is, please suggest a solution.
Dependencies -
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
implementation 'com.google.firebase:firebase-firestore:17.0.5'
FATAL EXCEPTION: Thread-21
java.lang.NoSuchMethodError: No direct method <init>(Lcom/squareup/okhttp/OkHttpClient;Lcom/squareup/okhttp/Request;ZZZLcom/squareup/okhttp/Connection;Lcom/squareup/okhttp/internal/http/RouteSelector;Lcom/squareup/okhttp/internal/http/RetryableSink;Lcom/squareup/okhttp/Response;)V in class Lcom/squareup/okhttp/internal/http/HttpEngine; or its super classes (declaration of 'com.squareup.okhttp.internal.http.HttpEngine' appears in /data/app/packagename-vaVP5bn4ajPlEZQZDBqyVg==/split_lib_dependencies_apk.apk:classes2.dex)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.newHttpEngine(HttpURLConnectionImpl.java:362)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.initHttpEngine(HttpURLConnectionImpl.java:312)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:377)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
at com.android.volley.toolbox.HurlStack.executeRequest(HurlStack.java:96)
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:123)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:131)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
UncaughtException: java.lang.NoSuchMethodError: No direct method <init>(Lcom/squareup/okhttp/OkHttpClient;Lcom/squareup/okhttp/Request;ZZZLcom/squareup/okhttp/Connection;Lcom/squareup/okhttp/internal/http/RouteSelector;Lcom/squareup/okhttp/internal/http/RetryableSink;Lcom/squareup/okhttp/Response;)V in class Lcom/squareup/okhttp/internal/http/HttpEngine; or its super classes (declaration of 'com.squareup.okhttp.internal.http.HttpEngine' appears in /data/app/packageName-vaVP5bn4ajPlEZQZDBqyVg==/split_lib_dependencies_apk.apk:classes2.dex)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.newHttpEngine(HttpURLConnectionImpl.java:362)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.initHttpEngine(HttpURLConnectionImpl.java:312)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:377)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
at com.android.volley.toolbox.HurlStack.executeRequest(HurlStack.java:96)
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:123)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:131)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
Firestore depends on old okhttp:2.7.2, not okhttp3. It's even enother package, not just version. So you cant just exclude it from firestore dependencies. The only way I see here - you should switch to old version of okhttp until firestore update its dependencies.
There is a temporary fix at here
configurations.all {
resolutionStrategy {
force 'com.squareup.okhttp:okhttp:2.7.5'
force 'com.squareup.okio:okio:1.17.5'
}
}
i'm learning Android while doing some work on it. I'm trying to update an app's version to Android 8.0, that includes sdk, libraries and external APIs used.
I looked it up and it seems like 15.0.1 is the suggested version. But when i use it, gradle fails for play-services-analytics and firebase services to sync saying it cannot resolve the library and nor can it find the Repository if i press Install Repository.
So currently i'm using version 12.0.1 for both play services and firebase services. Using it like:
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-analytics:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-gcm:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-analytics:12.0.1'
implementation 'com.google.firebase:firebase-crash:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
But if i try to use only the play-services 15.0.1 except for analytics then it gives me another warning that using different versions of play services and firebase services can lead to runtime crashes.
So it puts me in a weird situation, i've googled and searched, but cant find anything that works for me... What would be the correct way to deal with this here? Should i settle for 12.0.1? or update what ever works? (Previously the version was 9.4.0 or something along that line; before i was doing the Android 8.0 upgrade)
EDIT: These are my top level gradle dependencies
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.2'
You cannot mix versions of firebase and google play services that are less than or equal to 12 with versions that are greater than or equal to 15.
Therefore you need to update the version number of all these libraries:
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-analytics:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
Check this:
https://firebase.google.com/support/release-notes/android
https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html
Beginning with version 15, each Maven dependency matching com.google.android.gms:play-services-* and com.google.firebase:firebase-* is no longer required to have the same version number in order to work correctly at build time and at run time.
Also use the following google play services plugin in the top level gradle file:
classpath 'com.google.gms:google-services:4.0.1'