react-native-twilio-video-webrtc icon indicating copy to clipboard operation
react-native-twilio-video-webrtc copied to clipboard

Could not find method compile() for arguments [project ':react-native-twilio-video-webrtc']

Open bennaaym opened this issue 3 years ago • 5 comments

Steps to reproduce

  1. Set up react-native-twilio-video-webrtc as explained in the documentation
  2. Run the application using ReactNative CLI

Expected behaviour

The app is supposed to run without issues

Actual behaviour

Constantly getting the following error:

A problem occurred evaluating project ':app'.
Could not find method compile() for arguments [project ':react-native-twilio-video-webrtc'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Environment

  • Node.js version: v16.15.1
  • React Native version: 0.67.4
  • React Native platform + platform version: Android Tiramisu

react-native-twilio-video-webrtc

Version: 1.0.1

bennaaym avatar Aug 03 '22 18:08 bennaaym

I was able to pass this issue by using implementation instead of compile, however, another error raised

Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > java.lang.OutOfMemoryError (no error message)

bennaaym avatar Aug 03 '22 18:08 bennaaym

Compile was removed in recent versions of the package. I noticed in your version that you were using 1.0.1. Could you try bumping that up?

slycoder avatar Aug 04 '22 05:08 slycoder

@slycoder I tried that and re set the package now I'm getting the following issue

Could not find org.webrtc:google-webrtc:1.0.30039.

bennaaym avatar Aug 05 '22 18:08 bennaaym

@bennaaym I fixed that issue by adding jcenter() as a repository to the allprojects section within build.gradle like so:

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
        }
        maven {
            // Android JSC is installed from npm
            url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist'))
        }

        google()
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup 'com.facebook.react'
            }
        }
        jcenter() // <-- Add this
        maven { url 'https://www.jitpack.io' }
    }
}

tgoins avatar Aug 08 '22 15:08 tgoins

Add this instead implementation(project(':react-native-twilio-video-webrtc'))

AhmedSamir74 avatar Aug 24 '22 22:08 AhmedSamir74