react-native-webrtc / react-native-incall-manager

Handling media-routes/sensors/events during a audio/video chat on React Native
ISC License
547 stars 191 forks source link

* What went wrong: Execution failed for task ':react-native-incall-manager:compileDebugJavaWithJavac'. #198

Open TholapuGayathri opened 2 years ago

TholapuGayathri commented 2 years ago

While Running react-native run-android It showing react-native-incall--manager:compile debug java with javac error

tomobre commented 2 years ago

Any updtes on this error?

TholapuGayathri commented 1 year ago

Any updtes on this error?

                                      Yes I found solution..

delete node modules -----> rm -rf node_modules/ delete package-lock.json --------> rm -rf package-lock.json Again install node modules by---------> npm install --force Then run the app by ---------> npx react-native run-android

                                           It will work.
KolissnikBogdan commented 1 year ago

maybe here you can find answer: https://github.com/facebook/react-native/issues/35210

muhammad-kumail commented 5 months ago

I ended up making some patches in package using patch-package. Actually the issue lies in my case at Build.VERSION_CODES.TIRAMISU & Context.RECEIVER_NOT_EXPORTED line of code in package files AppRTCBluetoothManager.java & InCallManagerModule.java, throwing error: cannot find symbols Build.VERSION_CODES.TIRAMISU, Context.RECEIVER_NOT_EXPORTED on build. i update the code in both files.

node_modules/react-native-incall-manager/android/src/main/java/com/zxcpoiu/incallmanager/AppRTC/AppRTCBluetoothManager.java

    protected void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
    -    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
    -      apprtcContext.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);
    -    } else {
    -      apprtcContext.registerReceiver(receiver, filter);
    -    } 
    +     apprtcContext.registerReceiver(receiver, filter);
       }

and

node_modules/react-native-incall-manager/android/src/main/java/com/zxcpoiu/incallmanager/InCallManagerModule.java

    private void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
    -        final ReactContext reactContext = getReactApplicationContext();
    -        if (reactContext != null) {
    -            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
    -                reactContext.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED);
    -            } else {
    -                reactContext.registerReceiver(receiver, filter);
    -            }
    -        }  else {
    -            Log.d(TAG, "registerReceiver() reactContext is null");
    -        }
    +        getReactApplicationContext().registerReceiver(receiver, filter);
         }

yarn android & app build successfully