java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.suzanelsamahy.productsviewer/com.example.suzanelsamahy.productsviewer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.suzanelsamahy.productsviewer.POJO.Product.setPrice(double)' on a null object reference

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Stack Overflow by Suzy
, 1 year ago
Unable to start activity ComponentInfo{com.example.suzanelsamahy.productsviewer/com.example.suzanelsamahy.productsviewer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.suzanelsamahy.productsviewer.POJO.Product.setPrice(double)' on a null object reference
via Stack Overflow by Cris dois
, 5 months ago
Unable to start activity ComponentInfo{com.example.afcosta.inesctec.pt.android/com.example.afcosta.inesctec.pt.android.Login}: java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference
via Stack Overflow by The doctor
, 1 month ago
Unable to start activity ComponentInfo{com.mohana.pdc/com.mohana.pdc.NodeList}: java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference
via GitHub by kueda
, 1 year ago
Unable to start activity ComponentInfo{org.inaturalist.android/org.inaturalist.android.ObservationViewerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference
via Stack Overflow by saksham gulati
, 1 year ago
Unable to start activity ComponentInfo{saksham.geofencing/saksham.geofencing.MapsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference
via GitHub by derMart
, 1 year ago
Unable to start activity ComponentInfo{com.android.messaging/com.android.messaging.ui.appsettings.PerSubscriptionSettingsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.preference.Preference.onPrepareForRemoval()' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.suzanelsamahy.productsviewer/com.example.suzanelsamahy.productsviewer.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.suzanelsamahy.productsviewer.POJO.Product.setPrice(double)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 10 months ago
9 times, 11 months ago
6 times, 4 months ago
184 times, 10 months ago
16 times, 10 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.