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

how to detect whether the function has run finished?
multicastlock not working on Android 2.2 phone
If I'm setting the image for a button, where would I need to save the image in Eclipse?
Android PagerAdapter not calling instantiateItem
Populating listview in separate thread
Writing a login screen like default android pattern lock
Camera intent for ACTION_IMAGE_CAPTURE does not appear on Samsung Galaxy Nexus(4.0.2)
Android application current activity bring to front issue
Only one Looper may be created per thread
Phonegap|Android 4 - App sometimes crashes when taking picture from PHOTOLIBRARY
What in TtsService could explain the lack of onUtteranceCompleted() for playEarcon()?
Table Layout separation
Fragment Replace With ViewPager in ActionBar Tab
parse XML block by block in android
How to pass String containing Special character(&) via intent?
ActivityGroup in Tab - Back Button

Categories

HOME
url-redirection
azure-stream-analytics
fuelux
codenvy
angular-formly
3d
flex
camera
jwplayer
oracle-apex-5
jsf-2.2
simulink
permissions
iis-6
retrofit2
character
joomla3.0
qpython
syntaxnet
minecraft-forge
github-enterprise
alamofire
xcodebuild
azure-iot-hub
fileserver
forgot-password
google-content-api
mapstruct
sigma.js
nim
nodemcu
symbols
asciidoctor-pdf
user-experience
rubymotion
href
visual-studio-extensions
event-store
exploit
gmock
strongname
mount
dapper-extensions
licensing
oculus
paperjs
dst
zend-debugger
dumpbin
linkedhashmap
nested-lists
modalviewcontroller
sim-card
signals-slots
movilizer
photos
robomongo
fclose
bluez
payara-micro
static-cast
java-6
filehandle
css-transforms
gpg-signature
google-photos
jtree
swingworker
stax
nikeplus-api
beamer
jquery-jscrollpane
firebase-security
nss
turbo-prolog
invoke-sqlcmd
kendo-upload
relativelayout
assertion
pypiserver
flock
morton-number
pax-exam
sapscript
avahi
cakephp-2.7
uncaught-typeerror
addressing-mode
wcm
raygun
live555
matrix-inverse
radiant
gae-quotas
qscrollarea
windows-embedded-standard
high-resolution
spring-3
abstract-data-type
actiondispatch
mantle
robotlegs
box2d-iphone
expression-blend-4
drawtobitmap
mbeans
cgbitmapcontextcreate
inline-formset
instantiationexception
duplex
lalr
software-lifecycle
int64
product-management
blind

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