After importing Eclipse project to Android Studio. When you run the project, you may see following error message as, Gradle DSL not found: ‘android()’
Solution to fix this Gradle DSL method issue
open Top-level build.gradle file of the project
And remove the following code lines.
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
}
And then click Sync menu button, fixes the issue.
And another possible issue is,
Gradle DSL method not found: ‘runProguard()’
At times when you import a downloaded sample project in to Android Studio, see following error message as, Gradle DSL not found: ‘runProguard()’
Solution to fix this
open app’s build.gradle file of the project
In this file you can see following code snippet
buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }
In the above code runProguard false causing the issue. Change that line to
minifyEnabled false
Now click Sync menu button, issue will be fixed. I see the reason for this is runProguard has been renamed to minifyEnabled in version 0.14.0 or more in Gradle.
Hope it helps somebody. 😎
You may be also interested in
- Gradle error, Could not find method jcenter() for arguments [] on repository container
- gradle is not recognized as an internal or external command when installed Android Studio
- Could not resolve com.android.support:support-v4:22.0.0, Android Studio
- Add jar as library to Project, Android Studio
- Generate signed APK file with Specific name Android Studio
- com.android.dex.DexException: Multiple dex files define, Android Studio
One thought on “Gradle DSL method not found – Android Studio”
good