Skip to content
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

Expo Image Picker Not working on Android 14 SDK 50 #28640

Closed
sevketaydogdu opened this issue May 6, 2024 · 2 comments · Fixed by #28897
Closed

Expo Image Picker Not working on Android 14 SDK 50 #28640

sevketaydogdu opened this issue May 6, 2024 · 2 comments · Fixed by #28897
Labels
Android ImagePicker needs review Issue is ready to be reviewed by a maintainer

Comments

@sevketaydogdu
Copy link

sevketaydogdu commented May 6, 2024

Summary

on clear project image picker is working good but in my project doest open gallery

error occurs only on android.
Edit: not giving any error. permission status is coming null

my dependencies

{
  "name": "x app",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "test": "jest --watchAll",
    "postinstall": "patch-package"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^14.0.0",
    "@fawazahmed/react-native-read-more": "^3.0.3",
    "@hookform/resolvers": "^3.3.4",
    "@invertase/react-native-apple-authentication": "^2.3.0",
    "@miblanchard/react-native-slider": "^2.6.0",
    "@microsoft/signalr": "^7.0.12",
    "@react-native-async-storage/async-storage": "^1.18.2",
    "@react-native-community/netinfo": "11.1.0",
    "@react-native-firebase/analytics": "^19.2.2",
    "@react-native-firebase/app": "^19.2.2",
    "@react-native-firebase/auth": "^19.2.2",
    "@react-native-google-signin/google-signin": "^11.0.1",
    "@react-navigation/drawer": "^6.6.15",
    "@react-navigation/material-top-tabs": "^6.6.13",
    "@react-navigation/native": "^6.0.2",
    "@reduxjs/toolkit": "^2.2.3",
    "@shopify/flash-list": "1.6.3",
    "@tamagui/babel-plugin": "^1.96.0",
    "@tamagui/font-inter": "^1.96.0",
    "@tamagui/themes": "^1.96.0",
    "axios": "^1.6.8",
    "expo": "~50.0.17",
    "expo-application": "~5.8.4",
    "expo-av": "~13.10.6",
    "expo-build-properties": "~0.11.1",
    "expo-constants": "~15.4.6",
    "expo-dev-client": "~3.3.11",
    "expo-device": "~5.9.4",
    "expo-document-picker": "~11.10.1",
    "expo-file-system": "~16.0.9",
    "expo-font": "~11.10.3",
    "expo-haptics": "~12.8.1",
    "expo-image": "~1.10.6",
    "expo-linear-gradient": "~12.7.2",
    "expo-linking": "~6.2.2",
    "expo-localization": "~14.8.4",
    "expo-notifications": "~0.27.7",
    "expo-router": "~3.4.10",
    "expo-secure-store": "~12.8.1",
    "expo-splash-screen": "~0.26.5",
    "expo-sqlite": "~13.4.0",
    "expo-status-bar": "~1.11.1",
    "expo-system-ui": "~2.9.4",
    "expo-updates": "~0.24.12",
    "expo-video-thumbnails": "~7.9.0",
    "expo-web-browser": "~12.8.2",
    "fast-xml-parser": "^4.3.6",
    "html-entities": "^2.5.2",
    "humanize-duration": "^3.32.0",
    "i18n-js": "^4.4.3",
    "jwt-decode": "^4.0.0",
    "lodash": "^4.17.21",
    "moment": "^2.30.1",
    "patch-package": "^8.0.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-hook-form": "^7.51.3",
    "react-native": "0.73.6",
    "react-native-gesture-handler": "~2.14.0",
    "react-native-get-random-values": "~1.8.0",
    "react-native-pager-view": "6.2.3",
    "react-native-reanimated": "~3.6.2",
    "react-native-receive-sharing-intent": "^2.0.0",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.8.2",
    "react-native-screens": "~3.29.0",
    "react-native-slider": "^0.11.0",
    "react-native-svg": "14.1.0",
    "react-native-svg-transformer": "^1.3.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-web": "~0.19.6",
    "react-native-xml2js": "^1.0.3",
    "react-redux": "^9.1.2",
    "redux-persist": "^6.0.0",
    "swr": "^2.2.5",
    "tamagui": "^1.96.0",
    "yup": "^1.4.0",
    "expo-image-picker": "~14.7.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/lodash": "^4.17.1",
    "@types/react": "~18.2.45",
    "jest": "^29.2.1",
    "jest-expo": "~50.0.4",
    "react-test-renderer": "18.2.0",
    "typescript": "^5.1.3"
  },
  "private": true
}

What platform(s) does this occur on?

Android

SDK Version

50

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.4.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.5.0 - /usr/local/bin/npm
Watchman: 2024.04.22.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
IDEs:
Xcode: 15.3/15E204a - /usr/bin/xcodebuild
npmPackages:
expo: ~50.0.17 => 50.0.17
expo-router: ~3.4.10 => 3.4.10
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
react-native-web: ~0.19.6 => 0.19.11
npmGlobalPackages:
eas-cli: 7.8.4
Expo Workflow: bare

Minimal reproducible example

import * as ImagePicker from 'expo-image-picker';
 import { useState } from 'react';
import { Keyboard, Alert } from 'react-native'; 
 
interface IUsePickImagesProps extends ImagePicker.ImagePickerAsset {
  previewUri?: string;
}

export const usePickImages = () => {
   const [image, setImage] = useState<IUsePickImagesProps | null>(null);
  const [imageIsLoading, setImageIsLoading] = useState<boolean>(false);
  const [status, requestPermission] = ImagePicker.useMediaLibraryPermissions();

 
  async function pickImage({ mediaTypes }: { mediaTypes?: ImagePicker.MediaTypeOptions }) {
    if (!status?.granted) {
      requestPermission();
    } else {
      // No permissions request is necessary for launching the image library
      let result = await ImagePicker.launchImageLibraryAsync({
        mediaTypes: mediaTypes,
        quality: 1,
      });

      console.log(result);

      if (!result.canceled) {
        setImage(result.assets[0]);
      }
    }
  }
 
  return { pickImage, image, imageIsLoading, setImage };
};


<>
<Button onPress={() => pickImage({mediaTypes:MediaTypeOptions.All})}>pick image</Button>
</>
@sevketaydogdu sevketaydogdu added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels May 6, 2024
@expo-bot expo-bot removed the needs validation Issue needs to be validated label May 6, 2024
@sevketaydogdu
Copy link
Author

uninstalled "expo-sqlite" and started work there was a problem in sqlite before removing sqlite fonts were not loading also can someone pay attention for sqlite package in sdk 50 please

@Chayma-Soussi
Copy link

expo image picker dont work in expo go sdk 51

@byCedric byCedric added Android ImagePicker needs review Issue is ready to be reviewed by a maintainer and removed CLI Versioned Expo CLI -- `npx expo start` labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android ImagePicker needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants