I am creating a kotlin-frontend/python-backend android app and want to use Chaquopy but I get the following error. Believe I followed the instructions on https://chaquo.com/chaquopy/doc/current/android.html#development correctly but I keep on getting this error. Thank you very much.
:app:generateDebugPythonMiscAssets
Could not resolve com.chaquo.python:target:3.8.1-7
Can you please let me know how to resolve this issue?
Gradles (app):
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'com.chaquo.python'
}
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.inprogress"
minSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
sourceSets {
main {
python {
srcDirs = ["replacement/dir"]
srcDir "additional/dir"
}
}
}
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
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'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//noinspection GradleDependency
implementation "com.squareup.okhttp3:okhttp:3.9.1"
//noinspection GradleDependency
implementation 'com.google.code.gson:gson:2.8.0'
}
Gradle (project):
buildscript {
ext.kotlin_version = "1.3.61"
repositories {
google()
jcenter()
maven { url "https://chaquo.com/maven" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0-alpha04'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.chaquo.python:gradle:7.0.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
}
Chaquopy doesn't support pre-release versions of the Android Gradle plugin, and you should have received a warning about that.
Here's how to fix the problem:
com.android.tools.build:gradle
to the stable Android Studio version (currently 3.6.3).When Chaquopy adds support for a new version of the Android Gradle plugin, it'll be announced in the change log and in this summary table.