[英]Service not working in Kotlin Multiplatform Application
我在 Android 本機部分為我的應用程序提供后端服務。 它工作正常,但突然停止工作。 我已經嘗試了所有方法並查看了每一段代碼,但沒有發現任何問題。
我正在從 Activiy 調用服務,如下所示:
Intent(this, TestService::class.java).also { intent ->
startService(intent)
AndroidManifest.xml:
<service
android:name=".Services.TestService"
android:enabled="true"
android:exported="true">
</service>
解決了問題。 問題是 Package 名稱應該只有小寫字母,然后它可以在 Manifest.XML 中正確注冊。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.