Closed Manavjain25 closed 3 years ago
As shown in the documentation, the python
and ndk
blocks should be inside the defaultConfig
block.
Unfortunately this kind of error message has become much less helpful in the newest version of Android Studio.
@mhsmith , Actually I didn't post the whole code . This is the whole code .
defaultConfig {
applicationId "com.example.helloworld"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
sourceSets{
main{
python{
srcDirs = ["src/main/python"]
}
}
}
python{
buildPython "C:\\Users\\Python39\\python.exe"
buildPython "python3"
}
ndk{
abiFilters "armeabi-v7a","x86"
}
}
As shown in the documentation, the sourceSets
block should not be within defaultConfig
.
But src/main/python
is actually the default directory, so you don't need the sourceSets
block at all. Just delete it.
If that still doesn't work, make sure you've applied the Chaquopy plugin correctly.
@mhsmith thanks a lot
Hey , I am getting an error - No signature of method: build_2y9jex6zynqwuovvyp05096wt.android() is applicable for argument types: (build_2y9jex6zynqwuovvyp05096wt$_run_closure1) values: [build_2y9jex6zynqwuovvyp05096wt$_run_closure1@5a340d39] My code :-
Pls help !