opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
210 stars 155 forks source link

Android build failed, opentok-react-native:compileDebugJavaWithJavac FAILED #704

Closed syukronmuttaqien closed 8 months ago

syukronmuttaqien commented 9 months ago

Device: Macbook Air M2

Platform: React Native 0.67.5

Hi, i'm upgrading the library to the latest, and follow the instruction on the documentation. i can run it on IOS, but when i run on android. it's failing because of.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':opentok-react-native:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

I Provide the screenshoot here.

Screenshot 2023-11-20 at 14 04 26 Screenshot 2023-11-20 at 14 12 36
kundanthe commented 9 months ago

I am also getting same issue @syukronmuttaqien. Have you got any solution for this..?

syukronmuttaqien commented 9 months ago

Not Yet.., i'm still searching workaround for this.

kundanthe commented 9 months ago

Hi @jeffswartz , Please help us on this, why we are getting this ?

syukronmuttaqien commented 9 months ago

Hi @kundanthe,

I've try some method, i can successfully build my app through this step.

  1. Open Android Studio
  2. Open The opentok-react-native build.gradle
  3. On That File delete all the line
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_11
        targetCompatibility JavaVersion.VERSION_1_11
    }
  4. create a patch using yarn patch-package opentok-react-native

and try to rebuild it.

but i don't know what the side-effect of this, but at least my apps can run.

kundanthe commented 8 months ago

After changing the gradle version and distribution Url its working now..

classpath 'com.android.tools.build:gradle:7.2.1' distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

If targeting to JAVA_11 then need to change the gradle version. https://developer.android.com/build/releases/past-releases/agp-7-0-0-release-notes

marinaserranomontes commented 8 months ago

Hi @syukronmuttaqien, @kundanthe

Thanks for sharing your fixes.

As you commented above, you will need Gradle plugin 7 for JDK 11.

Please, reach out to Vonage support (https://api.support.vonage.com/hc/en-us) if you still need help.