1. Are you ready for the Galaxy S20? Here is everything we know so far!

Retrofit2 NullPointerException Error

Discussion in 'Android Development' started by umtblbl, May 18, 2019.

  1. umtblbl

    umtblbl Member
    Thread Starter

    Hello friends, retrofit and trying to develop a simple weather app by reducing your dependencies using dagger2. I get the following error. You can view the project with github link.

    I am a beginner, I have little time left for my school project and delivery, I cannot proceed in the project, please help me :(

    Github Link: https://github.com/rumtblbl/LocationWeatherApp

    Error;
    -----------------------------------------
    com.example.locationweatherapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.locationweatherapp, PID: 9627
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.locationweatherapp/com.example.locationweatherapp.Ui.MainActivity.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.example.locationweatherapp.Data.DataManager.weatherCityNameService(java.lang.String, com.example.locationweatherapp.Data.Network.Service.ServiceCallBack)' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
    Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.example.locationweatherapp.Data.DataManager.weatherCityNameService(java.lang.String, com.example.locationweatherapp.Data.Network.Service.ServiceCallBack)' on a null object reference
    at com.example.locationweatherapp.Ui.MainActivity.MainActivityPresenter.getCityNameWeather(MainActivityPresenter.java:32)
    at com.example.locationweatherapp.Ui.MainActivity.MainActivity.onCreate(MainActivity.java:74)
    --------------------------------------------------
     


Loading...
Similar Threads - Retrofit2 NullPointerException Error
  1. pratappulugurta
    Replies:
    2
    Views:
    142
  2. M_Leonard
    Replies:
    1
    Views:
    250
  3. iswan12
    Replies:
    1
    Views:
    357
  4. anabeokai
    Replies:
    5
    Views:
    560
  5. АгентГосдепа
    Replies:
    0
    Views:
    633
  6. AKA001
    Replies:
    0
    Views:
    921
  7. Seran
    Replies:
    1
    Views:
    1,453
  8. Benvanj
    Replies:
    1
    Views:
    393
  9. umtblbl
    Replies:
    0
    Views:
    299
  10. karthikkumar cv
    Replies:
    6
    Views:
    1,202

Share This Page

Loading...