android


Dagger 2 robolectric test not compiling


I write some tests, but dagger 2 give me errors like this:
Error:(83, 90) error: incompatible types: MembersInjector cannot be converted to Provider
Error:(92, 70) error: method create in class ArtistAdapter_MembersInjector cannot be applied to given types;
required: Provider
found: MembersInjector,Provider
reason: actual and formal argument lists differ in length
I wrote test modules and component with using Mockito
PresenterTestModule
#Provides
#Singleton
Model provideModel() {
return mock(Model.class);
}
#Provides
CompositeSubscription provideCompositeSubscription() {
return new CompositeSubscription();
}
ModelTestModule
private TestUtils testUtils;
public ModelTestModule() {
testUtils = new TestUtils();
}
#Provides
#Singleton
ApiInterface provideApiInterface() {
return mock(ApiInterface.class);
}
#Provides
#Singleton
#Named(Const.UI_THREAD)
Scheduler provideSchedulerUI() {
return Schedulers.immediate();
}
#Provides
#Singleton
#Named(Const.IO_THREAD)
Scheduler provideSchedulerIO() {
return Schedulers.immediate();
}
#Provides
#Singleton
List<Artist> provideArtistList() {
Artist[] artists = testUtils.getGson().fromJson(testUtils.readString("raw/test.json"), Artist[].class);
return Arrays.asList(artists);
}
...
TestAppComponent
#Singleton
#Component(modules = {ModelTestModule.class, PresenterTestModule.class, ViewTestModule.class, AppTestModule.class, UtilsTestModule.class, PicassoTestModule.class})
public interface TestComponent extends AppComponent {
void inject(ArtistListPresenterTest presenterTest);
void inject(ModelImplTest modelImplTest);
}
I don't understand why test not compiled, i'm use this as example, but something going wrong
UPD: the problem is solved downgrade dagger 2 version from 2.2 to 2.0

Related Links

Unity3d android pluggin using exoplayer NoClassDefFoundError
Can I use both GCM and FCM in my app?
How do I ensure I don't use Google Analytics
Android Studio Working With Images
android tabs fragment navigation
Butterfly animation on Imageview Android [closed]
How to build AccountManager around Android killing the app process
Android add onclicklistener to JSONArray gridview
Saving log files to pc in Android Studio
making an imageview as tall as possible while keeping its ratio
Margin/padding in FrameLayout not going away
.2 second delay clicking Button on physical device but not emulator
How do I build only one class of Espresso Instrument APK file?
Change recyclerview's layout
How to use notification intent in Activity, when app is opened
how to add another function to change screen button?

Categories

HOME
cobalt
prism
eslint
apache-flink
webdriver
flex
components
obfuscation
knitr
seo
edge
entity-framework-core
nuget-package
iis-6
recordrtc
dkim
endeca
appcelerator-studio
rtf
endpoint
radgridview
do-while
mathprog
symfony-console
draft-js-plugins
xcode-ui-testing
licensing
flooding
scatter3d
kodi
erb
simplecv
papaparse
modalviewcontroller
yowsup
getlasterror
protege4
sim-toolkit
sql-server-ce
modernizr
health-monitoring
chef-solo
odoo-website
movilizer
sharp-snmp
android-checkbox
flask-login
optimizely
phpdbg
openrasta
netbeans6.8
remedy
trojan
janus
flyout
cvxpy
parfor
neon
nikeplus-api
rspec2
observablecollection
appscale
swizzling
embedding
phpwebsocket
spring-retry
state-restoration
rewrite
zscript
telepat
j-security-check
qtwebengine
grouping-sets
infosphere-spl
jbake
nsmenu
mobility
accesscontrolexception
spring-3
scrypt
ebay-lms
nevron
dolby-audio-api
superscrollorama
intersect
android-loadermanager
objectquery
predicatebuilder
convention
gobject-introspection
screen-size
landscape-portrait
update-statement
tmx
non-clustered-index
blender-2.49
dsl-tools
pbcopy
mathematical-typesetting
image-capture

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App