我想在我的Android項目中使用這個realtime-android項目作爲庫,但是當我嘗試導入這個項目時,它給了我這個「找不到可導入的項目」。不能使用realtime-android庫
那麼如何使用它作爲一個庫? 謝謝你的幫助。 這個的build.gradle:
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':appcompat_v7')
compile project(':gridlayout_v7')
compile 'com.goodow.realtime:realtime-android:0.5.0'
}
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
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')
}
}
你使用Gradle,還是你下載它作爲JAR? –
我已經從github上下載了這個項目,但是我無法將它導入到我的工作空間中,將它作爲庫添加到我當前的項目中。 – SDH
爲什麼你需要從Github下載項目? –