This is a follow up to my question here: Could not find com.android.tools.build:gradle:3.2.1. in a sample project from github
I am trying to compile the project given here: https://github.com/dakatso/SpeexExample
To get rid of gradle sync errors, I had to first change the project level gradle.build and gradle-wrapper.properties file. The changes made are as shown in the linked question and it's answer (Could not find com.android.tools.build:gradle:3.2.1. in a sample project from github)
I'm however getting errors in the app level gradle.build files in both the /library and /sample folders. I have tried to make some modifications but I get an error that says compileSdkVersion is not specified although it's specified in the file. I think this project was created using an older version of android studio and gradle, which do not apply to the latest android studio (4.0). Here are the app level build.gradle files (shows original code as well as my modifications):
build.gradle for /library:
// apply plugin: 'com.android.model.library' // ORIGINAL
apply plugin: 'com.android.library'
model {
android {
// compileSdkVersion = 24 // ORIGINAL
compileSdkVersion 26
buildToolsVersion = '24.0.0'
defaultConfig {
// ORIGINAL
// minSdkVersion.apiLevel = 9
// targetSdkVersion.apiLevel = 24
minSdkVersion 9
targetSdkVersion 26
}
sources {
main {
jni {
exportedHeaders {
srcDir 'src/main/jni/include'
}
}
}
}
ndk {
moduleName = 'speex'
platformVersion = '9'
toolchain = 'clang'
CFlags.add('-DFIXED_POINT')
CFlags.add('-DUSE_KISS_FFT')
CFlags.add('-DEXPORT=\"\"')
}
}
}
build.gradle for /sample:
// apply plugin: 'com.android.model.application' // ORIGINAL
apply plugin: 'com.android.application'
model {
android {
// compileSdkVersion = 24 // ORIGINAL
compileSdkVersion 26
buildToolsVersion = '24.0.0'
defaultConfig {
applicationId 'com.speex.speexsample'
// ORIGINAL
// minSdkVersion.apiLevel = 9
// targetSdkVersion.apiLevel = 24
minSdkVersion 9
targetSdkVersion 26
versionCode = 1
versionName = '1.0.0'
}
productFlavors {
create("arm") {
ndk.abiFilters.add("armeabi")
}
create("arm7") {
ndk.abiFilters.add("armeabi-v7a")
}
create("arm8") {
ndk.abiFilters.add("arm64-v8a")
}
create("x86") {
ndk.abiFilters.add("x86")
}
create("x86-64") {
ndk.abiFilters.add("x86_64")
}
create("mips") {
ndk.abiFilters.add("mips")
}
create("mips-64") {
ndk.abiFilters.add("mips64")
}
create("all")
}
}
}
dependencies {
// ORIGINAL
// compile fileTree(include: ['*.jar'], dir: 'libs')
// compile 'com.android.support:appcompat-v7:24.0.0'
// compile 'com.android.support:design:24.0.0'
// compile project(':library')
implementation fileTree(include: ['*.jar'], dir: 'libs')
// implementation 'com.android.support:appcompat-v7:24.0.0' // ORIGINAL
implementation 'com.android.support:appcompat-v7:26.0.0'
// implementation 'com.android.support:design:24.0.0' // ORIGINAL
implementation 'com.android.support:design:26.0.0'
implementation project(':library')
}
What should be modified in these files to get this project to compile?