expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
29.63k stars 4.7k forks source link

[expo-contacts] [Android] Contacts.presentFormAsync crashes on Android in SDK 50 #28643

Open hueter opened 1 week ago

hueter commented 1 week ago

Minimal reproducible example

https://github.com/hueter/expo-contacts-image-bug

What platform(s) does this occur on?

Android

Did you reproduce this issue in a development build?

Yes

Summary

Hello,

This came in as a bug report from our Android users. They are reporting issues "downloading their contacts", which is a button in our app calling the presentFormAsync method. This report came from production builds out in the wild.

I realize that Expo Go might have issues, but this method worked in SDK 49 (as seen below). We haven't changed the code in this component/file after upgrading. I also provided a reproducible example repo that I originally made in #25128, which was working, and then I made a single commit to upgrade to SDK 50.

Expo SDK 49 (working)

https://github.com/expo/expo/assets/13444851/adc9ed26-c6f4-483b-88b7-54237fc857b3

Expo SDK 50 (null pointer exception)

https://github.com/expo/expo/assets/13444851/c752e88f-6969-44e9-a3a7-3b448fc077e3

Environment

  expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.4.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v20.11.0/bin/yarn
      npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
      Watchman: 2024.04.22.00 - /opt/homebrew/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
    IDEs:
      Android Studio: 2023.2 AI-232.10300.40.2321.11668458
      Xcode: 15.3/15E204a - /usr/bin/xcodebuild
    npmPackages:
      expo: ~50.0.17 => 50.0.17
      react: 18.2.0 => 18.2.0
      react-native: 0.73.6 => 0.73.6
    npmGlobalPackages:
      eas-cli: 7.1.2
    Expo Workflow: managed

Expo Doctor Diagnostics

Need to install the following packages:
expo-doctor@1.6.0
Ok to proceed? (y) y
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK

Didn't find any issues with the project!
Kudo commented 1 week ago

looks like the issue is resolved by sdk 51. would be helpful if you could try sdk 51 a little bit.