[expo-image-picker] launchMediaLibraryAsync returns empty object in android release builds
See original GitHub issueSummary
launchMediaLibraryAsync
returns an empty object after picking an image on Android release builds only. This seems like an issue with Proguard.
What platform(s) does this occur on?
Android
Environment
expo-env-info 1.0.5 environment info: System: OS: macOS 12.6 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.17.1 - ~/.nvm/versions/node/v16.17.1/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.15.0 - ~/.nvm/versions/node/v16.17.1/bin/npm Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/janicduplessis/.rvm/gems/ruby-2.7.4/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9014738 Xcode: 14.0/14A309 - /usr/bin/xcodebuild npmPackages: expo: ~47.0.0-alpha.1 => 47.0.0-alpha.1 react-native: 0.70.2 => 0.70.2 Expo Workflow: bare
Minimal reproducible example
I can repro the issue in the bare-expo app by changing enableProguardInReleaseBuilds
to true in android/app/build.gradle:106
. Then in the ImagePicker example you can see the following:

You might also need https://github.com/expo/expo/pull/19508 to fix an issue with bare-expo in release mode.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Yes, we can. I’ll take care of this.
you can either disable proguard or add extra rules. use the
extraProguardRules
and add the above rules that @janicduplessis mentioned.add to the options
"extraProguardRules": "insert the full string here"