Androidx and Jetifier both are enabled in gradle.properties.
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
All the dependicies i'm using
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:retrofit:2.7.0'
implementation 'com.github.mukeshsolanki:country-picker-android:2.0.2'
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
}
minSDK is set to 21. This is the error build throws, i want my to use retrofit with androidx and minSDK 21, can some body help with this.
Error: Invoke-customs are only supported starting with Android O
(--min-api 26)
Related
I would like to use Open Source KorGE Game Engine.
I'm using Android Studio and I would like to know if anyone know how to import the library. I've installed the plugin following the setup documentation.
Could anyone show me how to setup right my build.gradle?
Thanks in Advance
UPDATE:
Following #soywiz suggestion this problem occurred:
UPDATE
Thanks to soywiz , now I can use KorGe In my Android Project.
Just set in build gradle:
buildscript {
repositories {
google()
jcenter()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") }
}
dependencies {
...
}
}
allprojects {
repositories {
mavenLocal()
maven { url = 'https://dl.bintray.com/korlibs/korlibs' }
google()
jcenter()
maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") }
}
}
and in build.gradle (app):
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.soywiz.korlibs.korge:korge-android:1.13.3'
implementation 'com.soywiz.korlibs.klock:klock-android:1.11.12'
implementation 'com.soywiz.korlibs.kmem:kmem-android:1.10.5'
implementation 'com.soywiz.korlibs.kds:kds-android:1.10.12'
implementation 'com.soywiz.korlibs.korma:korma-android:1.11.16'
implementation 'com.soywiz.korlibs.korio:korio-android:1.11.7'
implementation 'com.soywiz.korlibs.korim:korim-android:1.12.24'
implementation 'com.soywiz.korlibs.korau:korau-android:1.11.9'
implementation 'com.soywiz.korlibs.korgw:korgw-android:1.12.18'
implementation 'com.soywiz.korlibs.krypto:krypto-android:1.11.1'
implementation 'com.soywiz.korlibs.korinject:korinject-android:1.10.1'
implementation 'com.soywiz.korlibs.klogger:klogger-android:1.10.1'
}
The easiest way / most up-to-date way to find out the build.gradle requirements is to actually build a project using KorGE.
If you download this repo:
https://github.com/korlibs/korge-hello-world
Then execute:
./gradlew installAndroidDebug
This will create a folder called build/platforms/android containing a build.gradle file with all the details.
The important parts:
repositories {
// ...
maven { url = 'https://dl.bintray.com/korlibs/korlibs' }
// ...
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.soywiz.korlibs.korge:korge-android:1.13.3'
implementation 'com.soywiz.korlibs.klock:klock-android:1.11.12'
implementation 'com.soywiz.korlibs.kmem:kmem-android:1.10.5'
implementation 'com.soywiz.korlibs.kds:kds-android:1.10.12'
implementation 'com.soywiz.korlibs.korma:korma-android:1.11.16'
implementation 'com.soywiz.korlibs.korio:korio-android:1.11.7'
implementation 'com.soywiz.korlibs.korim:korim-android:1.12.24'
implementation 'com.soywiz.korlibs.korau:korau-android:1.11.9'
implementation 'com.soywiz.korlibs.korgw:korgw-android:1.12.18'
implementation 'com.soywiz.korlibs.krypto:krypto-android:1.11.1'
implementation 'com.soywiz.korlibs.korinject:korinject-android:1.10.1'
implementation 'com.soywiz.korlibs.klogger:klogger-android:1.10.1'
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'
}
All the dependencies might change in the future, so my advice is to trigger the hello world android build, so you get an up-to-date build.gradle file.
I wanted to port a kotlin project with gradle building from jvm to node.js. The build.gradle goes as follow:
plugins {
id 'org.jetbrains.kotlin.js' version '1.3.72'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
jcenter();
}
apply plugin: 'kotlin-kapt'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
testImplementation "org.jetbrains.kotlin:kotlin-test-js"
implementation 'org.apache.httpcomponents:httpclient:4.5.12'
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.2'
testCompile 'junit:junit:4.12'
}
kotlin.target.nodejs { }
but received the gradle build error
Could not find method kapt() for arguments [com.squareup.moshi:moshi-kotlin-codegen:1.9.2]
and while this works fine with kotlin(jvm) project. I wonder why and how to solve this problem.
Thanks in advance.
So I tried to connect my firebase database to my android studio application.I get this error:
Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is
available at
https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 9.0.0.
I changed the version but it still does not work. As you can see I changed the version 16.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
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'
}
I don't see the problem. I am stuck on this for hours.
Make sure You have gms classpath provided in your Project build.gradle, like this:
dependencies {
...
classpath 'com.google.gms:google-services:4.3.2'
}
I have this in my build.gradle(module:app) :
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-
layout:1.1.3'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
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:recyclerview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
}
and when I try to sync it displays this:
ERROR: Manifest merger failed : Attribute application#appComponentFactory
value=(android.support.v4.app.CoreComponentFactory) from
[com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0]
AndroidManifest.xml:22:18-86 value=
(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to
<application> element at AndroidManifest.xml:9:5-32:19 to override.
what can cause this and how do I fix it?
(adding tools:replace="android:appComponentFactory" to the manifest doesn't work)
Your android-image-cropper library is using androidx, while you haven't migrated yet. It is highly recommended to migrate to using Androidx, since most of the libraries are doing the same and may not provide backward compatibility to the com.android.support variants.
If you cannot migrate in the short term, then you can revert to a lower version of the library. As per the changelog, they migrated to AndroidX in 2.8.0, so you should go back to 2.7.0.
Iv'e suddenly got Unable to merge dex exception (My app worked perfectly until today). Iv'e tried clean and rebuild project with no success, also multiDexEnabled was true even before and still it doesn't work. my dependencies:
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
//noinspection UseOfBundledGooglePlayServices
implementation 'com.google.android.gms:play-services:11.8.0'
//noinspection GradleDynamicVersion
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
//noinspection GradleDynamicVersion
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
implementation 'com.squareup.picasso:picasso:2.5.2'