Dagger-2: Field not injected Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Dagger 2 on Android: inject same dependency in Activity and retained FragmentAndroid Dagger 2 cannot resolve symbol builder()Dagger 2 injection not workingDagger and mvp - should presenter use dagger for injectionNot able to understand dagger dependency injection concepts - Dagger 2 on androidBroadcastReceiver in Android dagger 2.11How to Inject IntentService in Dagger2.11Dagger 2 returns null after injectionDagger2 injects null objectcannot be provided without an @Inject constructor or an @Provides-annotated method
How to compare two different files line by line in unix?
Can a party unilaterally change candidates in preparation for a General election?
Generate an RGB colour grid
Can anything be seen from the center of the Boötes void? How dark would it be?
How to convince students of the implication truth values?
Integration Help
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
Does classifying an integer as a discrete log require it be part of a multiplicative group?
Why wasn't DOSKEY integrated with COMMAND.COM?
Using audio cues to encourage good posture
Is the Standard Deduction better than Itemized when both are the same amount?
Significance of Cersei's obsession with elephants?
Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?
Why didn't Eitri join the fight?
8 Prisoners wearing hats
Should I use a zero-interest credit card for a large one-time purchase?
Why do we bend a book to keep it straight?
Fundamental Solution of the Pell Equation
How to tell that you are a giant?
What is the meaning of the simile “quick as silk”?
Did MS DOS itself ever use blinking text?
また usage in a dictionary
How do I stop a creek from eroding my steep embankment?
How come Sam didn't become Lord of Horn Hill?
Dagger-2: Field not injected
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Dagger 2 on Android: inject same dependency in Activity and retained FragmentAndroid Dagger 2 cannot resolve symbol builder()Dagger 2 injection not workingDagger and mvp - should presenter use dagger for injectionNot able to understand dagger dependency injection concepts - Dagger 2 on androidBroadcastReceiver in Android dagger 2.11How to Inject IntentService in Dagger2.11Dagger 2 returns null after injectionDagger2 injects null objectcannot be provided without an @Inject constructor or an @Provides-annotated method
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
My field for retrofit in this class is never injected into, it is still null when i run my code.
Here is my ServiceClass where I inject retrofit, have my api calls etc. I stripped it down for simplicity:
public class ServiceClass
@Inject
Retrofit retrofit;
public ServiceClass()
My module class for all network related dependencies:
@Module
public class NetworkModule
@Provides
@ApplicationScope
Retrofit getRetrofit(OkHttpClient okHttpClient, Gson gson)
return new Retrofit.Builder()
.baseUrl(URL.BASE_URL)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
@Provides
@ApplicationScope
OkHttpClient getOkHttpClient(Gson gson, HttpLoggingInterceptor httpLoggingInterceptor)
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
return okHttpClient;
@Provides
@ApplicationScope
HttpLoggingInterceptor getHttpLoggingInterceptor()
return new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC);
@Provides
@ApplicationScope
Gson getGson()
return new Gson();
My AppComponent this is my only component class:
@ApplicationScope
@Component(modules = NetworkModule.class)
public interface AppComponent
@Component.Builder
interface Builder
@BindsInstance
Builder application(MyApplication myApplication);
AppComponent build();
void inject(MyApplication myApplication);
Retrofit getRetrofit();
My Application class:
public class MyApplication extends Application
private AppComponent appComponent;
@Override
public void onCreate()
super.onCreate();
DaggerAppComponent
.builder()
.application(this)
.build()
.inject(this);
public AppComponent getAppComponent()
return appComponent;
I tried to fiddle around the code, I don't seem to manage to get it working properly. What am I missing here?
add a comment |
My field for retrofit in this class is never injected into, it is still null when i run my code.
Here is my ServiceClass where I inject retrofit, have my api calls etc. I stripped it down for simplicity:
public class ServiceClass
@Inject
Retrofit retrofit;
public ServiceClass()
My module class for all network related dependencies:
@Module
public class NetworkModule
@Provides
@ApplicationScope
Retrofit getRetrofit(OkHttpClient okHttpClient, Gson gson)
return new Retrofit.Builder()
.baseUrl(URL.BASE_URL)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
@Provides
@ApplicationScope
OkHttpClient getOkHttpClient(Gson gson, HttpLoggingInterceptor httpLoggingInterceptor)
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
return okHttpClient;
@Provides
@ApplicationScope
HttpLoggingInterceptor getHttpLoggingInterceptor()
return new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC);
@Provides
@ApplicationScope
Gson getGson()
return new Gson();
My AppComponent this is my only component class:
@ApplicationScope
@Component(modules = NetworkModule.class)
public interface AppComponent
@Component.Builder
interface Builder
@BindsInstance
Builder application(MyApplication myApplication);
AppComponent build();
void inject(MyApplication myApplication);
Retrofit getRetrofit();
My Application class:
public class MyApplication extends Application
private AppComponent appComponent;
@Override
public void onCreate()
super.onCreate();
DaggerAppComponent
.builder()
.application(this)
.build()
.inject(this);
public AppComponent getAppComponent()
return appComponent;
I tried to fiddle around the code, I don't seem to manage to get it working properly. What am I missing here?
How do you inject yourServiceClassentity?
– ror
Mar 8 at 18:51
You should be injecting it somehow, with your setup, likelyMyApplication.getInstance().getAppComponent().inject(myService)
– ror
Mar 8 at 18:52
@ror Can you explain a little, please? Where should I do this injection?
– Carlton
Mar 8 at 18:59
add a comment |
My field for retrofit in this class is never injected into, it is still null when i run my code.
Here is my ServiceClass where I inject retrofit, have my api calls etc. I stripped it down for simplicity:
public class ServiceClass
@Inject
Retrofit retrofit;
public ServiceClass()
My module class for all network related dependencies:
@Module
public class NetworkModule
@Provides
@ApplicationScope
Retrofit getRetrofit(OkHttpClient okHttpClient, Gson gson)
return new Retrofit.Builder()
.baseUrl(URL.BASE_URL)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
@Provides
@ApplicationScope
OkHttpClient getOkHttpClient(Gson gson, HttpLoggingInterceptor httpLoggingInterceptor)
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
return okHttpClient;
@Provides
@ApplicationScope
HttpLoggingInterceptor getHttpLoggingInterceptor()
return new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC);
@Provides
@ApplicationScope
Gson getGson()
return new Gson();
My AppComponent this is my only component class:
@ApplicationScope
@Component(modules = NetworkModule.class)
public interface AppComponent
@Component.Builder
interface Builder
@BindsInstance
Builder application(MyApplication myApplication);
AppComponent build();
void inject(MyApplication myApplication);
Retrofit getRetrofit();
My Application class:
public class MyApplication extends Application
private AppComponent appComponent;
@Override
public void onCreate()
super.onCreate();
DaggerAppComponent
.builder()
.application(this)
.build()
.inject(this);
public AppComponent getAppComponent()
return appComponent;
I tried to fiddle around the code, I don't seem to manage to get it working properly. What am I missing here?
My field for retrofit in this class is never injected into, it is still null when i run my code.
Here is my ServiceClass where I inject retrofit, have my api calls etc. I stripped it down for simplicity:
public class ServiceClass
@Inject
Retrofit retrofit;
public ServiceClass()
My module class for all network related dependencies:
@Module
public class NetworkModule
@Provides
@ApplicationScope
Retrofit getRetrofit(OkHttpClient okHttpClient, Gson gson)
return new Retrofit.Builder()
.baseUrl(URL.BASE_URL)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
@Provides
@ApplicationScope
OkHttpClient getOkHttpClient(Gson gson, HttpLoggingInterceptor httpLoggingInterceptor)
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.newBuilder().addInterceptor(httpLoggingInterceptor);
return okHttpClient;
@Provides
@ApplicationScope
HttpLoggingInterceptor getHttpLoggingInterceptor()
return new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC);
@Provides
@ApplicationScope
Gson getGson()
return new Gson();
My AppComponent this is my only component class:
@ApplicationScope
@Component(modules = NetworkModule.class)
public interface AppComponent
@Component.Builder
interface Builder
@BindsInstance
Builder application(MyApplication myApplication);
AppComponent build();
void inject(MyApplication myApplication);
Retrofit getRetrofit();
My Application class:
public class MyApplication extends Application
private AppComponent appComponent;
@Override
public void onCreate()
super.onCreate();
DaggerAppComponent
.builder()
.application(this)
.build()
.inject(this);
public AppComponent getAppComponent()
return appComponent;
I tried to fiddle around the code, I don't seem to manage to get it working properly. What am I missing here?
asked Mar 8 at 18:48
CarltonCarlton
98321638
98321638
How do you inject yourServiceClassentity?
– ror
Mar 8 at 18:51
You should be injecting it somehow, with your setup, likelyMyApplication.getInstance().getAppComponent().inject(myService)
– ror
Mar 8 at 18:52
@ror Can you explain a little, please? Where should I do this injection?
– Carlton
Mar 8 at 18:59
add a comment |
How do you inject yourServiceClassentity?
– ror
Mar 8 at 18:51
You should be injecting it somehow, with your setup, likelyMyApplication.getInstance().getAppComponent().inject(myService)
– ror
Mar 8 at 18:52
@ror Can you explain a little, please? Where should I do this injection?
– Carlton
Mar 8 at 18:59
How do you inject your
ServiceClass entity?– ror
Mar 8 at 18:51
How do you inject your
ServiceClass entity?– ror
Mar 8 at 18:51
You should be injecting it somehow, with your setup, likely
MyApplication.getInstance().getAppComponent().inject(myService)– ror
Mar 8 at 18:52
You should be injecting it somehow, with your setup, likely
MyApplication.getInstance().getAppComponent().inject(myService)– ror
Mar 8 at 18:52
@ror Can you explain a little, please? Where should I do this injection?
– Carlton
Mar 8 at 18:59
@ror Can you explain a little, please? Where should I do this injection?
– Carlton
Mar 8 at 18:59
add a comment |
2 Answers
2
active
oldest
votes
Update (previous information still valid) :
I have noticed you incorrectly build your component: you must add .networkModule(new NetworkModule()) after DaggerAppComponent.builder()
Make sure your private AppComponent appComponent is initialized too!
For field injection (I believe that's what you're after), you can write your constructor like this:
public ServiceClass()
MyApplication.getInstance().getAppComponent().inject(this)
Naturally, you should expose your appComponent entity somehow - the above is my guess (to expose appComponent entity via application entity).
PS.: better approach (and more readable too) is to avoid field injection at all and parametrize constructor (however it's not always possible, like for example if you inject into activity).
PSS.: your AppComponent should also have void inject(ServiceClass value);
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
add a comment |
There are multiple ways of injecting retrofit in ServiceClass
You have to make a separate
ComponentforServiceClasslike :-@Component(dependencies = AppComponent.class)
interface ServiceClassComponent
void injectServiceClass(ServiceClass serviceClass);
Or
you can just inject
ServiceClassinto your application component:-void injectServiceClass(ServiceClass serviceClass);
into your AppComponent
The dependencies keyword would include all the dependent components into your particular component that you would build.
Then in the constructor of ServiceClass you need to build the Component and inject it
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069267%2fdagger-2-field-not-injected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Update (previous information still valid) :
I have noticed you incorrectly build your component: you must add .networkModule(new NetworkModule()) after DaggerAppComponent.builder()
Make sure your private AppComponent appComponent is initialized too!
For field injection (I believe that's what you're after), you can write your constructor like this:
public ServiceClass()
MyApplication.getInstance().getAppComponent().inject(this)
Naturally, you should expose your appComponent entity somehow - the above is my guess (to expose appComponent entity via application entity).
PS.: better approach (and more readable too) is to avoid field injection at all and parametrize constructor (however it's not always possible, like for example if you inject into activity).
PSS.: your AppComponent should also have void inject(ServiceClass value);
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
add a comment |
Update (previous information still valid) :
I have noticed you incorrectly build your component: you must add .networkModule(new NetworkModule()) after DaggerAppComponent.builder()
Make sure your private AppComponent appComponent is initialized too!
For field injection (I believe that's what you're after), you can write your constructor like this:
public ServiceClass()
MyApplication.getInstance().getAppComponent().inject(this)
Naturally, you should expose your appComponent entity somehow - the above is my guess (to expose appComponent entity via application entity).
PS.: better approach (and more readable too) is to avoid field injection at all and parametrize constructor (however it's not always possible, like for example if you inject into activity).
PSS.: your AppComponent should also have void inject(ServiceClass value);
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
add a comment |
Update (previous information still valid) :
I have noticed you incorrectly build your component: you must add .networkModule(new NetworkModule()) after DaggerAppComponent.builder()
Make sure your private AppComponent appComponent is initialized too!
For field injection (I believe that's what you're after), you can write your constructor like this:
public ServiceClass()
MyApplication.getInstance().getAppComponent().inject(this)
Naturally, you should expose your appComponent entity somehow - the above is my guess (to expose appComponent entity via application entity).
PS.: better approach (and more readable too) is to avoid field injection at all and parametrize constructor (however it's not always possible, like for example if you inject into activity).
PSS.: your AppComponent should also have void inject(ServiceClass value);
Update (previous information still valid) :
I have noticed you incorrectly build your component: you must add .networkModule(new NetworkModule()) after DaggerAppComponent.builder()
Make sure your private AppComponent appComponent is initialized too!
For field injection (I believe that's what you're after), you can write your constructor like this:
public ServiceClass()
MyApplication.getInstance().getAppComponent().inject(this)
Naturally, you should expose your appComponent entity somehow - the above is my guess (to expose appComponent entity via application entity).
PS.: better approach (and more readable too) is to avoid field injection at all and parametrize constructor (however it's not always possible, like for example if you inject into activity).
PSS.: your AppComponent should also have void inject(ServiceClass value);
edited Mar 8 at 20:18
answered Mar 8 at 19:03
rorror
56439
56439
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
add a comment |
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
Thanks for your comment. I can't get instance of my application. Do I need Context to be able to access it?
– Carlton
Mar 8 at 20:03
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
@Carlton pls check my update, should help!
– ror
Mar 8 at 20:18
add a comment |
There are multiple ways of injecting retrofit in ServiceClass
You have to make a separate
ComponentforServiceClasslike :-@Component(dependencies = AppComponent.class)
interface ServiceClassComponent
void injectServiceClass(ServiceClass serviceClass);
Or
you can just inject
ServiceClassinto your application component:-void injectServiceClass(ServiceClass serviceClass);
into your AppComponent
The dependencies keyword would include all the dependent components into your particular component that you would build.
Then in the constructor of ServiceClass you need to build the Component and inject it
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
add a comment |
There are multiple ways of injecting retrofit in ServiceClass
You have to make a separate
ComponentforServiceClasslike :-@Component(dependencies = AppComponent.class)
interface ServiceClassComponent
void injectServiceClass(ServiceClass serviceClass);
Or
you can just inject
ServiceClassinto your application component:-void injectServiceClass(ServiceClass serviceClass);
into your AppComponent
The dependencies keyword would include all the dependent components into your particular component that you would build.
Then in the constructor of ServiceClass you need to build the Component and inject it
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
add a comment |
There are multiple ways of injecting retrofit in ServiceClass
You have to make a separate
ComponentforServiceClasslike :-@Component(dependencies = AppComponent.class)
interface ServiceClassComponent
void injectServiceClass(ServiceClass serviceClass);
Or
you can just inject
ServiceClassinto your application component:-void injectServiceClass(ServiceClass serviceClass);
into your AppComponent
The dependencies keyword would include all the dependent components into your particular component that you would build.
Then in the constructor of ServiceClass you need to build the Component and inject it
There are multiple ways of injecting retrofit in ServiceClass
You have to make a separate
ComponentforServiceClasslike :-@Component(dependencies = AppComponent.class)
interface ServiceClassComponent
void injectServiceClass(ServiceClass serviceClass);
Or
you can just inject
ServiceClassinto your application component:-void injectServiceClass(ServiceClass serviceClass);
into your AppComponent
The dependencies keyword would include all the dependent components into your particular component that you would build.
Then in the constructor of ServiceClass you need to build the Component and inject it
edited Mar 8 at 20:27
answered Mar 8 at 19:10
Santanu SurSantanu Sur
3,7443729
3,7443729
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
add a comment |
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
Thanks for your reply. Trying this I still have the same problem. It still does not get injected and the field is null, still.
– Carlton
Mar 8 at 20:01
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
You need to inject it in the constructor of service class
– Santanu Sur
Mar 8 at 20:26
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069267%2fdagger-2-field-not-injected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How do you inject your
ServiceClassentity?– ror
Mar 8 at 18:51
You should be injecting it somehow, with your setup, likely
MyApplication.getInstance().getAppComponent().inject(myService)– ror
Mar 8 at 18:52
@ror Can you explain a little, please? Where should I do this injection?
– Carlton
Mar 8 at 18:59