react-native-foreground-service icon indicating copy to clipboard operation
react-native-foreground-service copied to clipboard

No compiling with fresh project on React native 0.72.0

Open Koxx3 opened this issue 1 year ago • 9 comments

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")
    }
}

Koxx3 avatar Jun 26 '23 11:06 Koxx3

The same

varda-altusnova avatar Jul 07 '23 09:07 varda-altusnova

The same on 0.72.3

gavrilikhin-d avatar Jul 20 '23 08:07 gavrilikhin-d

same

paolosantarsiero avatar Aug 08 '23 23:08 paolosantarsiero

@pe1ros i open a PR to fix this issue. I validate it by editing gradle from node_modules. Build successful

paolosantarsiero avatar Aug 08 '23 23:08 paolosantarsiero

Or you cant patch this lib:

  1. Go to node_modules & find node_modules/@voximplant/react-native-foreground-service/android/build.gradle

  2. Replace content with this : https://raw.githubusercontent.com/voximplant/react-native-foreground-service/fa80948af6dab70da54039434f9ef12aa2f3fc0c/android/build.gradle

  3. https://anu-thomas.medium.com/patch-package-in-react-native-c7786a15e279

npx patch-package @voximplant/react-native-foreground-service

PS: thx to @paolosantarsiero 🥇

cristea2017 avatar Aug 25 '23 14:08 cristea2017

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?

nbonatsakis avatar Oct 16 '23 14:10 nbonatsakis

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

radek-treeline avatar Mar 27 '24 15:03 radek-treeline