LƯU Ý: tôi không thể đăng liên kết, vì vậy tôi đoán bạn sẽ cần phải đi here để làm theo các tham chiếu. xin lỗi, không phải quy tắc của tôi."Cả đường dẫn lẫn baseDir đều không có chuỗi rỗng hoặc rỗng". lỗi khi nhập dự án gradle trong Android Studio 0.2.9
tôi nhận được lỗi sau khi cố gắng để nhập khẩu một dự án Android Studio 0.2.9:
Could not execute build using Gradle distribution
'http://services.gradle.org/distributions-snapshots/
gradle-1.8-20130830160653+0000-bin.zip'.
A problem occurred configuring project ':library'.
A problem occurred configuring project ':library'.
Failed to notify project evaluation listener.
Neither path nor baseDir may be null or empty
string. path='' basedir='<projects folder>/
drag-sort-listview/library'
Consult IDE log for more details (Help | Show Log)
dự án ban đầu là một dự án Maven (1). tôi đã mở nó trong Eclipse ADT, tạo ra một tập tin /librabry/build.gradle
theo hướng dẫn tại (2).
ADT Eclipse tạo build.gradle
trông giống như:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 7
buildToolsVersion "17.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['']
resources.srcDirs = ['']
aidl.srcDirs = ['']
renderscript.srcDirs = ['']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
tôi đã phải thay đổi dòng 6 từ
classpath 'com.android.tools.build:gradle:0.4'
để
classpath 'com.android.tools.build:gradle:0.5+'
để có được Android Studio để ngừng nói các phiên bản đã bị bỏ lỡ. tôi cũng đã thêm một tập tin /settings.gradle
chứa
include ':library'
và một tập tin /local.properties
với những nội dung
# This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/Applications/Android Studio.app/sdk
tôi sau đó đã cố gắng để nhập khẩu các tập tin /settings.gradle
bằng cách chọn nó trong 'File | Hộp thoại Nhập dự án ... '. tôi đã chọn 'Sử dụng Tự động nhập' và chọn 'Sử dụng trình bao bọc gradle với xác minh' được chọn trong hộp thoại (3). có thể xem toàn bộ mục nhập idea.log
tại (4).
bất kỳ trợ giúp nào sẽ được đánh giá cao, cảm ơn.