I try to setup the android app Winlator (https://github.com/brunodev85/winlator) on Android Studio, but I always get the error "A problem occurred evaluating root project 'app'. Plugin with id 'com.android.application' not found." from the build.grade (app) file.
How I can I fix it?
apply plugin: 'com.android.application'
android {
compileSdk 30
buildToolsVersion '30.0.3'
defaultConfig {
applicationId 'com.winlator'
minSdkVersion 26
targetSdkVersion 28
versionCode 12
versionName "6.0"
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a'
}
}
}
lintOptions {
checkReleaseBuilds false
}
externalNativeBuild {
cmake {
version '3.22.1'
path 'src/main/cpp/CMakeLists.txt'
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.github.luben:zstd-jni:1.5.2-3@aar'
implementation 'org.tukaani:xz:1.7'
implementation 'org.apache.commons:commons-compress:1.20'
}
I tried different project setting and always failed.
This project only has one single module-level
build.gradle, while the root-projectbuild.gradle, which loads the plugins onto the class-path, is absent. Just take such one from another project and drop it into the directory above - or configure the repositories in asettings.gradle, for example:In particular, without the instruction
include ':app', Android Studio will ignore the module altogether. Beside that, you still need to add a root-levelbuild.gradle, with apluginsblock.This would load the current AGP 8.3.1 onto the plugin class-path (in the added
build.gradle):This subsequently requires the current version of Android Studio (needs to match).
Further reading: Android Gradle Plugin: Configure your build