I want to compile an open source android project (Netguard) using gradel (gradlew clean build) But I encountered this Error:
A problem occurred
To fix it like i did
Android Studio File> project structure and go to project
change Gradle version to 4.6 & Android plugin version to 3.2.1
check screenshot
then clean project if you got this Error "Could not find aapt2-proto.jar"
go to build.gradle (project)
Try moving the google() method (.gradle file) to the top of its execution block the order of repositories it searches in that causes the issue.
for example, change this:
repositories {
maven { url 'https://maven.fabric.io/public' }
google() <=== from here
mavenCentral()
}
To this:
repositories {
google() <=== to here
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
Make those changes in both "buildscript" and "allprojects "
check screenshot
If you didn't find google() add it