Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка Failed to initialize the VK SDK #523

Open
Anthonython opened this issue Nov 26, 2022 · 1 comment
Open

Ошибка Failed to initialize the VK SDK #523

Anthonython opened this issue Nov 26, 2022 · 1 comment

Comments

@Anthonython
Copy link

Здравствуйте.

Не получается проинициализировать 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 всё работает. Что я упустил? 
@Anthonython
Copy link
Author

Изменил compileSdk с 32 на 33, проблема решилась.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant