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

13z8s7eq  于 5个月前  发布在  PHP
关注(0)|答案(1)|浏览(34)

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

SDAgentPac...teReceiver system_server                        E  Not going to handle 'com.example.retrofitviewsphpsql'!
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
2023-12-25 14:39:20.900 14882-14882 AppCompatDelegate       com.example.retrofitviewsphpsql      D  Checking for metadata for AppLocalesMetadataHolderService : Service not found
2023-12-25 14:39:21.949  4227-4227  SDAgentPac...teReceiver system_server                        E  Not going to handle 'com.example.retrofitviewsphpsql'!
2023-12-25 14:39:22.100 14882-14969 OpenGLRenderer          com.example.retrofitviewsphpsql      D  HWUI GL Pipeline
2023-12-25 14:39:22.133 14882-14951 AndroidRuntime          com.example.retrofitviewsphpsql      E  FATAL EXCEPTION: DefaultDispatcher-worker-1
                                                                                                    Process: com.example.retrofitviewsphpsql, PID: 14882
                                                                                                    java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found
                                                                                                        at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1332)
                                                                                                        at okhttp3.HttpUrl.get(HttpUrl.java:917)
                                                                                                        at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:506)
                                                                                                        at com.example.retrofitviewsphpsql.RetrofitInstance$api$2.invoke(RetrofitInstance.kt:11)
                                                                                                        at com.example.retrofitviewsphpsql.RetrofitInstance$api$2.invoke(RetrofitInstance.kt:9)
                                                                                                        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
                                                                                                        at com.example.retrofitviewsphpsql.RetrofitInstance.getApi(RetrofitInstance.kt:9)
                                                                                                        at com.example.retrofitviewsphpsql.MainActivity$postRequest$1.invokeSuspend(MainActivity.kt:102)
                                                                                                        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
                                                                                                        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
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
2023-12-25 14:39:22.172 14882-14882 InputTransport          com.example.retrofitviewsphpsql      D  Input channel constructed: fd=56

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

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


以及POST功能

@POST("/posts")
    suspend fun createPost(
        @Body user: User
    ):Response<User>


是那些URL的问题吗?

9o685dep

9o685dep1#

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

"http://ip/appname/v1/"

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

相关问题