Firebase doesn't connect with my android application - android

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

Related

Why doesn't Android Studio see 'android.support.design.widget.CoordinatorLayout'?

I'm a beginner developer in Android. I included
'com.android.support:appcompat-v7:28.0.0' and 'com.android.support:design:28.0.0' in build.gradle.
build.gradle:
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.financialapp"
minSdk 27
targetSdk 32
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
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
}
I want to use `'android.support.design.widget.CoordinatorLayout' in the XML file but then there is an error.
error:
error: package android.support.design.widget does not exist
import android.support.design.widget.CoordinatorLayout;
Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with
this: Refactor > Migrate to AndroidX.
Old:
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
New:
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
Because you do not have dependency for material
inside your build.gradle(:app)
implementation 'com.google.android.material:material:1.4.0'

Android Error: "File 'root/res/drawable-mdpi/popup_bottom_medium.9.png' uses reserved file or directory name 'res'."

My Android project has error while producing signed APK as below.
File 'root/res/drawable-mdpi/popup_bottom_medium.9.png' uses reserved file or directory name 'res'.ere
It didn't appear when I make APK without sining.
I found popup_bottom_medium is in android sdk (android-28) but I dont know why the error is happening on this specific file.
Please kindly help us
let me put build.gradle in our code. Actually in this project, we using two self-made library. so totally we have three build.gradle.
build.gradle for app itself
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "0.0.2"
testInstrumentationRunner "android.support.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
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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 project(path: ':mylibrary')
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.parse.bolts:bolts-tasks:1.4.0'
implementation 'com.parse.bolts:bolts-applinks:1.4.0'
implementation project(path: ':ERSDKLogin')
implementation 'com.github.bumptech.glide:glide:4.4.0'
//noinspection GradleCompatible
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
// Measures against compile errors that occur when adding「'com.google.android.gms:play-services-maps:16.0.0' 」
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
//graphLibrary
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
build.gradle for library one
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// TODO Remove and fix lint issues
lintOptions {
abortOnError false
}
}
dependencies {
api project(':aws-android-sdk-core')
api project(':aws-android-sdk-cognitoidentityprovider')
api project(':facebook-common')
api project(':facebook-core')
api project(':facebook-login')
api 'com.google.android.gms:play-services-auth:16.0.1'
api 'com.squareup.retrofit2:retrofit:2.4.0'
api 'com.squareup.retrofit2:converter-jackson:2.4.0'
api 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
api 'com.squareup.okhttp3:logging-interceptor:3.10.0'
compileOnly 'org.projectlombok:lombok:1.16.22'
annotationProcessor 'org.projectlombok:lombok:1.16.22'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:${project.ext.supportLibraryVersion}"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}
repositories {
flatDir{
dirs 'libs'
}
}
build.gradle for library two
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.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 project(':ERSDKLogin')
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'no.nordicsemi.android.support.v18:scanner:1.0.0'
implementation 'no.nordicsemi.android:dfu:1.6.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.parse.bolts:bolts-tasks:1.4.0'
implementation 'com.parse.bolts:bolts-applinks:1.4.0'
implementation 'com.google.android.gms:play-services-fitness:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
}
I put my 9-patch files in the drawable folder, not the drawable-mdpi etc... folders. Try that and see if it helps.
file name change. eg popup_bottom_medium_9.png

Proguard fails to read android.jar

I just enable Proguard ( minifyEnabled true ) ... and when I try to build singed apk I get error :
Cause: invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b)
Exception while processing task java.io.IOException: Can't read [D:\AndroidStudio\AndroidStudioSDK\sdk\platforms\android-27\android.jar] (invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b))
my Gradle.app is :
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.test.app"
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "*****-****-****-****-***********",
onesignal_google_project_number: "REMOTE"]
minSdkVersion 19
targetSdkVersion 27
versionCode 8
versionName "1.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes.each {
it.buildConfigField 'String', 'SERVER_URL', serverUrl
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//ANDROID API
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
//Google API
implementation 'com.google.android.gms:play-services-ads:17.1.2'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-cast-framework:16.1.2'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
//Google Exo Player
implementation 'com.google.android.exoplayer:exoplayer:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.4'
//Google Firebase Api
implementation 'com.google.firebase:firebase-core:16.0.6'
//Other Libraries
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.github.ornolfr:rating-view:0.1.2#aar'
implementation 'cn.gavinliu.android.lib:ShapedImageView:0.8.4'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
implementation 'com.github.ixiDev:GDPRChecker:v0.2'
implementation 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
//OneSignal
implementation 'com.onesignal:OneSignal:3.9.1#aar'
//You Api
implementation files('libs/YouTubeAndroidPlayerApi.jar')
//Test Api
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'
}
apply plugin: 'com.google.gms.google-services'
So I don't change anything just minifyEnabled from false to true and I get the error.
invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b) means the file is corrupted.
you'd have to uninstall and reinstall API level 27 with the SDK manager, to get around that.
and probably consider getting a new drive - or at least check the integrity eg. with hddscan.

Can´t implement firebase-ui-auth

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
I´ve got this error and can´t solve it. I tried everything I found, but nothing worked. Do you have an idea.
I wanted to implement implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.alexa.oneline"
minSdkVersion 15
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
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'
//LifeData
implementation 'android.arch.lifecycle:extensions:1.1.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
//room db
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
//Firebase
implementation 'com.google.firebase:firebase-core:17.3.2'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
}
apply plugin: 'com.google.gms.google-services'
firebase-core latest version is: 16.0.4 but the Firestore version seems to be all good.
So, change your dependencies to:
//Firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
Then add;
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Right after:
apply plugin: 'com.google.gms.google-services'
In your build.gradle.

App crashes after upgrading dependencies to latest version in android

I am getting following error after upgrading my project to the latest dependencies
Didn't find class "com.google.android.gms.common.util.zzq" on
path: DexPathList[[zip
file "/system/framework/org.apache.http.legacy.boot.jar",
zip file "/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/lib/x86,
/system/lib]]"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.example"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled true
}
// buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:27.1.1'
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 'com.android.support:multidex:1.0.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
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.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
/*map place autosuggest*/
//for calendar class
implementation 'joda-time:joda-time:2.9.9'
implementation 'de.hdodenhof:circleimageview:2.2.0'
//QB dependecies
implementation 'com.quickblox:quickblox-android-sdk-core:3.8.1'
implementation('com.quickblox:quickblox-android-sdk-chat:3.8.0') {
transitive = true
}
implementation 'com.quickblox:chat-message-adapter:2.0'
implementation 'com.quickblox:quickblox-android-sdk-content:3.8.0'
implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.2#aar'
implementation 'com.github.orangegangsters:swipy:1.2.3#aar'
implementation project(':sample-core')
// implementation 'com.jwang123.flagkit:flagkit:1.0'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
//GoogleServicesPlugin.config.disableVersionCheck = true
Can anyone guide me how to solve this issue.
I have been searching stackoverflow from last two days for the solution of this issue. Please help.
Ensure that your top-level build.gradle contains a reference to the google() repo or to maven { url "https://maven.google.com" }.
remove this from your build.gradle file and sync again
apply plugin: 'com.google.gms.google-services'

Categories

Resources