SDK: Expo 49.0.13
Package: ExpoAV (expo-av) 13.7.0
Platform: Android
Additional:
- New Architecture is enabled
- JS engin is Hermes
- Prebuild project
I attempted to open a local file using the ‘require’ method, a local file at the URL ‘file:///…’, and a file from a web server using different versions of Expo 49.0.x and ExpoAV 12.x.x-13.x.x, along with three Android smartphones (the problem is relevant only on Android. Everything works fine on iOS devices): OnePlus 8 (Android 13), OnePlus 8T (Android 13), and Samsung Galaxy S20 (Android 11). Despite these attempts, all efforts failed, resulting in the same error:
WARN Possible Unhandled Promise Rejection (id: 0):
Error: Cannot convert 'null' to a Kotlin type.
Error: Cannot convert 'null' to a Kotlin type.
at construct (native)
at apply (native)
at _construct (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:4470:28)
at Wrapper (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:4428:25)
at construct (native)
at _createSuperInternal (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:124818:322)
at call (native)
at CodedError (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:124831:26)
at promiseFn (native)
at tryCallTwo (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:61:9)
at doResolve (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:216:25)
at Promise (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:82:14)
at loadForSound (native)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:132387:47)
at tryCallTwo (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:61:9)
at doResolve (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:216:25)
at Promise (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:82:14)
at ?anon_0_ (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:132371:31)
at next (native)
at asyncGeneratorStep (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:6070:26)
at _next (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:6089:29)
at tryCallOne (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)
at anonymous (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)
at apply (native)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:39573:26)
at _callTimer (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:39452:17)
at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:39497:17)
at callReactNativeMicrotasks (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:39703:44)
at __callReactNativeMicrotasks (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:3677:46)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:3451:45)
at __guard (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:3650:15)
at flushedQueue (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.jarcoder.testaudio&modulesOnly=false&runModule=true:3450:21)
Simple code for reproduce (App.tsx):
import { StatusBar } from 'expo-status-bar';
import { Text, View } from 'react-native';
import { Audio } from 'expo-av';
import { useEffect } from 'react';
export default function App() {
useEffect(() => {
Audio.Sound.createAsync(
{ uri: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3' },
{ shouldPlay: false },
() => {},
true,
);
}, []);
return (
<View style={{ flex: 1 }}>
<Text>Open up App.tsx to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
package.json:
{
"name": "test_audio",
"version": "1.0.0",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~49.0.13",
"expo-av": "^13.7.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.14",
"typescript": "^5.1.3"
},
"private": true
}
Expo info:
expo-env-info 1.0.5 environment info:
System:
OS: macOS 14.0
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.18.1 - /usr/local/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 9.6.2 - /usr/local/bin/npm
Watchman: 2023.08.07.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /usr/local/lib/ruby/gems/2.7.0/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10671973
Xcode: 15.0/15A240d - /usr/bin/xcodebuild
npmGlobalPackages:
eas-cli: 3.9.1
expo-cli: 6.3.10