Error:(41, 0) Supplied String module notation '0.12.2' is invalid
19,185
Your script seems to be very old.
You should change the line classpath '0.12.2'
with:
classpath 'com.android.tools.build:gradle:0.12.2'
I am expecting that this script should have some other issues.
- Update your Android Studio to the latest stable release (2.1)
- use
apply plugin: 'com.android.application'
- use
classpath 'com.android.tools.build:gradle:2.1.0'
- update the gradle version (
gradle/wrapper/gradle-wrapper.properties
) withdistributionUrl = https\://services.gradle.org/distributions/gradle-2.10-all.zip
Author by
Faisal Shaikh
Updated on June 05, 2022Comments
-
Faisal Shaikh almost 2 years
I am importing Eclipse project into Android studio and while importing the project getting following error:
Error:(41, 0) Supplied String module notation '0.12.2' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'. Open File
Here is my build.gradle file:
apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile project(':appcompat') compile project(':cardview') } android { compileSdkVersion 21 buildToolsVersion '21.1.0' sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] } debug.setRoot('build-types/debug') release.setRoot('build-types/release') } } buildscript { dependencies { classpath '0.12.2' } repositories { mavenCentral() } } allprojects { repositories { mavenCentral() } }
I am getting error on the following line:
classpath '0.12.2'