Closed IanusInferus closed 4 years ago
Yes, you are right. Gradle version should match Android Gradle Plugin version. On first open, we should set gradle version as you did.
For everyone cloning that project, with Android studio 4, I needed to :
Android Gradle project version
from 3.3.2 to 4.01 : https://stackoverflow.com/a/63206864
Error was Unable to find method 'org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;'.
gradle.properties
in root project folder with : android.useAndroidX=true
Error was This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
FAILURE: Build failed with an exception.
Failed to notify project evaluation listener. 'org.gradle.api.file.DirectoryProperty org.gradle.api.file.ProjectLayout.directoryProperty(org.gradle.api.provider.Provider)'
This is the SDK version, which is too old. You are advised to update it. For example: For the project structure, set Android Gradle Plugin Version to 4.1.2 ,Gradle Version 6.5. sync project with gradle files
When gradle\wrapper\gradle-wrapper.properties and related files are not included in the repo, on first open, Android Studio will create one by itself, but with a wrong gradle version(gradle-6.1.1-all.zip on Android 4.0.1), causing:
Gradle version must match Android Gradle Plugin version. For com.android.tools.build:gradle:3.3.2, gradle-4.10.1-all.zip is required.
https://developer.android.com/studio/releases/gradle-plugin?buildsystem=ndk-build#updating-gradle