java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mohamed_pc.test2/com.example.mohamed_pc.test2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.le.BluetoothLeAdvertiser android.bluetooth.BluetoothAdapter.getBluetoothLeAdvertiser()' 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

,

Create an empty public constructor in your code.

Solutions on the web

via Stack Overflow by MORagab
, 1 year ago
Unable to start activity ComponentInfo{com.example.mohamed_pc.test2/com.example.mohamed_pc.test2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.le.BluetoothLeAdvertiser android.bluetooth.BluetoothAdapter.getBluetoothLeAdvertiser()' on a null object reference
via Stack Overflow by Kapparino
, 1 year ago
Unable to start activity ComponentInfo{MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.SupportMapFragment.getMapAsync(com.google.android.gms.maps.OnMapReadyCallback)' on a null object reference
via GitHub by Traumhaftt
, 8 months ago
Unable to start activity ComponentInfo{MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
via Stack Overflow by Alex Karvouniaris
, 2 years ago
Unable to start activity ComponentInfo{com.alexkarvou.proj_1/com.alexkarvou.proj_1.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by Sujith Sizon
, 11 months ago
Unable to start activity ComponentInfo{com.sujithsizon.lzlogin3/com.sujithsizon.lzlogin3.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
via Stack Overflow by rawan taban
, 4 months ago
Unable to start activity ComponentInfo{samaa.example.com.opencv249/samaa.example.com.opencv249.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mohamed_pc.test2/com.example.mohamed_pc.test2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.le.BluetoothLeAdvertiser android.bluetooth.BluetoothAdapter.getBluetoothLeAdvertiser()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)

Users with the same issue

66 times, 4 weeks ago
Once, 2 months ago
33 times, 3 months ago
8 times, 4 months ago
468 times, 4 months ago

Write tip

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