expo: [RN 0.66][SDK 44][Android] `expo` package no longer compatible with RN 0.66 (`expo-file-system` issue)
Summary
The package expo-file-system
no longer compiles on Android on SDK 44 and react-native 0.66.4
Because expo-asset
and expo
packages depend on expo-file-system
, this affects pretty much every ejected expo project
> Task :expo-file-system:compileDebugKotlin FAILED
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (769, 36): Type mismatch: inferred type is String? but String was expected
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (794, 107): Using 'parse(String): MediaType?' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (819, 40): Using 'body(): ResponseBody?' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (820, 39): Using 'code(): Int' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (821, 60): Using 'headers(): Headers' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (869, 18): Function invocation 'isCanceled()' expected
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (879, 29): Using 'body(): ResponseBody?' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (882, 37): Using 'code(): Int' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (883, 58): Using 'headers(): Headers' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (903, 37): Using 'buffer(Source): BufferedSource' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (903, 49): Using 'source(InputStream): Source' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (906, 27): Using 'buffer(Sink): BufferedSink' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (906, 39): Using 'sink(File): Sink' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (937, 31): Using 'buffer(Sink): BufferedSink' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (937, 43): Using 'sink(File): Sink' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (938, 38): Using 'body(): ResponseBody?' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (942, 43): Using 'code(): Int' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (943, 64): Using 'headers(): Headers' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1006, 57): Using 'body(): ResponseBody?' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1101, 37): Using 'body(): ResponseBody?' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1111, 37): Using 'code(): Int' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1112, 58): Using 'headers(): Headers' is an error. moved to val
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1119, 19): Function invocation 'isCanceled()' expected
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1142, 30): Using 'buffer(Source): BufferedSource' is an error. moved to extension function
e: app/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt: (1307, 31): Using 'size(): Int' is an error. moved to val
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
SDK 44
Environment
Expo CLI 5.0.1 environment info:
System:
OS: macOS 12.0.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.1 - /opt/homebrew/Cellar/node@16/16.13.1/bin/node
Yarn: 1.22.17 - /opt/homebrew/bin/yarn
npm: 8.1.2 - /opt/homebrew/Cellar/node@16/16.13.1/bin/npm
Watchman: 2021.12.13.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
API Levels: 29, 30, 31
Build Tools: 29.0.2, 30.0.2, 31.0.0, 32.0.0
System Images: android-31 | Google Play ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.2/13C90 - /usr/bin/xcodebuild
npmPackages:
expo: ~44.0.0 => 44.0.0
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.66.4 => 0.66.4
react-native-web: 0.17.1 => 0.17.1
npmGlobalPackages:
eas-cli: 0.41.1
expo-cli: 5.0.1
Expo Workflow: bare
Reproducible demo
expo init yonom --yes && cd yonom
yarn add react-native@0.66.4
expo prebuild --skip-dependency-update=react-native
expo run:android
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 15
- Comments: 26 (5 by maintainers)
Links to this issue
Commits related to this issue
- Bump up packages https://github.com/expo/expo/pull/15661/files https://github.com/expo/expo/issues/15632#issuecomment-997279547 — committed to tooot-app/app by xmflsct 2 years ago
- build: Upgrade Expo and @react-native-mapbox-gl/maps See: https://github.com/expo/fyi/blob/main/expo-modules-migration.md See: https://github.com/expo/expo/issues/15632 — committed to RinseV/kyker by koesie10 2 years ago
- build: Upgrade Expo and @react-native-mapbox-gl/maps See: https://github.com/expo/fyi/blob/main/expo-modules-migration.md See: https://github.com/expo/expo/issues/15632 — committed to RinseV/kyker by koesie10 2 years ago
- [Android] excluding expo-file-system it has some incompatibility with RN 0.66 (in expo.modules.filesystem.FileSystemModule.kt) as discussed here -- https://github.com/expo/expo/issues/15632 — committed to kanzitelli/rnn-starter by kanzitelli 2 years ago
- [Android] excluding expo-file-system it has some incompatibility with RN 0.66 (in expo.modules.filesystem.FileSystemModule.kt) as discussed here -- https://github.com/expo/expo/issues/15632 — committed to starters-dev/rn-starter by kanzitelli 2 years ago
- [packages] Fix okio/okhttp compatibility issue (#15915) # Why fix #15632 # How `okio` and `okhttp` were be upgraded in react-native 0.66. there were some android build errors. since there're... — committed to expo/expo by Kudo 2 years ago
- [packages] Fix okio/okhttp compatibility issue (#15915) # Why fix #15632 # How `okio` and `okhttp` were be upgraded in react-native 0.66. there were some android build errors. since there're... — committed to expo/expo by Kudo 2 years ago
not a permanent solution but for the time being if you’re not using
expo-file-system
you can exclude it in yourpackage.json
published
expo-file-system@13.2.1
with the fix. please upgrade and try again. thanks!In the meantime, I am using the following patch
Yonom’s code changes work well. I like to use
patch-package
to apply them.patches
folderexpo-file-system+13.1.0.patch
in thepatches
foldernpx patch-package
to test the patch, it should apply the patchyarn add -D patch-package
npm
oryarn
by changing yourpackage.json
:same problem using npx install-expo-modules on react-native init projects.
Is this going to be fixed in a release? Just tried expo for the first time and got this exact issue
Here’s a new patch for
expo-file-system@~13.1.0
(some line numbers needed updating):for me, it’s at
.yarn/patches/expo-file-system-npm-13.1.0-4d3bf24457
I have this in my
package.json
to include it (I use yarn v3.1.1):The error also affects RN 0.65 (expo 44 officially only supports RN 0.64 I believe; I hope they fix this issue before the next SDK though)
sdk 45 includes compatibility with react-native 0.68.1
@aprilmintacpineda please wait for a moment. i’m working on publish new packages with the fixes.