简体   繁体   English

服务在 Kotlin 多平台应用程序中不起作用

[英]Service not working in Kotlin Multiplatform Application

I have Backend service my Application in Android native part.我在 Android 本机部分为我的应用程序提供后端服务。 It was working fine but suddenly stoped working.它工作正常,但突然停止工作。 I have tried everything and looked into every piece of code but not found any issue.我已经尝试了所有方法并查看了每一段代码,但没有发现任何问题。

I am calling service from Activiy as follows:我正在从 Activiy 调用服务,如下所示:

Intent(this, TestService::class.java).also { intent ->
startService(intent)

AndroidManifest.xml: AndroidManifest.xml:

<service
android:name=".Services.TestService"
android:enabled="true"
android:exported="true">
</service>

Solved the Problem.解决了问题。 The issue was the Package name should be of only small letters then it can register properly in Manifest.XML.问题是 Package 名称应该只有小写字母,然后它可以在 Manifest.XML 中正确注册。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM