I am trying to implement firebase crash analytics for my android app I added the dependencies as as shown in firebase site,I also added the googleservices.json. Now after making changes I installed my map and it crashes.
I have attached screenshot of logcat. Please help me.
build.gradle of app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.android.quotesapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.android.support:design:28.0.0'
implementation("androidx.recyclerview:recyclerview:1.2.1")
// For control over item selection of both touch and mouse driven selection
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
implementation 'com.squareup.picasso:picasso:2.71828'
implementation("com.android.volley:volley:1.2.0")
implementation "androidx.cardview:cardview:1.0.0"
implementation platform('com.google.firebase:firebase-bom:28.3.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Add the following in your gradle file:
apply plugin: 'com.google.firebase.crashlytics'
After
buildFeatures {
}
add
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Also add
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
Also in your project build.gradle if you have not added
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
in dependencies then do so
Related
When I build the project the error says,
What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.android.support:multidex:2.0.1.
my app build.gradle looks like this;
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 31
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.example.derepostelouest"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-auth:19.2.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.android.support:multidex:2.0.1'
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
// Cardview Library
implementation 'androidx.cardview:cardview:1.0.0'
}
Please someone somewhere help, I'm going nuts...
I have crossed the whole internet unsuccessfully.
My Android Studio Build fails with this error message, after updating several dependencies. I also switched from using "dataBinding{
enabled = true
}"
to "viewBinding true" I can't find a resolution for this anywhere. I already tried cleaning, rebuilding, invalidating caches and restarting the computer multiple times. Previous suggestions to similar questions didn't resolve this either. Do i have to start a new android studio project and copy over my code?
C:\Users\seric\AndroidStudioProjects\Futlytics\app\build\generated\data_binding_base_class_source_out\debug\out\com\futlytics\databinding\ToggleStyleBinding.java:7: error: cannot find symbol
import android.widget.selector;
I dont even use anything called ToggleStyleBinding.
My gradle files look like this:
Module
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.futlytics"
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
/*dataBinding{
enabled = true
}*/
buildFeatures {
mlModelBinding true
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//implementation 'androidx.navigation:navigation-fragment:2.3.4'
//implementation 'androidx.navigation:navigation-ui:2.3.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0'
implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'
implementation 'androidx.preference:preference-ktx:1.1.1'
// CameraX
implementation "androidx.camera:camera-camera2:1.1.0-alpha03"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha03"
implementation "androidx.camera:camera-view:1.0.0-alpha23"
//Firebase
implementation platform('com.google.firebase:firebase-bom:26.7.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-auth-ktx:20.0.3'
}
Projectapply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.futlytics"
minSdkVersion 22
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
/*dataBinding{
enabled = true
}*/
buildFeatures {
mlModelBinding true
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//implementation 'androidx.navigation:navigation-fragment:2.3.4'
//implementation 'androidx.navigation:navigation-ui:2.3.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0'
implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'
implementation 'androidx.preference:preference-ktx:1.1.1'
// CameraX
implementation "androidx.camera:camera-camera2:1.1.0-alpha03"
implementation "androidx.camera:camera-lifecycle:1.1.0-alpha03"
implementation "androidx.camera:camera-view:1.0.0-alpha23"
//Firebase
implementation platform('com.google.firebase:firebase-bom:26.7.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-auth-ktx:20.0.3'
}
Project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.31"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.4"
classpath 'com.google.gms:google-services:4.3.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I had this issue when accidentally placed xml with <selector> to "layout" folder (instead of "drawable"). Android Studio then tries to make a Binding for it as for layout.
build.gradle(:app) -> just change TRUE to FALSE. (idk what viewBiding does, but my quite advanced app works (again) without error)
buildFeatures {
viewBinding false
}
I have an aar library project, I am using it in a sample project. I added the relevant library to Maven Local Repository. When I check the Pom file, I can see it as Okhttp3 / logging / HttpLoggingInterceptor dependency. But i am facing with below screen shoot error. Any suggestions?
my parent app gradle file looks like above code
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.deneme"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.6'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.mylibrary:feature:1.0.15#aar'
implementation 'com.android.support:multidex:1.0.3'
}
My problem is that when the pom file is generated it generates incorrectly, I am actually having a problem on the wrong sub-mobule. After I fixed my pom settings my problem was resolved.
I'm trying to setup firebase on my android application when I install my app on emulator or real device firebase not recognize my installation and stick on forth step of installation of firebase (Run your app to verify installation)
I skip that but on install number or notification reciver count will not show my app.
funny thing is I implemented in a test project and it work.
this is my gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "netherland.com.app.vanlaartsoapp"
minSdkVersion 17
targetSdkVersion 29
versionCode 10
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0-alpha08'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.karumi:dexter:5.0.0'
implementation 'androidx.room:room-runtime:2.2.0-alpha01'
annotationProcessor "androidx.room:room-compiler:2.2.0-alpha01"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
}
apply plugin: 'com.google.gms.google-services'
be sure from adding google.json file to your project
I am using,
Android Studio Version - 3.3.2
minSdkVersion 19
targetSdkVersion 27
Kotling plugin :
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
kotlin build file :
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
In top level build-gradle
ext.kotlin_version = '1.3.21'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.27.1'
My Issue is Its giving me Lots of Kotlin Compiler Warning.
I have not issue with this warning but I want to add,
shrinkResources true
minifyEnabled true
in my application, but due to warning this giving me an error to solve warning first.
Please see my number of warning in screen shot, and if any have having solutions of it then please give ans here.
Edit
Following is my build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.myapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "10.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
debuggable false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
debuggable true
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
// Prevent OutOfMemory with MultiDex during the build phase
javaMaxHeapSize "4g"
}
dataBinding {
enabled = true
}
}
kapt {
generateStubs = true
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.facebook.android:facebook-login:4.39.0'
implementation 'com.amitshekhar.android:rx2-android-networking:1.0.2'
implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
implementation 'com.twitter.sdk.android:twitter:3.3.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation project(':multipleimageselect')
implementation 'com.github.bumptech.glide:glide:4.8.0'
// location
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'id.zelory:compressor:2.1.0'
annotationProcessor 'com.android.databinding:compiler:3.1.4'
implementation project(':library_slider')
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.flurry.android:analytics:11.5.0#aar'
implementation 'com.google.android.libraries.places:places:1.0.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.braintreepayments.api:braintree:1.7.10'
}
apply plugin: 'com.google.gms.google-services'