Search code examples
androidperformanceapkandroid-install-apkdebug-build

Facing weird issue with debug and release builds of the same app


I am facing a weird issue with my Android apk build. I have an app which has livestreaming feature. The livestreaming feature is by a third party sdk.

The issue is that, it works silky smooth in the debug build but the moment I try signed release build, it is lagging. The app works absolutely fine but the live streaming part gets laggy. Once streaming starts, the app also won't respond properly.

How can exactly the same code on debug and release build make this difference?

I have added compileOptions.encoding = 'gbk' as an additional config on build.gradle.


Solution

  • This is kinda weird. After weeks of debugging, I found that the issue was in a while loop inside a thread!

    There is a thread started on the launch of the fragment and the thread has a while loop which keeps on checking the value of a variable. Adding sleep(1000) inside the while loop solved this issue.

    I am not sure how this was not observed in debug build.