Problem in build release APK with firebaseui:firebase-ui-firestore - android

I try to build a release version for my APK but there are problems in the build, and this what is shown in my build-out
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugAndroidTestCompileClasspath'.
> Could not find com.google.firebase:firebase-firestore:.
Required by:
project :app > com.firebaseui:firebase-ui-firestore:7.2.0
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
and this is my code Module build.gradle
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.firebase-perf'
id 'com.google.firebase.crashlytics'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example"
minSdkVersion 21
targetSdkVersion 30
versionCode 3
versionName "2.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
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'
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:20.0.0'
implementation 'com.google.firebase:firebase-config:21.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
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.daimajia.swipelayout:library:1.2.0#aar'
implementation 'com.airbnb.android:lottie:3.7.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'
// FireBase Start implementation
implementation 'com.google.firebase:firebase-ads:20.2.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.firebase:firebase-perf:20.0.1'
implementation 'com.google.firebase:firebase-crashlytics:18.1.0'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.firebaseui:firebase-ui-firestore:7.2.0'/*i think here is problem*/
implementation 'com.firebaseui:firebase-ui-database:7.2.0'
implementation 'com.google.firebase:firebase-bom:28.2.0'
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
// FireBase End implementation
implementation 'com.github.tapadoo:alerter:7.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20'
implementation 'com.pranavpandey.android:dynamic-toasts:4.0.0'
}
and this is project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.google.firebase:perf-plugin:1.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I try many things to solve it but the problem is still found and if you have notes in my build.gradle alert me and thanks

in the firebase documentation, they also mention adding below implementations
implementation "com.google.firebase:firebase-firestore:$X.Y.Z"
implementation "androidx.legacy:legacy-support-v4:$X.Y.Z"
implementation "androidx.recyclerview:recyclerview:$X.Y.Z"

Related

I have implemented retrofit library with gson but getting an importing error "Cannot resolve symbol 'Gson'"

