Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL when R8 optimization #21

Open
Javierenrique00 opened this issue Mar 29, 2020 · 1 comment
Open

NULL when R8 optimization #21

Javierenrique00 opened this issue Mar 29, 2020 · 1 comment

Comments

@Javierenrique00
Copy link

Hello, When using R8 always get an exception with null when reading a RSS in the try catch block. If I don't use the problem does not happend. I don't understand if the problem is with an internal optimization that R8 tries to do., a Are you seen the same problem with R8 optimization eneabled ?

This is the part of the code:

fun getRssFedd(host:String):List<TwitterData>{

    val trustManager = TrustAllX509TrustManager.INSTANCE
    val client = OkHttpClient.Builder()
        .sslSocketFactory(
            sslContext(
                null,
                arrayOf<TrustManager>(trustManager)
            ).socketFactory,
            trustManager)
        .hostnameVerifier(TrustAllX509TrustManager.allowAllHostNames())
        .build()


    val mySyndication = Syndication(
        url = host,
        httpClient =client )
    val reader = mySyndication.create(RssReader::class.java)
    var lista : List<TwitterData>
    try {
        val rssFeed = reader.readRss()
        lista = convRssFeed(rssFeed)
    }
    catch (e:Exception){
        Log.e("Error reading RSS","${e.message}")
        lista = mutableListOf<TwitterData>()
    }
    return lista
}
@ouattararomuald
Copy link
Owner

Do you have the same error with R8 disabled ?
I did not try it with R8 but I will try it and come back to this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants