**Could not parse the android application modules gradle config firebase.
I don't know what to do,this is the first project.And I really can't solve it.
I've seen quite a lot of people getting this error, but it seems that they could solve it by upgrading their build tool version, or by updating google-services. I've done all that and haven't been able to make it work so far.
Here are my Gradle scripts:**
build.gradle(project)
buildscript {
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20'
classpath 'com.google.gms:google-services:4.3.10'
}
}
allprojects {
repositories {
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(module)
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
}
apply plugin: 'kotlin-android'
android {
compileSdk 32
defaultConfig {
applicationId "com.example.simplechatkotlin"
minSdk 21
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
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures{
viewBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation platform('com.google.firebase:firebase-bom:30.0.0')
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-database:20.0.5'
implementation 'com.google.firebase:firebase-common-ktx:20.1.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 "androidx.core:core-ktx"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
The Kotlin Gradle plugin version should match the Kotlin version you're using, so it should be 1.6.21. And the latest build tools version is 7.1.2.
buildscript {
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
classpath 'com.google.gms:google-services:4.3.10'
}
}
Related
so guys i'm trying to launch my Android App , and that error face me.
ERROR : " Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.
"
build.gradle(Project)
buildscript {
repositories {
google()
jcenter()
maven {url 'https://jitpack.oi'}
}
dependencies {
classpath "com.android.tools.build:gradle:7.1.3"
classpath 'com.google.gms:google-services:4.3.10'
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.learn"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
multiDexEnabled true
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 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//for support screens
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
//Rounded imageView
implementation 'com.makeramen:roundedimageview:2.3.0'
//firebase
implementation 'com.google.firebase:firebase-messaging:23.0.3'
implementation 'com.google.firebase:firebase-firestore:24.1.1'
//MultiDex
implementation 'android.multidex:mutidex:2.0.1'
}
can any one help me.I was looking for a solution All day.
Change your 'android.multidex:mutidex:2.0.1' to 'androidx.multidex:multidex:2.0.1' like this:
dependencies {
...
//MultiDex
implementation 'androidx.multidex:multidex:2.0.1'
}
I have some problems with the android project, when I try to sync project with Gradle files, the console log, display this error
* What went wrong:
A problem occurred configuring root project 'GlobalApp'.
> Could not resolve all artifacts for configuration ':classpath.
> Could not resolve org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:0.5.1.
Required by:
project :
> Could not resolve org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:0.5.1.
> Could not get resource 'https://kotlin.bintray.com/kotlinx/org/jetbrains/kotlinx/kotlinx-gradle-serialization-plugin/0.5.1/kotlinx-gradle-serialization-plugin-0.5.1.pom'.
> Could not GET 'https://kotlin.bintray.com/kotlinx/org/jetbrains/kotlinx/kotlinx-gradle-serialization-plugin/0.5.1/kotlinx-gradle-serialization-plugin-0.5.1.pom'. Received status code 403 from server: Forbidden
And actually when I try to load de URL , https://kotlin.bintray.com/kotlinx/org/jetbrains/kotlinx/kotlinx-gradle-serialization-plugin/0.5.1/kotlinx-gradle-serialization-plugin-0.5.1.pom the response is a 403
I don't know if exist another repository or how to fix this?
They are my build.gradle files
buildscript {
ext.kotlin_version = '1.2.51'
ext.serialization_version = '0.5.1'
repositories {
google()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serialization_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlinx-serialization'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.sisvol.app.globalappkcr"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName '2.39.0'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "GlobalApp-JSM-ST8050B-$versionName")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version"
//implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:exifinterface: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 'com.android.support:design:28.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation files('libs/core-3.2.1.jar')
implementation files('libs/top-usdk-service-1.0.2.jar')
}
``
buildscript {
ext.kotlin_version = '1.2.51'
ext.serialization_version = '0.5.1'
repositories {
google()
mavenCentral()
maven { url "https://dl.bintray.com/kotlin/kotlinx/" }
}
Change the url of maven by: https://dl.bintray.com/kotlin/kotlinx/
I get a "Cannot resolve symbol" error whenever I try to import the classes below.
io.realm.ObjectServerError;
io.realm.SyncCredentials;
io.realm.SyncUser;
but not when I try to import
io.realm.RealmQuery;
io.realm.RealmResults;
io.realm.Realm;
I have added
realm{
syncEnabled = true
}
in my app build.gradle but it still shows the same error.
Here is my app build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
realm{
syncEnabled = true
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.ktoon"
minSdkVersion 17
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 fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Here is my project build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath "io.realm:realm-gradle-plugin:10.0.1"
// 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
}
What am I missing?
There was a number of breaking changes to the API in 10.0.0. Among them, SyncUser was renamed to io.realm.mongodb.User. See https://github.com/realm/realm-java/blob/master/CHANGELOG.md#1000-2020-10-15 for the full list
Full Error:
'Execution failed for task ':app:transformClassesWithMultidexlistForNoGPlayDebug'.
com.android.build.api.transform.TransformException: Error while generating the main dex list.'
I managed to successfully integrate Firebase into my app, but came across issues while attempting to implement Firebase Analytics. This error pops up after the compiler starts parsing my google-services.json file. Does anybody have any ideas on what might be causing the issue? Here are my project-level and app-level gradle files:
Project-Level
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.0'
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
project.ext {
supportVersion = "27.1.1"
sdkVersion = 27
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App-Level
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
repositories {
maven { url "https://dl.bintray.com/dasar/maven" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
mavenCentral()
google()
jcenter()
}
android {
compileSdkVersion project.sdkVersion
defaultConfig {
applicationId "com.digitalnode.quickpick"
minSdkVersion 19
targetSdkVersion project.sdkVersion
versionName "v1.1"
versionCode 17
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
abortOnError false
}
dexOptions {
jumboMode = true
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs {
release
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "app_name", "LeafPic"
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix ".debug"
resValue "string", "app_name", "QuickPic"
}
}
flavorDimensions "default"
productFlavors {
noGPlay {
dimension "default"
}
withGPlay {
dimension "default"
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//exifInterface
implementation "com.android.support:exifinterface:$supportVersion"
// google & support
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:palette-v7:$supportVersion"
implementation "com.android.support:customtabs:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
//exo-player
implementation 'com.google.android.exoplayer:exoplayer-core:2.6.0'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.6.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.6.0'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.6.0'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.6.0'
// utils
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.12'
implementation 'com.github.Commit451:bypasses:1.1.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.drewnoakes:metadata-extractor:2.11.0'
implementation "com.orhanobut:hawk:2.0.1"
implementation 'com.commonsware.cwac:provider:0.4.3'
// rxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
//it is recommended to keep the same version of rxAndroid
implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
// implementation 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
// icons
implementation 'com.mikepenz:iconics-core:3.0.3#aar'
implementation "com.mikepenz:iconics-views:3.0.3#aar"
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original#aar'
implementation 'com.mikepenz:community-material-typeface:2.0.46.1#aar'
implementation 'com.mikepenz:fontawesome-typeface:4.7.0.2#aar'
// ui
implementation 'uz.shift:colorpicker:0.5#aar'
implementation 'com.github.jetradarmobile:desertplaceholder:1.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.yalantis:ucrop:2.2.2'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'com.github.HoraApps:Liz:-SNAPSHOT'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
// debug Only
//debugCompile project(':inappstoragereader')
implementation 'cat.ereza:customactivityoncrash:2.2.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
// TODO check them out
implementation 'com.turingtechnologies.materialscrollbar:lib:10.0.3'
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.3'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.android.gms:play-services-analytics:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.android.gms:play-services-ads:17.1.0'
}
Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('KEY_ALIAS') && props.containsKey('PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
apply plugin: 'com.google.gms.google-services'
Try downgrading play-service-ads to 16.0.0.
In my case it solves the issue.
In my Android project (Kotlin), I want to use Room persistent library for my DATA LAYER.
But when I added dependencies for Room Persistent library suddenly build projects start failing.
Error which I am receiving:
Here is my project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
globalCompileSdkVersion = 26
globalMinSdkVersion = 19
globalTargetSdkVersion = 26
kotlin_version = '1.2.10'
support_version = "27.0.2"
constraint_layout_version = "1.0.2"
view_animator_version = "1.0.5"
junit_version = "4.12"
runner_version = "1.0.1"
espresso_core_version = "3.0.1"
room_version = "1.0.0"
dagger_version = "2.13"
rxJavaVersion = "2.1.7"
rxAndroidVersion = "2.0.1"
libs = [
appCompatV7 : "com.android.support:appcompat-v7:$support_version",
rxJava : "io.reactivex.rxjava2:rxjava:$rxJavaVersion",
rxAndroid : "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion",
junit : "junit:junit:$junit_version",
runner : "com.android.support.test:runner:$runner_version",
espressoCore: "com.android.support.test.espresso:espresso-core:$espresso_core_version"
]
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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
}
Here is my app module build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion project.globalCompileSdkVersion
defaultConfig {
applicationId "com.keepsafe.app"
minSdkVersion project.globalMinSdkVersion
targetSdkVersion project.globalTargetSdkVersion
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation libs.appCompatV7
implementation "com.android.support:design:$support_version"
implementation "com.android.support.constraint:constraint-layout:$constraint_layout_version"
implementation "com.github.florent37:viewanimator:$view_animator_version"
implementation "com.google.dagger:dagger:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
implementation libs.rxJava
implementation libs.rxAndroid
testImplementation libs.junit
androidTestImplementation libs.runner
androidTestImplementation libs.espressoCore
implementation project(":data")
implementation project(":domain")
}
Here is my domain module build.gradle
apply plugin: 'java-library'
apply plugin: 'kotlin'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation libs.rxJava
implementation libs.rxAndroid
implementation libs.junit
}
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
Here is my data module build.gradle
apply plugin: 'com.android.library'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
android {
compileSdkVersion project.globalCompileSdkVersion
defaultConfig {
minSdkVersion project.globalMinSdkVersion
targetSdkVersion project.globalTargetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "android.arch.persistence.room:runtime:$room_version"
implementation "android.arch.persistence.room:rxjava2:$room_version"
kapt "android.arch.persistence.room:compiler:$room_version"
testImplementation libs.junit
implementation project(":domain")
}
repositories {
mavenCentral()
}
I don't know how to resolve this issue.
Your help will be appreciated.
Android Gradle Plugin 3.0 and higher added a new behaviour for dependencies. You can read more about this here. Long story short, by using implementation in a submodule you're not sharing a dependency with a consumer module(your app module). Thus, it's not possible to generate the code needed for Room.
Essentially, what you need to do is simply change implementation to api in your data module for the Room's dependencies. The result will be:
api "android.arch.persistence.room:runtime:$room_version"
api "android.arch.persistence.room:rxjava2:$room_version"