Open Sheng-Xuan opened 4 years ago
That's hard to say, especially if it works with a different URL and with a different Gradle. You can try narrowing down any problem in ProGuard with
-dontshrink
-dontoptimize
-dontobfuscate
It leaves ProGuard active, but ProGuard won't change the code. If it doesn't fix the issue. the problem lies elsewhere.
I have a project with a network module that use ktor with okhttp client. After I upgrade gradle plugin to 4.0.0. I found that my project can't call some urls under release version with obfuscation on.
There are quite some potential areas that may cause this issue. I have posted details in an issue to ktor issue tracker. https://youtrack.jetbrains.com/issue/KTOR-946
Since there are quite some parties may cause this issue, I ask here to see if there is any clue.
Ktor 1.3.2 &1.4.0 both did not work com.android.tools.build:gradle:4.0.0 kotlin : 1.3.72 & 1.4.0 both did not work
Also tried to upgrade proguard to 7.0.0, and updating the rules that keep all relevant libraries like okhttp, ktor, coroutine, reflection, did not work.
How to replicate: minifyEnabled = true and debugale = false.
The url is under my companies' domain, strangely if I replace the url with some aws path (i.e. xxxx.amazonaws.com/xxxx), I could receive the response. I added an interceptor, the headers and url are correct, I can open that url in browser, just no response in the app.
Under release build, it will work if:
change com.android.tools.build:gradle:4.0.0 to com.android.tools.build:gradle:3.6.4 or lower or use Android engine. i.e. HttpClient(Android)' Under debug mode the code works fine with any url.
Have being debugging for quite some time.
Thanks for you help!