```FATAL EXCEPTION: main Process: com.example.myap...
# getting-started
t
Copy code
FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 15928
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3757)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4010)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:111)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2466)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:240)
	at android.os.Looper.loop(Looper.java:351)
	at android.app.ActivityThread.main(ActivityThread.java:8381)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
	at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:212)
	at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:174)
	at android.content.Context.obtainStyledAttributes(Context.java:861)
	at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:922)
	at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889)
	at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:691)
	at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:264)
	at com.example.myapplication.MainActivity.<init>(MainActivity.kt:23)
	at java.lang.Class.newInstance(Native Method)
	at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
	at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
	at android.app.Instrumentation.newActivity(Instrumentation.java:1347)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3744)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4010) 
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:111) 
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2466) 
	at android.os.Handler.dispatchMessage(Handler.java:106) 
	at android.os.Looper.loopOnce(Looper.java:240) 
	at android.os.Looper.loop(Looper.java:351) 
	at android.app.ActivityThread.main(ActivityThread.java:8381) 
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) 
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
I am getting this error while trying to run the project in my android device. Have tried everything on stackoverflow and github issues. Please help me 🙏
1
Thanks for the help guys!, i fixed it. It was a data binding issue