问题描述
我一直在使用Android的工作室与Ubuntu 13.10没有问题一直。我决定更新到14.04,现在我无法得到Android的工作室工作。摇篮构建失败,并口口声声说错误:内容序言中不允许使用。我做的是从头开始创建一个新的项目。
- 的Ubuntu 14.04是从刚抹分区上安装
- 使用Android的工作室V5.7,虽然我也试过V4.6
- 在我安装了Oracle JDK,并据此设置$ JAVA_HOME路径
- 我apt-get会安装摇篮
-
我保证build.gradle有:
相关性{ 类路径com.android.tools.build:gradle:0.9.+ }
-
我已经试过
摇篮打造干净
。它的错误了太多。 - 在我试图清理/ Android的Studio中的改造项目。错误的。
错误报告:
[致命错误] OSS-家长7.pom:2:1:内容没有在序言中不允许的。
[致命错误] ProGuard的碱基4.10.pom:2:1:内容没有在序言中不允许的。
[致命错误]公共-COM preSS-1.0.pom:2:1:内容没有在序言中不允许的。
[致命错误] OSS-家长7.pom:2:1:内容没有在序言中不允许的。
[致命错误]的HttpCore-4.1.pom:2:1:内容没有在序言中不允许的。
[致命错误]共享记录-1.1.1.pom:2:1:内容没有在序言中不允许的。
失败:建立失败,一个例外。
* 什么地方出了错:
发生问题配置根项目ArrayAdapterEx。
>未能解决所有依赖关系配置:类路径。
应用build.gradle:
应用插件:'机器人'
安卓{
compileSdkVersion 19
buildToolsVersion19.0.3
defaultConfig {
的minSdkVersion 15
targetSdkVersion 19
版本code 1
VERSIONNAME1.0
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
推出 {
runProguard假
proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'ProGuard的-rules.txt
}
}
}
依赖{
编译文件树(导演:库,包括:['的* .jar'])
编译com.android.support:appcompat-v7:19.+
}
全球build.grade:
buildscript {
库{
mavenCentral()
}
依赖{
类路径com.android.tools.build:gradle:0.9.+
}
}
allprojects {
库{
mavenCentral()
}
}
您可以尝试清除您的摇篮缓存:摇篮干净--refresh依赖性
键,删除的内容〜/ .gradle /缓存
。应该有所帮助。
有关详细信息,请参阅http://stackoverflow.com/a/22670684/1243753
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'.
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()
}
}
You could try clearing your gradle cache: gradle clean --refresh-dependencies
and delete the contents of ~/.gradle/caches
. Should help.
For more details, see http://stackoverflow.com/a/22670684/1243753
这篇关于Android的工作室,摇篮错误。内容序言中不允许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!