I have implemented retrofit library with gson but getting an importing error.
Android studio version
Android Studio Arctic Fox | 2020.3.1 Patch 2 Build
#AI-203.7717.56.2031.7678000, built on August 27, 2021
App level build.gradle
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.example.app"
minSdk 21
targetSdk 31
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'
}
buildFeatures {
viewBinding true
dataBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:29.0.3')
// Declare the dependency for the Firebase Authentication library
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.android.gms:play-services-safetynet:18.0.0'
//Nav Component
implementation "androidx.fragment:fragment-ktx:1.3.6"
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
// Live Data
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
//Material Dialog
implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
//RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
//interceptor
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.7'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation "com.squareup.okhttp3:logging-interceptor:4.8.0"
implementation 'org.conscrypt:conscrypt-android:2.2.1'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Top-level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradel
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
rootProject.name = "Exaple app"
include ':app'
getting this error
I have already done some stuff like clean project, rebuild and invalidate caches, and restart. But still getting the same error.
Thanks in advance.
You need to implement also the GSON dependency
You missing this I'd say
implementation("com.google.code.gson:gson:2.8.9")

InvalidPluginRequestException Gradle AndroidStudio

I have imported existing android project after 2 months, and when it started to sync the gradle, it gave some strange error, because earlier the project was working properly.
The error is Caused by: org.gradle.plugin.management.internal.InvalidPluginRequestException: Plugin 'com.android.application' is already on the script classpath.
below is my gradle file :
build.gradle (:app)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.quickshop"
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.hbb20:ccp:2.5.0'
implementation 'com.steelkiwi:badge-holder-view:1.1.0'
implementation 'com.mikhaellopez:circularimageview:4.2.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
implementation 'me.himanshusoni.quantityview:quantity-view:1.2.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
implementation 'com.github.MindorksOpenSource:EditDrawableText:2.0'
implementation 'com.razorpay:checkout:1.6.6'
implementation 'in.shadowfax:proswipebutton:1.2.2'
implementation 'com.google.firebase:firebase-auth:20.0.4'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-config:19.0.3'
implementation 'com.google.firebase:firebase-messaging'
implementation platform('com.google.firebase:firebase-bom:26.8.0')
implementation 'com.firebaseui:firebase-ui-database:3.2.2'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.6.0'
implementation 'com.google.firebase:firebase-storage:19.2.1'
implementation 'cc.cloudist.acplibrary:library:1.2.1'
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.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.2'
implementation 'androidx.navigation:navigation-ui:2.3.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
build.gradle(project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.0.1"
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
}
settings.gradle
include ':app'
rootProject.name = "QuickShop"
I tried to find solution for this, but didnt find a proper solution that can resolve this issue, can anyone please help me with this and this new gradle plugin invocation.
android version : Android Studio Arctic Fox | 2020.3.1 Patch 3,
gradle version : 4.1,
Android gradle plugin version : 3.0.1

Android Studio Error in app with real-time firebase store

I am working on a project and have connected the app with firebase, in connecting real-time database now I am getting this error
"Could not create task ':app:processReleaseGoogleServices'. DefaultTaskContainer#NamedDomainObjectProvider.configure(Action) on task set cannot be executed in the current context"
These are the 2 Gradle files:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.imrankhan.fitnessapp"
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
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'com.google.firebase:firebase-firestore:23.0.3'
implementation 'com.google.firebase:firebase-database:20.0.1'
testImplementation 'junit:junit:4.13.2'
implementation 'com.google.android.material:material:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
apply plugin: 'com.google.gms.google-services'
**<File two code>**
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath 'com.google.gms:google-services:4.3.9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
While using the firebase bom, you don't need to include the individual firebase dependency versions or else that would result in overlaps and throw errors.
Replace the dependencies section with:
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.google.firebase:firebase-auth'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-database'
testImplementation 'junit:junit:4.13.2'
implementation 'com.google.android.material:material:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Just replace the dependency in build gradle 'com.google.gms:google-services:4.3.9' to 'com.google.gms:google-services:4.3.8' that's work for me.

Android studio could not resolve retrofit2 converter scalars 2.5.0

Android studio displays this strange error whenever I add some dependency to the grade file. It was working perfectly earlier. Further it displays no cached version of retrofit2 scalars available for offline mode.
Currently I tried almost all options from uninstalling and reinstalling android studio but no luck. I am running out of time so please help me resolve this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.protabler"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.preference:preference:1.1.0-alpha05'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Error:Could not find: vectordrawable-animated-1.1.0

I have a problem with gradle. it was working fine but all of sudden when I was rebuilding the project it gives me this error:
Could not find vectordrawable-animated-1.1.0.jar (androidx.vectordrawable:vectordrawable-animated:1.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/vectordrawable/vectordrawable-animated/1.1.0/vectordrawable-animated-1.1.0.jar
I can't find out what my problem is?
My app.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.pakagename"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.airbnb.android:lottie:3.4.1'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.loopj.android:android-async-http:1.4.10'
implementation 'com.github.mreram:showcaseview:1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.github.dhaval2404:imagepicker-support:1.5'
implementation 'com.github.aliab:Persian-Date-Picker-Dialog:1.5.2'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.mukeshsolanki:android-otpview-pinview:2.1.0'
implementation 'com.github.smarteist:autoimageslider:1.3.7-appcompat'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.jaiselrahman:FilePicker:1.3.2'
implementation 'ir.he.meowdatetimepicker:library:1.0.2'
implementation 'cat.ereza:customactivityoncrash:2.3.0'
}
and my build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url 'https://maven.google.com' }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/tapsellorg/maven' }
}
}
I guess this is due to not proper download of packages (sanctions and ...).
I did following steps and worked:
Connect to VPN
Remove caches and deamons folder from ~/.gradle.
Run gradlew clean inside android folder (cleaned project gradle).
Re run the project
first remove it from you library dependency
and download aar file from below link:
https://mvnrepository.com/artifact/androidx.vectordrawable/vectordrawable-animated/1.1.0

Categories

Resources