Код: Выделить всё
public ResponseEntity getPosts()Я попробовал вызвать его с помощью клиента Retrofit2 с этой реализацией реализации 'com.squareup.retrofit2:retrofit :2.11.0' и в PostService.java моего приложения я попробовал что-то вроде этого
Код: Выделить всё
@GET("v1/profiles/gigio/posts")
Response getPosts();
Код: Выделить всё
@GET("v1/profiles/gigio/posts")
Call getPosts();
Код: Выделить всё
// retrieve posts for home page from server
postService = RetrofitClient.getClient().create(PostService.class);
Call call = postService.getPosts();
Код: Выделить всё
2024-08-05 20:01:23.621 29123-29123 example.app com.example.app A runtime.cc:699] JNI DETECTED ERROR IN APPLICATION: the return type of CallObjectMethodA does not match retrofit2.Response com.example.app.service.PostService.getPosts()
runtime.cc:699] in call to CallObjectMethodA
runtime.cc:699] from void com.example.app.fragment.community.CommunityFragment.onViewCreated(android.view.View, android.os.Bundle)
2024-08-05 20:01:35.276 29123-29123 libc com.example.app A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 29123 (example.app), pid 29123 (example.app)
Так есть ли способ решить эту проблему на стороне клиента? Обработать ResponseEntity, возвращенный с сервера?
Подробнее здесь: https://stackoverflow.com/questions/788 ... ndroid-app
Мобильная версия