Import the project obtained from GitHub or the third party demo into Android studio and report an error. Plug in with ID ‘com. Android. Application’ not found; Today, I imported a demo of iFLYTEK to see the directory of the project is obviously wrong. I feel that there is a build. Gradle missing; Build. Gradle with only module and build. Gradle without project
The normal thing is this:
So Baidu circle, give the solution
1. Find a project that can be compiled normally or create a new project. Copy the code in build. Gradle in project, as shown in the figure below
2. Paste it into the build. Gradle of the error reporting project and put it at the bottom. The code below is as follows
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Paste position:
Once compiled, it will pass; Generally, the reason for this problem is that someone else threw the module directly
Similar Posts:
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Could not find com.android.tools.build:gradle:3.3.0.
- [Solved] Android Warning: Gradle DSL method not found: ‘android()’
- Error:(1, 0) Plugin with id ‘android’ not found.
- [Solved] Could not find com.android.tools.build:gradle:3.0.1
- [Solved] Could not find method google() for arguments [] on repository container,rn react-native-camera …
- Build failed for Android studio new project
- [Solved] Ionic3 Package Error: Could not resolve all files for configuration ‘:classpath’.
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- [Solved] Could not find com.android.tools.build:aapt2:3.2.1-4818971.