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

Support R8 full mode #979

Closed
workspace opened this issue Jan 9, 2024 · 7 comments
Closed

Support R8 full mode #979

workspace opened this issue Jan 9, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@workspace
Copy link
Contributor

workspace commented Jan 9, 2024

Describe the bug
App crashes when running a release build. I've encountered this issue in my app, and upon checking, the same problem occurs in the demo app as well.

SDK version

  • 0.4.3
  • develop branch (latest)

To Reproduce
Steps to reproduce the behavior:

  1. In demo-app, change the build variant to developmentRelease or productionRelease. (developmentNonMinifiedRelease is fine)
  2. Build and run
  3. App crashes

Expected behavior
App should run normally without crashing.

Device:

  • Vendor and model: Samsung Galaxy S20
  • Android version: 13
@workspace workspace added the bug Something isn't working label Jan 9, 2024
@aleksandar-apostolov
Copy link
Collaborator

Hi @workspace,
Thanks for your report.
In the demo app there was an issue with some models being wiped by proguard.
We've updated develop today with this #PR (980)

This is the exception we fixed:
Fatal Exception: kotlin.reflect.jvm.internal.KotlinReflectionInternalError: This callable does not support a default call: public constructor StreamRemoteConfig(...)

Thanks for updating this issue with further information if this does not solve the problem. It would be of great help to us if you could also include some logs.

@workspace
Copy link
Contributor Author

Hi @aleksandar-apostolov

Thank you for the quick fix.

I wanted to attach a log, but it was difficult to provide a clear reference as the logs occurring in my app and the demo app are different.

I have not yet been able to receive 0.4.4-SNAPSHOT, but I will check if the Snapshot has solved the problem and get back to you.

@aleksandar-apostolov
Copy link
Collaborator

Hey @workspace
The configuration in question is in the demo-app not in the SDK, no update to the SDK was made. We found no other crash on the release variant.
It might be that there is also an issue in the SDK, but at the moment we are note able to reproduce this. You can provide both logs if that is possible it might give us an insight as to what is crashing the application.

@aleksandar-apostolov aleksandar-apostolov self-assigned this Jan 10, 2024
@aleksandar-apostolov aleksandar-apostolov added the waiting for response Further information is requested label Jan 10, 2024
@workspace
Copy link
Contributor Author

I was still experiencing issues, so I compared the stream-video-android project with my project and identified the exact cause.

The cause is R8.

From AGP 8.0, R8 operates in full mode by default. According to this commit in the stream-video-android project, R8 full mode was temporarily disabled during the update of the AGP version. If R8 full mode is enabled, the demo app crashes immediately upon launch, just like my project.

Since AGP 8.0 adopts R8 full mode as the default, it's likely that customers using this library will face the same issue. I've somewhat resolved this issue by applying two modifications:

  • Adding Retrofit related rule to the core ProGuard rule.
  • Using IntentCompat in the Intent.streamCallId extension.

However, I haven't conducted a comprehensive review of all the libraries used by stream-video-android, so could you assist in reviewing them? I have submitted my changes as a PR #982 for suggestion.

@workspace
Copy link
Contributor Author

Can I rename this issue to 'Support R8 full mode', or should I create a new issue?

@aleksandar-apostolov
Copy link
Collaborator

I will update the issue and labels.

@aleksandar-apostolov aleksandar-apostolov changed the title App crashes when running a release build Support R8 full mode Jan 10, 2024
@aleksandar-apostolov aleksandar-apostolov added enhancement New feature or request and removed bug Something isn't working waiting for response Further information is requested labels Jan 10, 2024
@skydoves
Copy link
Member

#982 has been merged 🎉 This fix will be contained in the next stable release. Thank you for your contribution, @workspace!

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

No branches or pull requests

3 participants