我试图通过Eclipse上的Gradle导出项目。
http://tools.android.com/tech-docs/new-build-system/migrating-from-eclipse-projects
当我将其导入Android Studio时,我收到错误:
错误:(18,0)原因:启动失败: 构建文件'/ Users / clxxxii / Downloads / l'espace de travail / clxxxii - PMv5 / build.gradle':18:意外令牌:espace @第18行,第35列。 编译项目(':下载:l'espace de travail:appcompat_v7') ^
1错误
如果我评论那行代码,(我想我可以像从AS创建的项目那样使用appcompat_v7),它只是找到下一个“compile project()”并找到要抛出的错误。
如何正确导入项目以避免出现这些错误?我不使用build.gradle导入项目吗?
这是文件:
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral() // or jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':android-sdks:extras:google:google_play_services:libproject:google-play-services_lib')
compile project(':Downloads:Android Group Chat App using Sockets:android-websockets-master')
compile project(':Downloads:JakeWharton-ViewPagerIndicator-8cd549f:library')
compile project(':Downloads:BaseGameUtils')
compile project(':Downloads:polljoy-android-master:PolljoySDK')
compile project(':Downloads:l'espace de travail:appcompat_v7')
}
dependencies {
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
}
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
/////////
这里有变化..并且有相同的错误..
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral() // or jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.google.android.gms:play-services:6.5.87'
compile ':Downloads:Android Group Chat App using Sockets:android-websockets-master'
compile ':Downloads:JakeWharton-ViewPagerIndicator-8cd549f:library'
compile ':Downloads:BaseGameUtils'
// compile ':Downloads:l'espace de travail:appcompat_v7'
compile project(":Downloads:l'espace de travail:appcompat_v7")
}
答案 0 :(得分:0)
尝试替换
':Downloads:l'espace de travail:appcompat_v7'
使用:
":Downloads:l'espace de travail:appcompat_v7"