star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot access 'body': it is package-private in 'Response'

Moonubanna opened this issue · comments

react-native-star-io10/android/src/main/java/com/stario10module/StarIO10ValueConverter.kt: (711, 26): Cannot access 'body': it is package-private in 'Response'

Faccing issue in bellow function:
private fun httpToBytes(uri: String): ByteArray? {
var bytes: ByteArray? = null

        try {
            val client = OkHttpClient()
            val request = Request.Builder().url(uri).build()
            val response = client.newCall(request).execute()
            response.body?.bytes()?.let { responseBytes ->
                bytes = responseBytes
                response.body?.close()
            }
        } catch (e: Exception){}

        return bytes
    }

After installing this library its working fine iOS side but android side i am facing above error, Could you please help me.

Thanks in advance.

@Moonubanna this question has been asked several times, so we added it to our wiki.