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

No compiling with fresh project on React native 0.72.0 #65

Open
Koxx3 opened this issue Jun 26, 2023 · 9 comments
Open

No compiling with fresh project on React native 0.72.0 #65

Koxx3 opened this issue Jun 26, 2023 · 9 comments

Comments

@Koxx3
Copy link

Koxx3 commented Jun 26, 2023

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")
    }
}
@varda-altusnova
Copy link

The same

@gavrilikhin-d
Copy link

The same on 0.72.3

@paolosantarsiero
Copy link

same

@paolosantarsiero
Copy link

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

@cristea2017
Copy link

cristea2017 commented Aug 25, 2023

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 🥇

@nbonatsakis
Copy link

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?

@radek-treeline
Copy link

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

@AminDannak
Copy link

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

There is no need to run yarn install or npm install because you have already made the changes.

@dannyGan
Copy link

dannyGan commented Aug 1, 2024

Faced the same problem and patch the package according to my own android/build.gradle, npm install and npm start.
It works for me. Thanks ! @cristea2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants