You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Не получается проинициализировать VK в проекте на Kotlin. Всё делаю по инструкции. Создаю класс, наследуемый от Application(). В OnCreate инициализирую VK.initialize(applicationContext), каждый раз появляется ошибка Failed to initialize the VK SDK.
kotlin.UninitializedPropertyAccessException: lateinit property authManager has not been initialized at com.vk.api.sdk.VK.isLoggedIn(VK.kt:138) at com.vk.api.sdk.VK.initialize(VK.kt:222) at com.vk.api.sdk.internal.VKInitProvider.onCreate(VKInitProvider.kt:16) at android.content.ContentProvider.attachInfo([ContentProvider.java:2388](https://vk.com/away.php?to=http%3A%2F%2FContentProvider.java%3A2388&cc_key=)) at android.content.ContentProvider.attachInfo([ContentProvider.java:2358](https://vk.com/away.php?to=http%3A%2F%2FContentProvider.java%3A2358&cc_key=)) at android.app.ActivityThread.installProvider([ActivityThread.java:7246](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A7246&cc_key=)) at android.app.ActivityThread.installContentProviders([ActivityThread.java:6787](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A6787&cc_key=)) at android.app.ActivityThread.handleBindApplication([ActivityThread.java:6704](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A6704&cc_key=)) at android.app.ActivityThread.access$1300([ActivityThread.java:237](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A237&cc_key=)) at android.app.ActivityThread$H.handleMessage([ActivityThread.java:1913](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A1913&cc_key=)) at android.os.Handler.dispatchMessage([Handler.java:106](https://vk.com/away.php?to=http%3A%2F%2FHandler.java%3A106&cc_key=)) at android.os.Looper.loop([Looper.java:223](https://vk.com/away.php?to=http%3A%2F%2FLooper.java%3A223&cc_key=)) at android.app.ActivityThread.main([ActivityThread.java:7664](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A7664&cc_key=)) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run([RuntimeInit.java:592](https://vk.com/away.php?to=http%3A%2F%2FRuntimeInit.java%3A592&cc_key=)) at com.android.internal.os.ZygoteInit.main([ZygoteInit.java:947](https://vk.com/away.php?to=http%3A%2F%2FZygoteInit.java%3A947&cc_key=)) 2022-11-22 18:03:42.537 5308-5308/com.example.clientvk E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.clientvk, PID: 5308 java.lang.RuntimeException: Unable to create application com.example.clientvk.models.VKT: kotlin.UninitializedPropertyAccessException: lateinit property authManager has not been initialized at android.app.ActivityThread.handleBindApplication([ActivityThread.java:6724](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A6724&cc_key=)) at android.app.ActivityThread.access$1300([ActivityThread.java:237](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A237&cc_key=)) at android.app.ActivityThread$H.handleMessage([ActivityThread.java:1913](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A1913&cc_key=)) at android.os.Handler.dispatchMessage([Handler.java:106](https://vk.com/away.php?to=http%3A%2F%2FHandler.java%3A106&cc_key=)) at android.os.Looper.loop([Looper.java:223](https://vk.com/away.php?to=http%3A%2F%2FLooper.java%3A223&cc_key=)) at android.app.ActivityThread.main([ActivityThread.java:7664](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A7664&cc_key=)) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run([RuntimeInit.java:592](https://vk.com/away.php?to=http%3A%2F%2FRuntimeInit.java%3A592&cc_key=)) at com.android.internal.os.ZygoteInit.main([ZygoteInit.java:947](https://vk.com/away.php?to=http%3A%2F%2FZygoteInit.java%3A947&cc_key=)) Caused by: kotlin.UninitializedPropertyAccessException: lateinit property authManager has not been initialized at com.vk.api.sdk.VK.isLoggedIn(VK.kt:138) at com.vk.api.sdk.VK.initialize(VK.kt:222) at com.example.clientvk.models.VKT.onCreate(VKT.kt:9) at android.app.Instrumentation.callApplicationOnCreate([Instrumentation.java:1192](https://vk.com/away.php?to=http%3A%2F%2FInstrumentation.java%3A1192&cc_key=))
При этом на старых версиях SDK всё работает. Что я упустил?
The text was updated successfully, but these errors were encountered:
Здравствуйте.
Не получается проинициализировать VK в проекте на Kotlin. Всё делаю по инструкции. Создаю класс, наследуемый от Application(). В OnCreate инициализирую VK.initialize(applicationContext), каждый раз появляется ошибка Failed to initialize the VK SDK.
kotlin.UninitializedPropertyAccessException: lateinit property authManager has not been initialized at com.vk.api.sdk.VK.isLoggedIn(VK.kt:138) at com.vk.api.sdk.VK.initialize(VK.kt:222) at com.vk.api.sdk.internal.VKInitProvider.onCreate(VKInitProvider.kt:16) at android.content.ContentProvider.attachInfo([ContentProvider.java:2388](https://vk.com/away.php?to=http%3A%2F%2FContentProvider.java%3A2388&cc_key=)) at android.content.ContentProvider.attachInfo([ContentProvider.java:2358](https://vk.com/away.php?to=http%3A%2F%2FContentProvider.java%3A2358&cc_key=)) at android.app.ActivityThread.installProvider([ActivityThread.java:7246](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A7246&cc_key=)) at android.app.ActivityThread.installContentProviders([ActivityThread.java:6787](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A6787&cc_key=)) at android.app.ActivityThread.handleBindApplication([ActivityThread.java:6704](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A6704&cc_key=)) at android.app.ActivityThread.access$1300([ActivityThread.java:237](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A237&cc_key=)) at android.app.ActivityThread$H.handleMessage([ActivityThread.java:1913](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A1913&cc_key=)) at android.os.Handler.dispatchMessage([Handler.java:106](https://vk.com/away.php?to=http%3A%2F%2FHandler.java%3A106&cc_key=)) at android.os.Looper.loop([Looper.java:223](https://vk.com/away.php?to=http%3A%2F%2FLooper.java%3A223&cc_key=)) at android.app.ActivityThread.main([ActivityThread.java:7664](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A7664&cc_key=)) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run([RuntimeInit.java:592](https://vk.com/away.php?to=http%3A%2F%2FRuntimeInit.java%3A592&cc_key=)) at com.android.internal.os.ZygoteInit.main([ZygoteInit.java:947](https://vk.com/away.php?to=http%3A%2F%2FZygoteInit.java%3A947&cc_key=)) 2022-11-22 18:03:42.537 5308-5308/com.example.clientvk E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.clientvk, PID: 5308 java.lang.RuntimeException: Unable to create application com.example.clientvk.models.VKT: kotlin.UninitializedPropertyAccessException: lateinit property authManager has not been initialized at android.app.ActivityThread.handleBindApplication([ActivityThread.java:6724](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A6724&cc_key=)) at android.app.ActivityThread.access$1300([ActivityThread.java:237](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A237&cc_key=)) at android.app.ActivityThread$H.handleMessage([ActivityThread.java:1913](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A1913&cc_key=)) at android.os.Handler.dispatchMessage([Handler.java:106](https://vk.com/away.php?to=http%3A%2F%2FHandler.java%3A106&cc_key=)) at android.os.Looper.loop([Looper.java:223](https://vk.com/away.php?to=http%3A%2F%2FLooper.java%3A223&cc_key=)) at android.app.ActivityThread.main([ActivityThread.java:7664](https://vk.com/away.php?to=http%3A%2F%2FActivityThread.java%3A7664&cc_key=)) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run([RuntimeInit.java:592](https://vk.com/away.php?to=http%3A%2F%2FRuntimeInit.java%3A592&cc_key=)) at com.android.internal.os.ZygoteInit.main([ZygoteInit.java:947](https://vk.com/away.php?to=http%3A%2F%2FZygoteInit.java%3A947&cc_key=)) Caused by: kotlin.UninitializedPropertyAccessException: lateinit property authManager has not been initialized at com.vk.api.sdk.VK.isLoggedIn(VK.kt:138) at com.vk.api.sdk.VK.initialize(VK.kt:222) at com.example.clientvk.models.VKT.onCreate(VKT.kt:9) at android.app.Instrumentation.callApplicationOnCreate([Instrumentation.java:1192](https://vk.com/away.php?to=http%3A%2F%2FInstrumentation.java%3A1192&cc_key=))
The text was updated successfully, but these errors were encountered: