php logcat显示:system_server E添加资产路径失败是什么意思?

13z8s7eq  于 2024-01-05  发布在  PHP
关注(0)|答案(1)|浏览(160)

我做了一个应用程序,它使用翻新访问我的本地主机服务器和用户发布数据。从应用程序的代码工作,因为我尝试了我的虚拟设备和我的手机与网站https://jsonplaceholder.typicode.com/
php的作品,因为我尝试了它与 Postman 和它的作品
但是当我尝试连接时,我的logcat中出现此错误

  1. SDAgentPac...teReceiver system_server E Not going to handle 'com.example.retrofitviewsphpsql'!
  2. 2023-12-25 14:39:19.521 4227-4306 ResourcesManager system_server E failed to add asset path /data/app/com.example.retrofitviewsphpsql-MhzxSZfwEKBGUjg11dD7tA==/base.apk
  3. 2023-12-25 14:39:20.900 14882-14882 AppCompatDelegate com.example.retrofitviewsphpsql D Checking for metadata for AppLocalesMetadataHolderService : Service not found
  4. 2023-12-25 14:39:21.949 4227-4227 SDAgentPac...teReceiver system_server E Not going to handle 'com.example.retrofitviewsphpsql'!
  5. 2023-12-25 14:39:22.100 14882-14969 OpenGLRenderer com.example.retrofitviewsphpsql D HWUI GL Pipeline
  6. 2023-12-25 14:39:22.133 14882-14951 AndroidRuntime com.example.retrofitviewsphpsql E FATAL EXCEPTION: DefaultDispatcher-worker-1
  7. Process: com.example.retrofitviewsphpsql, PID: 14882
  8. java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found
  9. at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1332)
  10. at okhttp3.HttpUrl.get(HttpUrl.java:917)
  11. at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:506)
  12. at com.example.retrofitviewsphpsql.RetrofitInstance$api$2.invoke(RetrofitInstance.kt:11)
  13. at com.example.retrofitviewsphpsql.RetrofitInstance$api$2.invoke(RetrofitInstance.kt:9)
  14. at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
  15. at com.example.retrofitviewsphpsql.RetrofitInstance.getApi(RetrofitInstance.kt:9)
  16. at com.example.retrofitviewsphpsql.MainActivity$postRequest$1.invokeSuspend(MainActivity.kt:102)
  17. at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
  18. at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
  19. at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
  20. at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
  21. at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
  22. at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
  23. at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
  24. at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
  25. 2023-12-25 14:39:22.167 14882-14896 zygote com.example.retrofitviewsphpsql I Background concurrent copying GC freed 4750(1005KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 1654KB/3MB, paused 1.265ms total 132.302ms
  26. 2023-12-25 14:39:22.172 14882-14882 InputTransport com.example.retrofitviewsphpsql D Input channel constructed: fd=56

字符串
我已经环顾四周,致命的异常似乎是一些错误的协程,但'不打算处理'应用程序名称'是新的。
我已经检查了我试图访问的地址,

  1. const val BASE = "IP/MyApplication/v1/registerUser.php"


以及POST功能

  1. @POST("/posts")
  2. suspend fun createPost(
  3. @Body user: User
  4. ):Response<User>


是那些URL的问题吗?

9o685dep

9o685dep1#

网址的路径是错误的它需要基地需要这样

  1. "http://ip/appname/v1/"

字符串
@POST(“/namefile.php”)

相关问题