我在项目中插入了一个模块作为库。该模块使用Dagger2。
apply plugin: 'com.android.library'
apply plugin: 'com.neenbedankt.android-apt'
.
.
//dagger for DI
apt 'com.google.dagger:dagger-compiler:2.0.2'
provided 'javax.annotation:jsr250-api:1.0'
作为一个应用程序,它工作正常,但作为一个库模块,我得到这个错误:
Error:(7, 46) error: cannot find symbol class DaggerApplicationComponent
Error:(8, 46) error: cannot find symbol class DaggerHomeActivityComponent
Error:(21, 46) error: cannot find symbol class DaggerProfileComponent
Error:(27, 46) error: cannot find symbol class DaggerSearchComponent
Error:(27, 46) error: cannot find symbol class DaggerShareFeedComponent
等等!有没有人知道组合库模块和匕首有什么问题?
非常感谢...
编辑:
在包含actionbarsherlock之后,我收到了以下错误:
Error:(146) Attribute "titleTextStyle" has already been defined
Error:(146) Attribute "subtitleTextStyle" has already been defined
Error:(146) Attribute "divider" has already been defined
Error:(146) Attribute "background" has already been defined
Error:(146) Attribute "backgroundSplit" has already been defined
.
.
.
这里是来自模块build.gradle的依赖项:
compile 'com.android.support:palette-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
// compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.colintmiller:simplenosql:0.5.1'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'me.iwf.photopicker:PhotoPicker:0.2.8@aar'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.soundcloud.android:android-crop:1.0.1@aar'
compile 'jp.wasabeef:glide-transformations:1.3.1'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
compile 'net.danlew:android.joda:2.9.2'
compile 'com.github.danylovolokh:hashtag-helper:1.1.0'
// compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
对于测试,我已停用 Google Play服务和 appcombat ...
有什么想法吗?