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

Execution failed for task ':react-native-image-filter-kit:compileDebugJavaWithJavac'. #146

Open
hashhirr opened this issue Dec 8, 2023 · 9 comments

Comments

@hashhirr
Copy link

hashhirr commented Dec 8, 2023

For ios it works fine but when i try to compile it on android it produces this error:
(i am using gradle version 8.5, react-native version 0.73.0.)

Task :react-native-image-filter-kit:processDebugManifest
package="iyegoroff.imagefilterkit" found in source AndroidManifest.xml: /Users/thunderbirds/Desktop/dummyapp2/node_modules/react-native-image-filter-kit/android/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported, and the value is ignored.
Recommendation: remove package="iyegoroff.imagefilterkit" from the source AndroidManifest.xml: /Users/thunderbirds/Desktop/dummyapp2/node_modules/react-native-image-filter-kit/android/src/main/AndroidManifest.xml.

Task :react-native-image-filter-kit:compileDebugJavaWithJavac FAILED
46 actionable tasks: 13 executed, 33 up-to-date

@kamalDevk
Copy link

kamalDevk commented Jan 11, 2024

Hello,
I was facing the same error, after did more analysis i found a solution and this works form me. and i was facing this issue on Mac m2 chip.

"react": "18.2.0",
"react-native": "0.72.6",

I add these line on main build.gradle file not in app/build.gradle file.

Inside the buildscript section

`
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
kotlin_version = '1.8.0'

// I add these lines

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

`

@hashhirr
Copy link
Author

Hello, I was facing the same error, after did more analysis i found a solution and this works form me. and i was facing this issue on Mac m2 chip.

"react": "18.2.0", "react-native": "0.72.6",

I add these line on main build.gradle file not in app/build.gradle file.

Inside the buildscript section

` ext { buildToolsVersion = "33.0.0" minSdkVersion = 23 compileSdkVersion = 33 targetSdkVersion = 33 kotlin_version = '1.8.0'

// I add these lines

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

`

i tried it but still same error.!
but then i attempted in android studio then i got different error of renderScript

@kamalDevk
Copy link

I had find the link, then i download them and check configuration files.

this code is working i run this code on my machine. ( i found the solution from this link )

A. please check this link maybe you found something.

https://github.com/divyeshgohil85/RNImageFilter

B. Some time it give me error while generating the build by Android studio so i follow these steps and it works for me.

`
------- Execution failed for task ':react-native-image-filter-kit:compileReleaseRenderscript'. --------------

i am using nvm so i switch node version 18 because my react-native project version is > 70

open terminal from your project directory switch on node 18

1. open Android studio using this  `open -a "Android studio.app"`
2. Invalidate the caches by android studio

**After that run these commands inside your VS code.**
 Go inside project directory/android folder   then run this command
   
    ./gradlew clean  
3. After successful this command run next command
    ./gradlew assembleRelease
    
4. try to run your project from android studio.

`

@Robogram
Copy link

Robogram commented Feb 9, 2024

I have urgent project that is using this library to apply filters to image.

I had find the link, then i download them and check configuration files.

this code is working i run this code on my machine. ( i found the solution from this link )

A. please check this link maybe you found something.

https://github.com/divyeshgohil85/RNImageFilter

B. Some time it give me error while generating the build by Android studio so i follow these steps and it works for me.

` ------- Execution failed for task ':react-native-image-filter-kit:compileReleaseRenderscript'. --------------

i am using nvm so i switch node version 18 because my react-native project version is > 70

open terminal from your project directory switch on node 18

1. open Android studio using this  `open -a "Android studio.app"`
2. Invalidate the caches by android studio

**After that run these commands inside your VS code.**
 Go inside project directory/android folder   then run this command
   
    ./gradlew clean  
3. After successful this command run next command
    ./gradlew assembleRelease
    
4. try to run your project from android studio.

`

Is https://github.com/divyeshgohil85/RNImageFilter alternative?

@ya-watanabe
Copy link

Hello, I was facing the same error, after did more analysis i found a solution and this works form me. and i was facing this issue on Mac m2 chip.
"react": "18.2.0", "react-native": "0.72.6",
I add these line on main build.gradle file not in app/build.gradle file.
Inside the buildscript section
` ext { buildToolsVersion = "33.0.0" minSdkVersion = 23 compileSdkVersion = 33 targetSdkVersion = 33 kotlin_version = '1.8.0'
// I add these lines

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

`

i tried it but still same error.! but then i attempted in android studio then i got different error of renderScript

I am having the same problem as above.

 error: cannot find symbol
    final ScriptC_DifferenceBlend script = new ScriptC_DifferenceBlend(ctx.getScript());
          ^
  symbol:   class ScriptC_DifferenceBlend
  location: class DifferenceBlendPostProcessor

I use following versions and M2 mac.

# package.json
    "react-native": "0.73.2",
     "react-native-image-filter-kit": "^0.8.0",

# gradle-wrapper.properties
 distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

I've tried change renderscriptTargetApi and renderscriptSupportModeEnabled, but nothing changed.
Is there anyone who has solved this problem?

@ya-watanabe
Copy link

ya-watanabe commented Feb 19, 2024

I've found that new RN0.72.0 project with react-native-image-filter-kit can complete build. but 0.73.0 can not :(

@ya-watanabe
Copy link

ya-watanabe commented Feb 20, 2024

After careful verification, I found that the version of the gradle plugin was affected.

diff --git a/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml b/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml
index f2a1d2e..51c1ce1 100644
--- a/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml
+++ b/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml
@@ -1,5 +1,5 @@
 [versions]
-agp = "8.1.1"
+agp = "7.4.2"
 gson = "2.8.9"
 guava = "31.0.1-jre"
 javapoet = "1.13.0"

This patch solved issue in mycase.

However, I'm afraid that it may be affected again in future updates.

P.S.
https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes
android.defaults.buildfeatures.renderscript
default values had changed and it affects.

@santimone
Copy link

After careful verification, I found that the version of the gradle plugin was affected.

diff --git a/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml b/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml
index f2a1d2e..51c1ce1 100644
--- a/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml
+++ b/node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml
@@ -1,5 +1,5 @@
 [versions]
-agp = "8.1.1"
+agp = "7.4.2"
 gson = "2.8.9"
 guava = "31.0.1-jre"
 javapoet = "1.13.0"

This patch solved issue in mycase.

However, I'm afraid that it may be affected again in future updates.

P.S. https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes android.defaults.buildfeatures.renderscript default values had changed and it affects.

Thanks, worked for me! <3

@dbarbosapn
Copy link

dbarbosapn commented Apr 7, 2024

Adding
android.defaults.buildfeatures.renderscript=true
To the gradle.properties file fixes this issue, as a temporary solution.

This will be removed on the next Gradle major version (v9), so it would be better to bump the gradle version on this library and enabling renderscript on the project itself with
android { buildFeatures { renderScript true } }
On the app-level build.gradle file.

I'd be happy to contribute to bumping this but I'm struggling to build the project locally 😞

@iyegoroff would appreciate your help on this 👍

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

6 participants