Hey guys how can I update to latest version because I cannot find the latest gradle-plugin. Can somone guide me on this?
build.gradle(ExampleApp)
buildscript {
ext {
kotlin_version = '1.6.10'
kotlin_serializtion_version = '1.5.21'
kotlin_coroutines_version = "1.6.0"
moshiVersion = "1.13.0"
retrofit2_version = "2.9.0"
okhttp3_version = "4.9.0"
mockk_version = "1.12.2"
picassoVersion = "2.71828"
lifecycle_version = "2.5.0"
koin_version = "3.2.0"
barcode_scanner_version = "16.1.1"
camerax_version = "1.0.0"
camera_view_version = "1.0.0-alpha22"
stripe_version = "19.1.0"
jacoco_version = "0.8.7"
room_version = "2.4.1"
glide_version = "4.12.0"
json_version = "20180813"
kotlin_reflect_version = "1.6.10"
compose_version = '1.2.0-rc03'
espresso_version = '3.4.0'
core_testing_version = '2.1.0'
pdf_view_version = '3.2.0-beta.1'
appboy_version = '21.0.0'
mp_chart_version = "3.1.0"
activity_compose = "1.5.0"
compose_material3 = "1.0.0-alpha14"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_serializtion_version"
classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.0'
}
}
plugins {
id "org.sonarqube" version "3.3"
}
apply from: "${rootDir}/config/sonarqube/sonarqube.gradle"
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://s3.amazonaws.com/salesforcesos.com/android/maven/release' }
maven { url 'https://mobile-sdk.jumio.com' }
maven { url "https://appboy.github.io/appboy-android-sdk/sdk" }
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
build.gradle(:app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.firebase.appdistribution'
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.example.app"
minSdkVersion 21
targetSdkVersion 33
.....
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
sourceSets {
test {
java.srcDirs =
[
"${project.projectDir}/src/test/java"
]
}
}
testOptions {
unitTests.returnDefaultValues = true
}
buildFeatures {
viewBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.2.0"
kotlinCompilerVersion kotlin_version
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.browser:browser:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation "androidx.fragment:fragment-ktx:1.5.0"
implementation 'com.google.android.play:core:1.10.3'
implementation 'com.google.android.material:material:1.5.0'
// kotlin atomic
implementation 'org.jetbrains.kotlinx:atomicfu:0.17.1'
//Kotlin extensions library for Play Core
implementation 'com.google.android.play:core-ktx:1.8.1'
//Android Kotlin extensions
implementation "androidx.core:core-ktx:1.8.0"
//Unit test
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-inline:3.4.0'
androidTestImplementation 'org.mockito:mockito-android:3.4.0'
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation "io.mockk:mockk:${mockk_version}"
testImplementation "org.json:json:$json_version"
//Moshi (JSON parser)
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"
//Retrofit2
implementation "com.squareup.retrofit2:retrofit:$retrofit2_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit2_version"
//Paging 3
implementation "androidx.paging:paging-runtime-ktx:3.1.1"
//Okhttp3
implementation "com.squareup.okhttp3:okhttp:$okhttp3_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version"
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3_version"
//Kotlin Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_coroutines_version"
//ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
//HTML parser
implementation 'org.jsoup:jsoup:1.12.1'
//Payments
implementation 'com.google.android.gms:play-services-wallet:19.1.0'
implementation "com.stripe:stripe-android:$stripe_version"
//Firebase
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-config-ktx'
implementation "com.google.firebase:firebase-messaging"
implementation "com.google.firebase:firebase-core"
//Pager indicator
implementation 'me.relex:circleindicator:2.1.4'
//Animations
implementation 'com.airbnb.android:lottie:3.2.2'
implementation 'pl.bclogic:pulsator4droid:1.0.3'
//Loading images
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
//View container which can wrap content
implementation 'com.google.android:flexbox:2.0.1'
//Phone Authentication
implementation 'com.google.android.gms:play-services-auth:20.1.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.7.0'
//Video player
implementation 'com.google.android.exoplayer:exoplayer:2.11.3'
//Dependency injection - Koin AndroidX Scope features
implementation "io.insert-koin:koin-android:$koin_version"
implementation "io.insert-koin:koin-androidx-workmanager:$koin_version"
testImplementation "io.insert-koin:koin-test-junit4:$koin_version"
testImplementation "io.insert-koin:koin-test:$koin_version"
//WorkManager
implementation "androidx.work:work-runtime-ktx:2.7.1"
// App Startup
implementation "androidx.startup:startup-runtime:1.1.0"
//Progress button extension
implementation 'com.github.razir.progressbutton:progressbutton:2.1.0'
//PDF Viewer
implementation "com.github.barteksc:android-pdf-viewer:$pdf_view_version"
//Amplitude
implementation 'com.amplitude:android-sdk:2.25.2'
//Salesforce chat
implementation "com.salesforce.service:chat-ui:4.2.2"
//Jumio
implementation "com.jumio.android:core:3.9.2#aar" // Jumio Core library
implementation "com.jumio.android:nv:3.9.2#aar" // Netverify library
implementation "com.jumio.android:nv-barcode:3.9.2#aar" // Barcode scanning
implementation "com.jumio.android:nv-mrz:3.9.2#aar" // MRZ scanning
//AppsFlyer
implementation 'com.appsflyer:af-android-sdk:6.2.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
// Code Scanner & Camera
implementation "com.google.mlkit:barcode-scanning:$barcode_scanner_version"
implementation "androidx.camera:camera-camera2:$camerax_version"
implementation "androidx.camera:camera-lifecycle:$camerax_version"
implementation "androidx.camera:camera-view:$camera_view_version"
// Braze (marketing push notifications)
implementation "com.appboy:android-sdk-ui:$appboy_version"
// Room
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
androidTestImplementation "androidx.room:room-testing:$room_version"
implementation "androidx.room:room-runtime:$room_version"
// Compose
implementation "androidx.compose.material3:material3:$compose_material3"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.activity:activity-compose:$activity_compose"
androidTestImplementation "androidx.compose.ui:ui-test:$compose_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
// MP Charts
implementation "com.github.PhilJay:MPAndroidChart:v$mp_chart_version"
// Testing dependencies
androidTestImplementation "androidx.arch.core:core-testing:$core_testing_version"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espresso_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
// Modules
lintChecks project(':lint')
// Miscellaneous
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_reflect_version"
//Memory leak analysis - should only run in dev builds (devqaImplementation)
//devqaImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
}
Getting this warning message, I updated already everything what I am missing can somone tell me?
We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32
This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
thanks
As this message is just a warning, if your build is working fine, I'd suggest you to suppress the warning and don't update your Android Gradle plugin for now. Upgrading this plugin can bring you more trouble than good.
The Android Gradle plugin is published to the Google's Maven repository at maven.google.com.
The plugin's listing with all its versions can be found here. You can pick a version of that list and test your build.
Just update the following line of your build.gradle file with the desired version:
dependencies {
classpath 'com.android.tools.build:gradle:<NEW_VERSION_HERE>'
...
}
Keep in mind that you might need to update your Android Studio to the Beta or Canary channels do be able to use the newer versions of that plugin without problems.
The follwing changes works for me:
Ctrl+Alt+Shift+S
In ProjectStructure change the
Modules / Properties / Compile SDK version / 33
Modules / Default Config / Target SDK version / 33
Modules / Default Config / Min SDK version / 33
Than choose an emulator with API 33, example: Pixel 6 API 33
Update plugins in build.gradle (project)
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
It works for me.
Related
I am using the Android canary 13(Bubble Bee). My problem is that I am unable to resolve any third part library. I have tried adding multiple different libraries but cannot resolve them during building project. When I sync the project after adding the library the project synced successfully by downloading the dependency but in the project that library cannot resolve and when I try to build the project it says as mention in the image
Below is the code of of build.gradle(app) file.
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'androidx.navigation.safeargs'
id 'com.google.gms.google-services'
id 'kotlin-kapt'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.ra.rightads"
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'
}
dataBinding {
enabled = true
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
def nav_version = "2.3.5"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.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'
// Navigation dependencies
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
implementation "androidx.navigation:navigation-compose:2.4.0-alpha10"
//Firebase dependencies
implementation "com.google.firebase:firebase-core:19.0.2"
implementation "com.google.firebase:firebase-auth:21.0.1"
implementation "com.google.firebase:firebase-firestore:23.0.4"
implementation "com.google.android.gms:play-services-auth:19.2.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.google.firebase:firebase-database:20.0.2'
implementation 'com.google.firebase:firebase-analytics:19.0.2'
implementation 'com.google.firebase:firebase-storage:20.0.0'
//Google material dependencies
implementation 'com.google.android.material:material:1.4.0'
// Picasso
implementation 'com.squareup.picasso:picasso:2.71828'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
// Okhttp
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
// Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
//Viewpager
implementation 'androidx.viewpager2:viewpager2:1.0.0'
//Hilt dependency
implementation("com.google.dagger:hilt-android:2.38.1")
//Multidex
implementation 'com.android.support:multidex:1.0.3'
//Kapt
kapt 'com.github.bumptech.glide:compiler:4.11.0'
// sdp and ssp for dp and sp values
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
// Image Cropper
// implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
}
Here is the code of my project level build.gradle file.Image cropper is the library I am currently trying to add.
// Top-level build file where you can add configuration options common to all sub-
projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com'
}
maven { url 'https://jitpack.io' }
}
dependencies {
def nav_version = "2.3.5"
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.google.gms:google-services:4.3.10'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath('com.android.support:multidex:1.0.3')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I need help and I need to resolve this error. Your help will be appreciated.
From looking at that project's page on GitHub, I see that it is no longer maintained. And since JCenter is shut down, you can't easily get the library using Maven/Gradle.
Someone has forked it and continues to develop it, so you can use that library instead.
Replace jcenter() with maven { url 'https://jitpack.io' } and replace 'com.theartofdev.edmodo:android-image-cropper:2.8.0' with 'com.github.CanHub:Android-Image-Cropper:3.3.5'.
today I started to experience some weird behavior in Android Studio 2020.3.1.
I get Unresolved Reference errors for all methods from Kotlin coroutines. I cannot narrow down this issue to any specific change I made. The code still compiles and my App works fine.
The only change that might be connected to this issue is that I created a new git branch a day before (everything worked fine though).
My build.gradle file looks like this:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 24
targetSdkVersion 31
versionCode 13
versionName "1.5.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas".toString())
}
}
kotlinOptions {
jvmTarget = '1.8'
}
compileOptions {
targetCompatibility = "8"
sourceCompatibility = "8"
}
}
buildFeatures {
viewBinding true
}
packagingOptions {
exclude 'META-INF/atomicfu.kotlin_module'
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/java/utilities'] } }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-reflect:1.5.31"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.5.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.viewpager2:viewpager2:1.0.0"
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Logcat
implementation 'com.squareup.logcat:logcat:0.1'
// Room components (SQL Wrapper)
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
implementation "androidx.room:room-ktx:$rootProject.roomVersion"
implementation "androidx.room:room-rxjava3:$rootProject.roomVersion"
kapt "androidx.room:room-compiler:$rootProject.roomVersion"
androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
// Paging
implementation "androidx.paging:paging-runtime-ktx:$rootProject.pagingVersion"
implementation "androidx.paging:paging-rxjava2-ktx:$rootProject.pagingVersion"
// Fragment
implementation "androidx.fragment:fragment-ktx:$fragment_version"
// Lifecycle components
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" // ViewModel
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" // LiveData
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" // Lifecycles only (without ViewModel or LiveData)
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version" // Saved state module for ViewModel
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" // Annotation processor"
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version" // optional - helpers for implementing LifecycleOwner in a Service
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version" // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version" // optional - ReactiveStreams support for LiveData
testImplementation "androidx.arch.core:core-testing:$arch_version" // optional - Test helpers for LiveData
// RxJava
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.0.2'
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.0'
// ViewModel Kotlin support
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.archLifecycleVersion"
// Coroutines
// api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutines"
// api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutines"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
implementation 'androidx.core:core-ktx:1.7.0'
// Location
implementation 'com.google.android.gms:play-services-location:18.0.0'
// Apache common math
implementation 'org.apache.commons:commons-math3:3.6.1'
// CameraX core library using the camera2 implementation
// The following line is optional, as the core library is included indirectly by camera-camera2
implementation("androidx.camera:camera-core:$rootProject.camerax_version")
implementation("androidx.camera:camera-camera2:$rootProject.camerax_version")
// If you want to additionally use the CameraX Lifecycle library
implementation("androidx.camera:camera-lifecycle:$rootProject.camerax_version")
// If you want to additionally use the CameraX View class
implementation("androidx.camera:camera-view:1.0.0-alpha30")
// If you want to additionally use the CameraX Extensions library
implementation("androidx.camera:camera-extensions:1.0.0-alpha30")
// FireBase
implementation platform('com.google.firebase:firebase-bom:28.4.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics-ktx'
}
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
ext {
roomVersion = '2.3.0'
pagingVersion = '3.0.1'
archLifecycleVersion = '2.2.0'
androidxArchVersion = '2.0.0'
coroutines = '1.2.0'
lifecycle_version = '2.4.0'
arch_version = '2.1.0'
fragment_version = '1.3.6'
camerax_version = "1.0.2"
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Things I have tried to resolve this:
Invalidated caches and restarted Android Studio
Sync gradle files again
Deleted .idea and .gradle folders
Switched to another git branch that worked fine before and where no changes were made
Restarted my PC
Now I am out of ideas of what to try. If anyone has an idea what the issue could be, I would be really grateful.
Edit:
If I edit kotlinx implementation in the build.gradle file to:
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2-native-mt'
the errors disappear, however, I do not understand why.
good evening, i am starting in android but the projects that I have downloaded to base myself on most of them throw me errors in the grandle does anyone know why I get error in almost all dependencies? already try to "update" them to their latest version in the gradle file, the project download it from git hub.
build. gradle (Proyect)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.gms:google-services:4.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (Module app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.bigohealth"
minSdkVersion 22
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'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
//implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
//androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
def lifecycle_version = "2.0.0"
def room_version = "2.2.0-alpha02"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.github.christophesmfvvFet:android_maskable_layout:v1.3.1'
implementation 'com trrf r.squareup.retrofit2:adapter-rxjava2:2.6.0'
implementation 'de. , tk./;cx v/8.c8x8hdodenhof:circleimageview:3.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
implementation 'com.squareup.retrofit2:converter-scalars:2.6.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.firebase:firebase-messaging:20.3.0'
implementation 'com.android.volley:volley:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation platform('com.google.firebase:firebase-bom:25.12.0')
implementation 'com.google.firebase:firebase-analytics'
}
apply plugin: 'com.google.gms.google-services'
Can you check, if you are under proxy and your android studio is able to connect to internet? Go to file>settings>type 'proxy' > in proxy settings there is a check connection button which will test if android studio is able to connect.
if there is a proxy, then provide the details and check again.
also make sure you do not have offline mode in your gradle settings turned on. Refer following screenshot:
Also your build tools are 4.0.1. Hope you should have the latest android studio too..
Why does val user = Firebase.auth.currentUser (which .currentUser) become invalid when I insert implementation 'com.google.firebase:firebase-admin:6.13.0' into Gradle?
Before importing implementation 'com.google.firebase:firebase-admin:6.13.0':
After importing implementation 'com.google.firebase:firebase-admin:6.13.0', auth's method become admin's method. It seems Firebase-admin conflicts with FirebaseAuth. Why?
File build.gradle (Module:app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.squall.searchdesigner"
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 = 1.8
targetCompatibility = 1.8
}
kotlinOptions {
jvmTarget = "1.8"
}
dataBinding {
enabled = true
} }
dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'
def room_version = "2.2.5"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:19.3.1'
implementation 'com.google.firebase:firebase-auth-ktx:19.3.1'
implementation 'com.google.firebase:firebase-firestore:21.4.3'
implementation 'com.google.firebase:firebase-storage:19.1.1'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:6.1.0'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:6.2.1'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:6.1.0'
implementation 'com.facebook.android:facebook-login:5.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//lifecycle
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0"
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
//navigation
implementation "androidx.navigation:navigation-fragment-ktx:2.2.2"
implementation "androidx.navigation:navigation-ui-ktx:2.2.2"
//Firebase cloud message
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.1.0'
//Room
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// For Kotlin use kapt instead of annotationProcessor
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
//coroutine
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7'
//Firebase Coroutine dependency:
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.6'
//Firebase firestore extension
implementation 'com.google.firebase:firebase-firestore-ktx:21.4.3'
implementation 'androidx.activity:activity-ktx:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
//Facebook SDK
implementation 'com.facebook.android:facebook-android-sdk:5.0.0'
implementation 'com.google.firebase:firebase-admin:6.13.0'
implementation 'com.google.firebase:firebase-functions-ktx:19.0.2' }
build.gradle(Project:)
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.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
}
CurrentUser only exists in the Firebase Android SDK. You cannot use both Android SDK and Admin SDK together. They have conflicting packages/classes. Specifically, you cannot use the Admin SDK in an Android or any client-side application.
After I updated to the newest plugin for kotlin I get this build error in my project
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method 1.8() for arguments [1.8] on object of type org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptionsImpl.
My gradle is,
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
def nav_version = "2.1.0"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Other file is
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs.kotlin'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8" JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.example.barrechat191"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)
}
dependencies {
def lifecycle_version = "2.1.0"
def nav_version = "2.1.0"
def paging_version = "2.1.1"
implementation 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
//Page Lib implementation and RecyclerView
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
// For Kotlin use paging-runtime-ktx
implementation 'com.android.support:recyclerview-v7:28.0.0'
//Implement Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
//Implement constraintLayout
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// Kotlin
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
// alternatively - just ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
// For Kotlin use lifecycle-viewmodel-ktx
// alternatively - just LiveData
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
// alternatively - Lifecycles only (no ViewModel or LiveData). Some UI
// AndroidX libraries use this lightweight import for Lifecycle
implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//Kotlin Coroutine support for ViewModel
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha01'
//Coroutine support for LiveData
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.0-alpha01'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01'
//Dependency Injection
api 'com.google.dagger:dagger:2.25.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.25.2'
//*******************************************
//************* A W S ******************
//*******************************************
// Mobile Client for initializing the SDK
implementation('com.amazonaws:aws-android-sdk-mobile-client:#aar') { transitive = true }
// Cognito UserPools for SignIn
implementation 'com.android.support:support-v4:28.0'
implementation('com.amazonaws:aws-android-sdk-auth-userpools:#aar') { transitive = true }
// Sign in UI Library
implementation 'com.android.support:appcompat-v7:28.0'
implementation('com.amazonaws:aws-android-sdk-auth-ui:#aar') { transitive = true }
//******************************************
//************ GOOGLE MAPS ****************
//******************************************
implementation name: 'maps-sdk-3.0.0-beta', ext: 'aar'
implementation 'com.google.android.gms:play-services-basement:17.2.1'
implementation 'com.google.android.gms:play-services-base:17.2.1'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
//******************************************
//**************** ROOM ********************
//******************************************
def room_version = "2.2.3"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
// For Kotlin use kapt instead of annotationProcessor
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"
implementation 'com.google.android.gms:play-services-maps:17.0.0'
/**
*
* TESTING ->
*
*/
testImplementation "androidx.room:room-testing:$room_version"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
implementation "com.github.drfonfon:android-kotlin-geohash:1.0"
}
Not sure what could be going wrong here. Everything worked fine until recent upgrade. Any ideas as to how to fix this issue?
I've tried going through and making sure everything was in sync and the correct version. But it still throws the same build error.
Try to use
android {
...
kotlinOptions {
jvmTarget = '1.8'
}
...
}
looks a bit strange
jvmTarget = "1.8" JavaVersion.VERSION_1_8