我正在尝试从 eclipse 切换到 android studio 以进行我的 android 开发。但是,我仍然没有找到导入现有项目的正确方法。我不知道这是否重要:但我使用的是 mac
我在eclipse中做了导出步骤,在Android Studio中导入了这个gradle构建,但是当我尝试构建我的项目时,它给了我这个错误:
Gradle:
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'assembleDebug' not found in project ':ProjectName'.
* Try:
Run gradle tasks to get a list of available tasks.
Could not execute build using Gradle installation '/Users/<username>/Development/Build/gradle-1.6'.
这是 eclipse 给我的 build.gradle 文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.+'
}
}
apply plugin: 'android'
dependencies {
compile project(':ProjectName:library:ActionBarSherlock')
compile project(':ProjectName:library:facebook')
compile files('../../../../../../../ProjectName/libs/gcm.jar')
compile files('../../../../../../../ProjectName/libs/libGoogleAnalyticsV2.jar')
compile files('../../../../../../../ProjectName/libs/commons-lang3-3.1.jar')
compile files('../../../../../../../ProjectName/libs/actionbarsherlock-plugin-maps-4.2.0.jar')
compile files('../../../../../../../NiteOwl/libs/volley.jar')
compile project(':ProjectName:library:PullToRefresh')
compile project(':ProjectName:library:google-play-services_lib')
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
我已经看到了很多可能的解决方案,但没有一个对我有用,知道我做错了什么吗?
项目路径中没有空格
jar 库 => 项目名称/库
android 库 => 项目名称/库
所有这些都在 Eclipse 中工作