![]() MainActivity.kt import Ĭlass MainActivity : AppCompatActivity() : : Attempt to invoke virtual method '.ApplicationInfo ()' on a null object referenceĪt (ActivityThread.java:3042)Īt (ActivityThread.java:3282)Īt .execute(LaunchActivityItem.java:78)Īt .executeCallbacks(TransactionExecutor.java:108)Īt .execute(TransactionExecutor.java:68)Īt $H.handleMessage(ActivityThread.java:1970)Īt android.os.Handler.dispatchMessage(Handler.java:106)Īt android.os.Looper.loop(Looper.java:214)Īt (ActivityThread.java:7156)Īt .invoke(Native Method)Īt .RuntimeInit$n(RuntimeInit.java:494)Īt .ZygoteInit.main(ZygoteInit.java:975)Ĭaused by: : Attempt to invoke virtual method '.ApplicationInfo ()' on a null object referenceĪt (ContextWrapper.java:164)Īt (ContextThemeWrapper.java:157)Īt (Context.java:677)Īt .createSubDecor(AppCompatDelegateImpl.java:922)Īt .ensureSubDecor(AppCompatDelegateImpl.java:889)Īt .findViewById(AppCompatDelegateImpl.java:691)Īt .findViewById(AppCompatActivity.java:264)Īt .(MainActivity.kt:14)Īt (Native Method)Īt (AppComponentFactory.java:69)Īt .instantiateActivity(CoreComponentFactory.java:45)Īt (Instrumentation.java:1219)Īt (ActivityThread. I don't know what's happening here activity_main.xml This is happening for a new project that I create, if I go to open a past project before that issue happened that past project will run without any issue. : Attempt to invoke virtual method '.ApplicationInfo ()' on a null object reference That line is technically correct (again I never experienced the error before but by adding any sort of kotlin function or method. I noticed that previously Android would suggest an auto complete for it, but now it doesn't apply that auto-complete. It seems that the function is not recognized, but it's a pretty basic standard operation in android kotlin. Val button: Button = findViewById(R.id.button) everything will run and compile if I omit the line ![]() If you are not satisfied with the result of conversion, you can roll it back with Ctrl+Z. ![]() The resulting code is not supposed to be perfect, however, it may be helpful in some situations. I have an basic XML & KT file in Android Studio. IntelliJ IDEA allows you to automatically convert your Java code to Kotlin. Here's my code (see below, it's pretty basic) I am having a weird issue (I believe something is wrong with my Java JDK setup in android studio).Ĭontext: previously I never had that error before when running my apps on emulators.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |