Why do I get " I/system_server: oneway function results will be dropped but finished with status OK and parcel size 4 " message?

Viewed 1025

I am writing an android application using Kotlin ,Retrofit ,OKHttp and Rxjava when make a call to my API in order to add a new user to database i get the following message in logcat:

  • I/system_server: oneway function results will be dropped but finished with status OK and parcel size 4

The problem is that nothing happens no user is added in fact the API does not receive any requests from my app even thought i have the appropriate permissions and a android:usesCleartextTraffic="true" annotation in my AndroidManifest.xml.

By putting println() in various places in the code I was able to confirm that the function responsible for making the call is in fact executed but code responsible for handling response is never called and no error is reported.

Here is the code of above mentioned function:

private fun addUser(user: UserDataObject) {

    val client = OkHttpClient.Builder()
        .addInterceptor(BasicAuthInterceptor("admin", "admin")) // temporarily hardcoded 
        .build()

    val requestInterface = Retrofit.Builder()

        .baseUrl(BASE_URL)
        .addConverterFactory(GsonConverterFactory.create())
        .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
        .client(client)
        .build().create(GetData::class.java)

    myCompositeDisposable?.add(
             requestInterface.addUser(user) 
            .observeOn(AndroidSchedulers.mainThread())
            .subscribeOn(Schedulers.io())
            .subscribe(this::handleResponse, this::onError)
    )
}    

and the code of the interface:

interface GetData {
@POST("/api/some/API/URL")
fun addUser(@Body user: UserDataClass) : Completable}

also ( just in case ) the code of interceptor:

class BasicAuthInterceptor(username: String, password: String): Interceptor {
private var credentials: String = Credentials.basic(username, password)

override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
    var request = chain.request()
    request = request.newBuilder().header("Authorization", credentials).build()

    return chain.proceed(request)
  }    
}

Can you please tell me why is my app not able to communicate with API ?

While searching for answer on the internet i found this question so I gather that it has something to do with selinux permissions but this doesn't help me at all since I'm just a beginner.

0 Answers
Related