question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[expo-image-picker] launchMediaLibraryAsync returns empty object in android release builds

See original GitHub issue

Summary

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:

image

You might also need https://github.com/expo/expo/pull/19508 to fix an issue with bare-expo in release mode.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukmccallcommented, Oct 14, 2022

@lukmccall could we add an EnumArgument as ios modules that record enums should comfort to the interface? then we could add proguard rule like keepclassmembers enum * implements expo.modules.kotlin.records.EnumArgument

Yes, we can. I’ll take care of this.

1reaction
brentvatnecommented, Oct 14, 2022

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"

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Jackson JSON parser returns null value in 'release' builds
I'm using the Jackson JSON library within my Android app to parse JSON from a REST API. Everything works ...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Starting with version 4.2, Android Studio now runs on JDK 11. This update causes an underlying behavior change related to signing keys. When...
Read more >
Can someone Explain why JSON returns empty unless I use ...
Hey guys so I've created an object as a script include and sent it to my client script as a JSON object to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found