rollbar / rollbar-flutter

Rollbar for Dart and Flutter
https://docs.rollbar.com/docs/flutter
MIT License
21 stars 27 forks source link

rollbar_flutter depends on "debug" dependencies from release builds #126

Open eseidel opened 7 months ago

eseidel commented 7 months ago

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).

kieranmccwayleadr commented 7 months ago

Bumping for push the fix on this.

kevinconcourse commented 6 months ago

Facing the same issue. Any suggested solution?

kieranmccwayleadr commented 6 months ago

I forked this library and updated myself. Then in my pubspec I used the forked library instead.

@matux can we get some input on this?

zdavis-rollbar commented 6 months ago

This package is now community supported. If you would like to contribute, please comment, and we can get you either as a maintainer or owner of the Flutter SDK.