React native expo Audio not working properly - react-native

I have a react native app running with expo, sounds where working great.
For some reason, the simple code for loading a sound, without playing it or any other action, is returning an error.
Both:
const mySound = new Audio.Sound(require('./assets/sounds/mySound.mp3'))
and
const mySound = new Audio.Sound.createAsync(require('./assets/sounds/mySound.mp3'))
end up in the next error:
Error: An unknown error occurred (-12746) - The AVPlayerItem instance has failed with the error code -11800 and domain "AVFoundationErrorDomain".
I have tried hosting the mp3 files in my server and download using the url, same result.
No clue what to do as the Audio documentation from expo has no explanation for the error codes

Related

Adding #bam.tech/react-native-batch to a fresh new react native project does not work

I try to yarn add #bam.tech/react-native-batch but I got the following error:
node_modules/#bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNUtils.java:113: error: no suitable method found for put(String, batchEventData.put(key, URI.create(valueMap.getString("value")));
and
node_modules/#bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNBatchModule.java:529: error: no suitable method found for setAttribute(String, editor.setAttribute(key, URI.create(url));
while doing yarn android (no error on iOS)
I am using react 18 and *react-native 0.69.1

How to setup feathers offline in react native

I would like to know if anyone successfully set up feathers offline in react native. Right now I am having an issue whenever I call "owndataWrapper" i.e
import { owndataWrapper } from '#feathersjs-offline/client';
owndataWrapper(app, '/messages', {});
The error says Unable to resolve module path in /node-localstorage/LocalStorage.js . . so I ended up installing these packages.
assert, constants, events, path, stream, and fs
and got a new error.
here is the error.
https://github.com/feathersjs-offline/owndata-ownnet/issues/46
My guess is probably due to the fs package, it has a security issue.
Any idea? Thanks
After digging further it turns out it only works on web apps. It uses packages that does not exists in react native such as path, process, fs, and so on. I tried using
https://github.com/parshap/node-libs-react-native
and
https://github.com/staltz/react-native-process-shim
but got stuck and continuesly having error on fs. . in conclusion I need to drop the ball for now since this feathers offline is not yet fully created for react native.

getDevicePushTokenAsync error on bare workflow

I implemented push notification on managed workflow which is working properly but when I eject from managed workflow, I am getting error at line
pushToken = (await Notifications.getExpoPushTokenAsync()).data;
Error: Encountered an exception while calling native method: Exception occurred while executing exported method getDevicePushTokenAsync on module ExpoPushTokenManager: Default FirebaseApp is not initialized in this process com.luciajane.taskuser. Make sure to call FirebaseApp.initializeApp(Context) first.
I passed experienceId but still getting error?
pushToken = (await Notifications.getExpoPushTokenAsync({experienceId: "#luciajane/task-user"})).data;
I found reason. You have to setup by making new project on firebase then download google-services.json file and add that to your expo project. As expo mentioned Firebase Cloud Messaging is required for all managed and bare workflow Android apps made with Expo.For setup follow this link https://docs.expo.io/push-notifications/using-fcm/

react-native-signature-canvas not working properly in expo IOS

react-native-signature-canvas is not working properly in Expo, it throws an error "Unable to open URL".
I am using package of react-native-signature-canvas signature using env Expo.
What is going on here? I just simply copy and paste this code from React Native Signature Component based Canvas for Android && IOS && expo.
I used the same code example provided on above page.
Error Message:
RemoteConsole.js:80 Possible Unhandled Promise Rejection (id: 0):
Error: Unable to open URL: ReactABI32_0_0-js-navigation://postMessage?data%253Aimage%252Fpng%253Bbase64%252CiVBORw0KGgoAAAANSUhEUgAAAuQAAAVWCAYAAAD ... YII%253D
I solved this error, this error throws because of remote debugger is on after i stop remote debugging it works fine.

React - native developement server return response error code : 500

I'm building an application in react-native, everything was working fine .After npm install, react-native doesn't detect some of my files anymore saying it doesnt exist, doesn't seem to detect any changes either. I get
"Developpement server returned response error 500, unable to resolve module `../services/myFile` none of these files exist." on android and on IOS 'Failed to load Bundle with error: "unable to resolve module ./screens/anotherFile"
When I remove those files (from the files they are use in) the error is still the same. Any ideas ?
Like #firu said, make sure you do a react-native-link, this happens if you have deleted the ios or android folder. Most cases when you are upgrading react-native with react-native-upgrade