hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
685 stars 204 forks source link

constructor MediaRecorder() is deprecated crash android #489

Open AlejandroPedrosa opened 1 year ago

AlejandroPedrosa commented 1 year ago

Please fill the template to help you out. Also, please try the Example project compare before submiting the issue when you have certain issue with your project setup.

Version of react-native-audio-recorder-player

3.5.1

Version of React Native

0.69.1

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

The audio recorder was working fine, this morning I couldn't start the project because I got this error constructor MediaRecorder() is deprecated

Actual behavior

The project couldn't start

Steps to reproduce the behabior

install the library in a project, it doesn't work anymore

Steve-Rynjah commented 1 year ago

@AlejandroPedrosa can you show me your code? As I am unable to save the file in the android physical directory and maybe for such I'm getting an error while playing it.

asfaqehussain commented 1 year ago

Got any solution for this ? I'm also facing the same

> Task :react-native-audio-recorder-player:compileDebugKotlin
w: /Volumes.../node_modules/react-native-audio-recorder-player/android/src/main/java/com/dooboolab.audiorecorderplayer/RNAudioRecorderPlayerModule.kt: (66, 29): 'constructor MediaRecorder()' is deprecated. Deprecated in Java
Compilation with Kotlin compile daemon was not successful
java.rmi.ServerError: Error occurred in server thread; nested exception is: 
    java.lang.AssertionError: symbolic reference class is not accessible: class sun.nio.ch.FileChannelImpl, from class org.jetbrains.kotlin.com.intellij.util.io.FileChannelUtil (unnamed module @72d1ad2e)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    .
.
.
.
.
.
.
.
Caused by: java.lang.AssertionError: symbolic reference class is not accessible: class sun.nio.ch.FileChannelImpl, from class org.jetbrains.kotlin.com.intellij.util.io.FileChannelUtil (unnamed module @72d1ad2e)

Caused by: java.lang.IllegalAccessException: symbolic reference class is not accessible: class sun.nio.ch.FileChannelImpl, from class org.jetbrains.kotlin.com.intellij.util.io.FileChannelUtil (unnamed module @72d1ad2e)

Could not connect to kotlin daemon. Using fallback strategy.
/Volumes......node_modules/react-native-audio-recorder-player/android/src/main/java/com/dooboolab.audiorecorderplayer/RNAudioRecorderPlayerModule.kt:66:29: warning: 'constructor MediaRecorder()' is deprecated. Deprecated in Java
            mediaRecorder = MediaRecorder()