I've been using Android Studio with Ubuntu 13.10 no problem. I decided to update to 14.04 and now I can't get Android Studio working. Gradle fails to build and keeps saying Error: Content not allowed in Prolog. All I'm doing is creating a new project from scratch.
- Ubuntu 14.04 was installed from a freshly wiped partition
- Using Android Studio v5.7, though I also tried v4.6
- I installed Oracle JDK and set the $JAVA_HOME path accordingly
- I've apt-get installed gradle
I've ensured build.gradle has:
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
I've tried gradle build clean
. It errors out too.
- I've tried clean/rebuild project within Android Studio. Errors out.
Error report:
[Fatal Error] oss-parent-7.pom:2:1: Content is not allowed in prolog.
[Fatal Error] proguard-base-4.10.pom:2:1: Content is not allowed in prolog.
[Fatal Error] commons-compress-1.0.pom:2:1: Content is not allowed in prolog.
[Fatal Error] oss-parent-7.pom:2:1: Content is not allowed in prolog.
[Fatal Error] httpcore-4.1.pom:2:1: Content is not allowed in prolog.
[Fatal Error] commons-logging-1.1.1.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'ArrayAdapterEx'.
> Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.squareup:javawriter:2.2.1.
Required by:
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2
Could not parse POM http://repo1.maven.org/maven2/com/squareup/javawriter/2.2.1/javawriter-2.2.1.pom
Could not resolve org.sonatype.oss:oss-parent:7.
Could not parse POM http://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Content is not allowed in prolog.
Could not resolve net.sf.proguard:proguard-base:4.10.
Required by:
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > net.sf.proguard:proguard-gradle:4.10
Could not parse POM http://repo1.maven.org/maven2/net/sf/proguard/proguard-base/4.10/proguard-base-4.10.pom
Content is not allowed in prolog.
Could not resolve org.apache.commons:commons-compress:1.0.
Required by:
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2 > com.android.tools:sdklib:22.7.2
Could not parse POM http://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.0/commons-compress-1.0.pom
Content is not allowed in prolog.
Could not resolve com.google.guava:guava:15.0.
Required by:
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2 > com.android.tools:common:22.7.2
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.lint:lint:22.7.2 > com.android.tools.lint:lint-checks:22.7.2 > com.android.tools.lint:lint-api:22.7.2 > com.android.tools.external.lombok:lombok-ast:0.2.2
Could not parse POM http://repo1.maven.org/maven2/com/google/guava/guava/15.0/guava-15.0.pom
Could not resolve com.google.guava:guava-parent:15.0.
Could not parse POM http://repo1.maven.org/maven2/com/google/guava/guava-parent/15.0/guava-parent-15.0.pom
Could not resolve org.sonatype.oss:oss-parent:7.
Could not parse POM http://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Content is not allowed in prolog.
Could not resolve org.apache.httpcomponents:httpcore:4.1.
Required by:
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2 > com.android.tools:sdklib:22.7.2 > org.apache.httpcomponents:httpclient:4.1.1
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2 > com.android.tools:sdklib:22.7.2 > org.apache.httpcomponents:httpmime:4.1
Could not parse POM http://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
Content is not allowed in prolog.
Could not resolve commons-logging:commons-logging:1.1.1.
Required by:
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2 > com.android.tools:sdklib:22.7.2 > org.apache.httpcomponents:httpclient:4.1.1
:ArrayAdapterEx:unspecified > com.android.tools.build:gradle:0.9.2 > com.android.tools.build:builder:0.9.2 > com.android.tools:sdklib:22.7.2 > org.apache.httpcomponents:httpmime:4.1
Could not parse POM http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
Content is not allowed in prolog.
App build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
Global build.grade:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…