您的項目結構的其餘部分是什麼樣的?
具體來說,你讀過的Android工作室的RoboBlender wiki
後來的版本將在默認情況下,產生落入Configuring RoboBlender for a large application using libraries
-category的項目。下面
修復執行以下操作:
- 中的build.gradle
- 用品指針在項目GuiceModule
- 基本的模塊,爲您的項目重新排列依賴性
diff --git a/app/build.gradle b/app/build.gradle
index 1e69cec..8450fff 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -34,9 +34,9 @@ android {
}
dependencies {
- provided 'org.roboguice:roboblender:3.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.roboguice:roboguice:3.0'
+ provided 'org.roboguice:roboblender:3.0'
}
project.tasks.withType(JavaCompile) { task ->
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 017d11e..dba9e49 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -8,6 +8,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="roboguice.annotations.packages" android:value="org.jush.roboguice3test"/>
+ <meta-data android:name="roboguice.modules" android:value="org.jush.roboguice3test.GuiceModule"/>
<activity
android:name="org.jush.roboguice3test.MainActivity"
android:label="@string/app_name" >
package org.jush.roboguice3test;
import android.app.Application;
import com.google.inject.AbstractModule;
public class GuiceModule extends AbstractModule {
private Application application;
public GuiceModule(Application application) {
this.application = application;
}
@Override
protected void configure() {
}
}
我增加了編譯器參數和元數據在Android清單。 您可以在以下網址找到完整的項目:https://github.com/jush/RoboGuice3Test 錯誤仍然是:「路徑上沒有找到類」org.jush.roboguice3test.AnnotationDatabaseImpl「:/ data/app/org .jush.roboguice3test-1.apk「 – jush 2014-10-30 21:05:56
'''AndroidManifest.xml''缺少類似'''meta-data android:name =」roboguice.modules「android:value =」org.jush.roboguice3test。 GuiceModule「/>'''然後在你的項目中創建該模塊。它可能很空虛。 – 2014-10-30 21:13:25
感謝您的建議,但它並沒有幫助,即使我添加它:https://github.com/jush/RoboGuice3Test/commit/0726a14e447b81b5fd003fde0f0d03957a96e9e8 – jush 2014-10-30 21:44:40