react-native-incall-manager icon indicating copy to clipboard operation
react-native-incall-manager copied to clipboard

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

Open TholapuGayathri opened this issue 3 years ago • 4 comments

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

TholapuGayathri avatar Jul 31 '22 08:07 TholapuGayathri

Any updtes on this error?

tomobre avatar Sep 07 '22 01:09 tomobre

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.

TholapuGayathri avatar Sep 14 '22 12:09 TholapuGayathri

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

KolissnikBogdan avatar Nov 10 '22 09:11 KolissnikBogdan

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

muhammad-kumail avatar Mar 22 '24 18:03 muhammad-kumail