Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android RN 0.73.0 support #574

Closed
janvandertaelen opened this issue Dec 7, 2023 · 6 comments · Fixed by #575
Closed

Android RN 0.73.0 support #574

janvandertaelen opened this issue Dec 7, 2023 · 6 comments · Fixed by #575
Labels
🤖 android Related to android ✨ configuration Configuration for better code

Comments

@janvandertaelen
Copy link

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.6.4

Version of React Native

0.73.0

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

Android

Expected behavior

Android builds successfully

Actual behavior

  • What went wrong:
    Execution failed for task ':react-native-audio-recorder-player:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

Steps to reproduce the behavior

./gradlew installRelease

@claudiozam
Copy link

Same issue RN 0.73.0.

@janvandertaelen
Copy link
Author

Same issue RN 0.73.0.

I currently patched the library with npx patch-package. I modified the build.gradle file

-  kotlinOptions {
-      jvmTarget = "1.8"
+  compileOptions {
+    sourceCompatibility JavaVersion.VERSION_17
+    targetCompatibility JavaVersion.VERSION_17
   }

it works

idanlevi1 added a commit to idanlevi1/react-native-audio-recorder-player that referenced this issue Dec 11, 2023
@Rossella-Mascia-Neosyn
Copy link

Same issue

@hyochan hyochan added ✨ configuration Configuration for better code 🤖 android Related to android labels Dec 19, 2023
@jadentangsjfood
Copy link

Task :react-native-audio-recorder-player:compileDebugKotlin
'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-audio-recorder-player:compileDebugJavaWithJavac'.

Error: Invalid source release: 17

Same issue

System:
OS: macOS 14.2.1
CPU: (8) x64 Apple M1
Memory: 26.65 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.17.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.15.0 - /usr/local/bin/npm
Watchman: 2023.12.04.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.14.2 - /Users/jaden.t/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, watchOS 10.2
Android SDK:
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11076708
Xcode: 15.1/15C65 - /usr/bin/xcodebuild
Languages:
Java: 11.0.21 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.2 => 0.67.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

@hyochan
Copy link
Owner

hyochan commented Jan 2, 2024

  • react

@jadentangsjfood Have you setup ext variable properly?
Here is link to Example project.

ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 24
compileSdkVersion = 31
targetSdkVersion = 31
kotlinVersion = '1.6.10'
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}

@young-st511
Copy link

young-st511 commented Apr 18, 2024

Hi, @hyochan

Even after modifying the Android build.gradle settings as described, the same issue as mentioned above occurs(Execution failed for task ':react-native-audio-recorder-player:compileDebugJavaWithJavac'.). It seems that versions of gradle prior to RN 0.73 use Java 11. Currently(I'm using RN 0.71), I am using this PR #574 reverted with patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Related to android ✨ configuration Configuration for better code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants