rollbar-flutter icon indicating copy to clipboard operation
rollbar-flutter copied to clipboard

rollbar_flutter depends on "debug" dependencies from release builds

Open eseidel opened this issue 11 months ago • 4 comments

https://shorebird.dev/ is a code-push solution for Flutter. We publish our own fork of Flutter which customers use to build their app. Our fork only (currently) contains release flavors of the Flutter engine.

We had a customer come and ask about a build failure today which seems to be related to rollbar_flutter.

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':rollbar_flutter:generateReleaseRFile'.
Could not resolve all files for configuration ':rollbar_flutter:releaseCompileClasspath'.
Could not resolve io.flutter:flutter_embedding_debug:1.0.0-62fa4e8bb30f56eb658989d3e6a982cb787d79d6.
     Required by:
         project :rollbar_flutter
Could not resolve io.flutter:flutter_embedding_debug:1.0.0-62fa4e8bb30f56eb658989d3e6a982cb787d79d6.
inconsistent module metadata found. Descriptor: io.flutter:flutter_embedding_debug:1.0.0-04817c99c9fd4956f27505204f7e344335810aed Errors: bad version: expected='1.0.0-62fa4e8bb30f56eb658989d3e6a982cb787d79d6' found='1.0.0-04817c99c9fd4956f27505204f7e344335810aed'

I believe this is the line causing the failure: https://github.com/rollbar/rollbar-flutter/blob/0db0f2606406a9040a213cdd13c2ebeca0b5c488/rollbar_flutter/android/build.gradle#L84

I'm not a gradel expert, but my guess is the "correct" solution is to not depend on _debug flavors from _release builds. Maybe something like this? https://stackoverflow.com/questions/22439593/different-dependencies-for-debug-and-release-in-gradle-and-android-studio

We can also change Shorebird to publish _debug builds, but don't plan to anytime soon since "code push" doesn't make a lot of sense in Debug builds (where hot reload is already available).

eseidel avatar Mar 03 '24 22:03 eseidel