-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug]: ShareFileProvider ... defineEntityReplacementText() not supported #2462
Comments
Hey @SimonErich , do you have minification turned on? Also, did you migrate your Android gradle config to 8.x? |
Hello @AngeloAvv , yes, we had to upgrade to gradle 8.x because of an SDK needed in our app. |
@SimonErich I believe there's a combination of libraries that make the app crash during the startup. I have the very same gradle and share_plus configuration on multiple projects, but one of them is crashing with the error message you reported. I was able to solve the crash by adding the following row into gradle.properties, looks like the behavior of R8 changed since gradle 8.x: |
I got a similar error using share_plus 7.2.2 :
I tried to add a <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@xml/flutter_share_file_paths*" /> only |
Android Gradle Plugin 8.3 fixes this problem but leads to new one: |
This comment was marked as off-topic.
This comment was marked as off-topic.
This an issue with R8 configuration. By default since Gradle version 8 the R8 works in |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days |
I don't think this should be marked as not planned. If there are issues with this plugin when R8 full mode is enabled, this plugin should include a proguard rules file that transitively applies to app's proguard configuration. Not adding this can lead to crashes at runtime and hard to debug issues for other libraries where the source of the issue is unclear. For example If it's helpful, I was able to fix related issues by adding this to a project's proguard configuration.
|
For sure. It was marked as not planned because of our automated action to close issues without activity and maintainers don't really check every single old issue without activity, so this is why it happened.
Yes, this change fixed a similar issue in a few other packages that I use in work related projects. |
It might be a bit hard for you to reproduce our exact scenario. The crash happens in combination with our plugin In our case it was crashing at runtime when creating an Since purchases-android is included as a Maven dependency in our plugin, it’s already compiled when used in our plugin. This likely caused R8 to incorrectly determine that the method was unused and remove it, since R8 only analyzes the code that is compiled in the app itself (including the plugins), not precompiled dependencies. I would guide you on how to reproduce this using our plugin, but it requires setting up a project at revenuecat.com and opening a paywall, which might take some time. If you need help testing a branch, a beta release or something like that, I would be happy to help verify it fixes it. This is the issue in our repository where you can see the stacktrace. And this was the
|
I've also run into this bug, for me it manifests when I try to share a file using
I've just updated my app to use Gradle 8.3 and AGP 8.1.4 compiling with Java 17, only experience the problem in release mode (minification and shrinkResources turned on). I also use Revenue Cat purchases_flutter. Adding I've been trying to create a minimal reproducible example but haven't been able to so far, there must be some special combination of dependencies required which I haven't figured out yet. Here are my dependencies in case it's useful: pubspec.yaml dependenciesdependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
animations: ^2.0.11
app_settings: ^5.1.1
archive: ^3.6.1
built_collection: ^5.1.1
built_value: ^8.9.2
camera: ^0.11.0+2
collection: ^1.18.0
confetti: ^0.8.0
characters: ^1.3.0
device_info_plus: ^10.1.2
duration: ^4.0.3
envied: ^0.5.4+1
fimber: ^0.7.0
flutter_appauth: ^7.0.0
flutter_embed_unity: ^1.2.3
flutter_widget_from_html: ^0.15.3
flutter_local_notifications: ^17.2.2
flutter_material_color_picker: ^1.2.0
flutter_portal: ^1.1.4
flutter_timezone: ^3.0.1
flutter_redux: ^0.10.0
flutter_svg: ^2.0.10+1
http: ^1.2.2
image: ^4.2.0
in_app_review: ^2.0.9
intl: any
memoize: ^3.0.0
open_filex:
git: https://github.com/jamesncl/open_filex_private
optional: ^6.1.0+1
package_info_plus: ^8.0.2
path: ^1.9.0
path_provider: ^2.1.4
pdf: ^3.11.1
permission_handler: ^11.3.1
protobuf: ^3.1.0
purchases_flutter: ^8.1.1
redux: ^5.0.0
reorderables: ^0.6.0
reselect: ^0.5.0
sentry_flutter: ^8.12.0
shared_preferences: ^2.3.2
share_plus: ^10.1.2
sqflite: ^2.3.3+1
svg_path_parser: ^1.1.2
timezone: ^0.9.4
two_dimensional_scrollables: ^0.3.2
uuid: ^4.5.0
url_launcher: ^6.3.0
video_player: ^2.9.2
wakelock_plus: ^1.2.8
xml: ^6.5.0 |
Platform
Android 12
Plugin
share_plus
Version
Flutter SDK
3.13.9
Steps to reproduce
As soon as I add share_plus > 7.0.0 as a dependency my app crashes on the start in release mode and I get the error message below in logcat.
I checked the install instructions for tags or content to add to AndroidManifest.xml, but could not find anything.
As soon as I remove the share_plus dependency again, everything works fine.
Code Sample
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: