I'm looking at upgrading my firebase libraries within my application, however once I upgrade them to the latest versions, I consistently get a crash when starting the application. The log shows
2019-02-01 13:29:28.845 com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.j.a.a(SourceFile:28)
at com.google.android.apps.gsa.staticplugins.recognizer.j.b.run(SourceFile:15)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:14)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.a.ai.run(SourceFile:6)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.f(SourceFile:103)
at com.google.android.apps.gsa.speech.audio.au.read(SourceFile:2)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.ao.run(SourceFile:18)
at com.google.android.apps.gsa.speech.audio.an.run(SourceFile:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:14)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.a.ai.run(SourceFile:6)
Here is the build.gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.application.id“
minSdkVersion 16
targetSdkVersion 27
// Enabling multidex support.
multiDexEnabled true
dexOptions {
javaMaxHeapSize "2048M"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
//compile project(':volley')
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-appindexing:17.1.0'
...
implementation 'commons-io:commons-io:2.4'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-ads:17.1.3'
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0#aar') {
transitive = true;
}
...
}
apply plugin: 'com.google.gms.google-services'
The libraries which I updated are
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
to
implementation 'com.google.firebase:firebase-appindexing:17.1.0'
implementation 'com.google.firebase:firebase-core:15.0.2' to implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-messaging:15.0.2' to implementation 'com.google.firebase:firebase-messaging:17.3.4'
and implementation 'com.google.firebase:firebase-ads:15.0.1' to implementation 'com.google.firebase:firebase-ads:17.1.3'
Why could these updates be causing the crash?
Related
I have updated my Firebase Crashlytics from
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
to
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
Now I am getting this error:
error: package com.google.firebase.iid does not exist
When I try to import this:
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
This is my project level build.gradle file:
buildscript {
ext {
kotlin_version = '1.3.72'
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:perf-plugin:1.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20" }
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my app level build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 30
defaultConfig {
applicationId "..."
minSdkVersion 16
targetSdkVersion 30
versionCode ...
versionName "..."
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
//shrinkResources true NOT SUPPORTED FOR DYNAMIC MODULES
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
multiDexEnabled true
}
debug {
multiDexEnabled true
}
}
dynamicFeatures = [":premium", ':tutorial']
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'androidx.appcompat:appcompat:1.2.0'
api 'com.google.android.material:material:1.2.1'
api 'androidx.constraintlayout:constraintlayout:2.0.4'
api 'com.google.android.play:core:1.8.3'
api 'com.google.firebase:firebase-analytics:18.0.0'
api 'com.google.firebase:firebase-perf:19.0.10'
api 'com.google.firebase:firebase-invites:17.0.0'
api 'com.google.firebase:firebase-firestore:22.0.0'
api 'androidx.legacy:legacy-support-v4:1.0.0'
api 'com.google.firebase:firebase-config:20.0.1'
implementation 'com.google.firebase:firebase-appindexing:19.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
api 'androidx.navigation:navigation-fragment:2.3.1'
api 'androidx.cardview:cardview:1.0.0'
api 'androidx.recyclerview:recyclerview:1.1.0'
api 'androidx.preference:preference:1.1.1'
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
api 'com.google.firebase:firebase-auth:20.0.1'
api 'com.google.zxing:core:3.3.3'
api 'com.android.billingclient:billing:3.0.1'
//api 'com.facebook.android:facebook-android-sdk:5.15.3'
implementation 'com.google.android.gms:play-services-ads-lite:19.5.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.datatransport:transport-runtime:2.2.5'
}
The error doesn't happen with firebase crashlytics dependency version 17.1.1 and below.
I have already tried:
Rebuilding Project
Cleaning Project
Invalidating Cache and Restarting
The solution to this problem was that FirebaseInstanceId was depreciated. This means that it was removed from the library.
You can find more information about it here: https://firebase.google.com/docs/reference/android/com/google/firebase/iid/FirebaseInstanceId
I don't know what the error means. I'm trying to do an uber app from youtube that uses Firebase and got this error.
Cannot fit requested classes in a single dex file (# methods: 86010 > 65536)
com.android.tools.r8.CompilationFailedException: Compilation failed to complete.
build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.ezbusjava"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable = true
signingConfig signingConfigs.debug
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-firestore:21.3.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
build.gradle(project)
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Android has a 65,536 method limit. If your app exceeds that number, you need to enable multidexing.
Simply add the multiDexEnabled flag and the needed dependency to your build.gradle:
android {
defaultConfig {
...
multiDexEnabled true
...
}
...
}
dependencies {
...
implementation 'com.android.support:multidex:1.0.3'
}
Additionally, you need to configure your app to make use of multidexing.
According to the docs, if your app extends Application, you need it to extend from MultiDexApplication instead.
If your app is not extending Application, you need to add the following line to your manifest:
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
Try Enabling Multidex in the app. You can read more about it here https://developer.android.com/studio/build/multidex
I am maintaining an android app which uses firebase otp for authentication. The app is live and works on most of the devices, but otp is not received on Android P devices.
I am guessing this is something to do with compatible versions, any help would be appreciated.
This is the log error I am getting:
I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms: com.google.firebase.auth.api.internal.zzao#2492342
APP GRADLE:
apply plugin: 'com.android.application'
compileSdkVersion 29
defaultConfig {
applicationId "com.example.app"
minSdkVersion 19
targetSdkVersion 29
versionCode 21
versionName "1.9.5"
multiDexEnabled = true
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
signingConfig signingConfigs.config
//debuggable true
}
debug {
signingConfig signingConfigs.config
//debuggable true
}
}
dexOptions {
javaMaxHeapSize "4g"
}
productFlavors {
}
}
dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'junit:junit:4.12'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.facebook.android:facebook-android-sdk:4.42.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.flyco.banner:FlycoBanner_Lib:1.1.8#aar'
implementation 'com.github.d-max:spots-dialog:0.4#aar'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation 'com.google.firebase:firebase-storage:19.1.0'
implementation 'com.fxn769:pix:1.4.4'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
AND PROJECT GRADLE
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.3.2'
}
}
allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Android-apt plugin is incompatible with the Android Gradle plugin
android-apt plugin is incompatible with the Android Gradle plugin.
Please use 'annotationProcessor' configuration instead.
Affected Modules: app
what i miss!
this my gradle Modules app
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 28
buildToolsVersion '28.0.0'
defaultConfig {
applicationId "com.app.app"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.github.satyan:sugar:1.4'
annotationProcessor 'com.android.support:multidex:1.0.3'
compile('com.squareup.retrofit2:retrofit:2.0.0-beta4') {
exclude module: 'okhttp'
}
implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.0.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:9.0.1'
testImplementation 'junit:junit:4.12'
}
Add below line in dependencies block :
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
Since adding Firebase to my application so I can send push notifications to users through appcenter I have encountered a number of problems.
I am currently experiencing a possible merging issue between two libraries.
Failed to notify dependency resolution listener.
The library com.google.android.gms:play-services-basement is being
requested by various other libraries at [[15.0.1,15.0.1]], but
resolves to 16.0.1. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies.
As you can see here I do not have any specific dependencies for play-services-basement...
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'io.realm:realm-gradle-plugin:5.3.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
realm {
syncEnabled = true
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.xxxxsoftware.xxxx.xxxx"
minSdkVersion 16
targetSdkVersion 28
versionCode 36
versionName "2.8.17"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true
}
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation fileTree(include: ['*.jar'], dir: 'libs')
def appCenterSdkVersion = '1.9.0'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-push:${appCenterSdkVersion}"
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.zxing:core:3.3.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
implementation 'com.github.delight-im:Android-SimpleLocation:v1.0.1'
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'io.realm:android-adapters:3.0.0'
implementation 'androidmads.library.qrgenearator:QRGenearator:1.0.3'
implementation 'com.journeyapps:zxing-android-embedded:3.1.0#aar'
implementation 'com.github.pwittchen:reactivenetwork-rx2:2.0.0'
}
I have ran the command ./gradlew :app:dependencies and it prints out:
* What went wrong:
Project 'app' not found in root project 'ChimePassportAndroid'.
In order to use Firebase messaging, you need to add in your build.gradle file the corresponding dependency like this:
implementation 'com.google.firebase:firebase-messaging:17.3.4'
And your problem will be solved.