react-native-foreground-service
react-native-foreground-service copied to clipboard
No compiling with fresh project on React native 0.72.0
Hello,
I al facing this issue when building :
error Failed to install the app. Command failed with exit code 1: gradlew.bat tasks FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':tasks'.
> Could not create task ':voximplant_react-native-foreground-service:compileDebugJavaWithJavac'.
> In order to compile Java 9+ source, please set compileSdkVersion to 30 or above * Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 30s
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :gradle-plugin:compileKotlin UP-TO-DATE
> Task :gradle-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:pluginDescriptors UP-TO-DATE
> Task :gradle-plugin:processResources UP-TO-DATE
> Task :gradle-plugin:classes UP-TO-DATE
> Task :gradle-plugin:jar UP-TO-DATE
> Task :gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE
> Task :tasks FAILED 6 actionable tasks: 1 executed, 5 up-to-date.
my gradle file :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
The same
The same on 0.72.3
same
@pe1ros i open a PR to fix this issue.
I validate it by editing gradle from node_modules. Build successful
Or you cant patch this lib:
-
Go to node_modules & find node_modules/@voximplant/react-native-foreground-service/android/build.gradle
-
Replace content with this : https://raw.githubusercontent.com/voximplant/react-native-foreground-service/fa80948af6dab70da54039434f9ef12aa2f3fc0c/android/build.gradle
-
https://anu-thomas.medium.com/patch-package-in-react-native-c7786a15e279
npx patch-package @voximplant/react-native-foreground-service
PS: thx to @paolosantarsiero 🥇
I still get the same error even after applying that diff/patch.
Anyone have any ideas what else I can try in order to fix this?
I still get the same error even after applying that diff/patch.
Anyone have any ideas what else I can try in order to fix this?
After patching, remember to run yarn install or npm install.
It was the missing part for me, without that patch didn't work for me 👍
Moreover, If using yarn, you can patch with following command (follow instructions from terminal):
yarn patch @voximplant/react-native-foreground-service