phrase / phrase-android

Phrase Over the Air Android SDK
https://phrase.com
Other
6 stars 1 forks source link

Translations update always triggers onFailure callback #34

Closed Alpexs closed 1 year ago

Alpexs commented 2 years ago

Hello,

After updating Phrase OTA SDK from 2.x to 3.0.x we noticed an issue during translations update which always fails. Looking at stack trace in debugger I noticed an XmlPullParserException , I don't know how to get more informations about that exception, I checked the translation files for maybe some weird characters and tried to remove it on a new OTA release, nothing changed

On 2.x version updates were working fine but we were having issues with realtime updates, that's why we decided to try version 3.X

Screenshot 2021-10-12 at 13 40 21

Error(e=org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT 
     delete use...@130:5 in java.io.InputStreamReader@a03213b) )

I've read that appcompat may have impact on library proper working, we were using 1.2.0, tried to bump until 1.3.1, same behaviour

Other gradle settings

    compileSdkVersion 30
...
    buildToolsVersion '30.0.3'        
    minSdkVersion 24
    targetSdkVersion 30
..
    compileOptions
    {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

Let me know if you need more information ! Thanks.

theSoenke commented 2 years ago

Hey @Alpexs, could you contact us via https://phrase.com/contact or the embedded chat in Phrase? And please include the distribution id and environment. That would really help us to debug this. Thanks!

mr-coin-coin commented 2 years ago

Thanks @Alpexs , I had the same issue with SDK v3.0.6, but not anymore after downgrading to 2.1.3 or either 3.0.0

theSoenke commented 2 years ago

Could you check whether any of your keys in Phrase contains a description with -->? This can cause issues with the parser as it is incorrectly closing the comment: <!-- lorem --> ipsum -->. We're also looking into escaping these characters to address this

mr-coin-coin commented 2 years ago

I don't think this is related as my solution couldn't have compiled. But just in case, I have looked for it and it returned no result. The only similar string that I have is a series of dashes "------------------------------"

theSoenke commented 2 years ago

@mr-coin-coin It seems Android is very forgiving for comments in strings.xml files. I've also checked this and it still worked with broken comments for me. The way we parse XML in the SDK is currently a bit more strict. Could you reach out to us via email or chat to send us your distribution id in private? Then I can take a closer look at what is causing the issue in your case

theSoenke commented 1 year ago

Closing it for now. Feel free to reopen when still an issue