microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

/node_modules/react-native-code-push/android/codepush.gradle' line: 63 * What went wrong: Could not find matching constructor for: java.io.File(File) #2648

Closed hamdij0maa closed 9 months ago

hamdij0maa commented 9 months ago

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. install react-native-code-push v8.2.0 2.cd android && ./gradlew clean

Actual Behavior

/node_modules/react-native-code-push/android/codepush.gradle' line: 63

caiodeambrosio commented 9 months ago

Same here

hamdij0maa commented 9 months ago

@caiodeambrosio https://github.com/microsoft/react-native-code-push/pull/2649

dishantwalia commented 9 months ago

getting same error not compatible with AGP 8.0

ryskin commented 9 months ago

same (

sontruongna commented 9 months ago

same

djindal61 commented 9 months ago

I am also facing the same issue to upgrade the react-native version from 0.70.7 to 0.72.4 in android and also upgrade the react-native-code-push 8.1.1

tykoth commented 9 months ago

Same here, using react-native 0.72.6 and react-native-code-push ^8.1.1

damasofc commented 9 months ago

same here

nhhai1605 commented 9 months ago

Same here with react-native-code-push ^8.1.1

milon27 commented 9 months ago

same here, any way to solve it

imas234 commented 9 months ago

same issue, hope the PR gets looked at

iita71737 commented 9 months ago

Same issue when I update to 8.2.0 , too

tykoth commented 9 months ago

i've commented the lines 63 and 64 of the file /node_modules/react-native-code-push/android/codepush.gradle and it works on my local setup but when i run in azure or appcenter throws the error again.

kelokchan commented 9 months ago

Here's the temporary patch file using patch-package in case everyone needs it

react-native-code-push+8.2.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index f701564..4faf49f 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -60,8 +60,8 @@ gradle.projectsEvaluated {
             jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
             resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()

-            new File(jsBundleDir).mkdirs()
-            new File(resourcesDir).mkdirs()
+            jsBundleDir.mkdirs()
+            resourcesDir.mkdirs()

             jsBundleFile = file("$jsBundleDir/$bundleAssetName")
tykoth commented 9 months ago

Here's the temporary patch file using patch-package in case everyone needs it

react-native-code-push+8.2.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index f701564..4faf49f 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -60,8 +60,8 @@ gradle.projectsEvaluated {
             jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
             resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()

-            new File(jsBundleDir).mkdirs()
-            new File(resourcesDir).mkdirs()
+            jsBundleDir.mkdirs()
+            resourcesDir.mkdirs()

             jsBundleFile = file("$jsBundleDir/$bundleAssetName")

Your solution works for me!

mgscreativa commented 9 months ago

Here's the temporary patch file using patch-package in case everyone needs it

react-native-code-push+8.2.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index f701564..4faf49f 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -60,8 +60,8 @@ gradle.projectsEvaluated {
             jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
             resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()

-            new File(jsBundleDir).mkdirs()
-            new File(resourcesDir).mkdirs()
+            jsBundleDir.mkdirs()
+            resourcesDir.mkdirs()

             jsBundleFile = file("$jsBundleDir/$bundleAssetName")

works! hope the PR gets approved and merged soon

FaithfulAudio commented 9 months ago

I am also experiencing this issue. Thanks for the patch!

rdnsan commented 9 months ago

Here's the temporary patch file using patch-package in case everyone needs it

react-native-code-push+8.2.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index f701564..4faf49f 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -60,8 +60,8 @@ gradle.projectsEvaluated {
             jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
             resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()

-            new File(jsBundleDir).mkdirs()
-            new File(resourcesDir).mkdirs()
+            jsBundleDir.mkdirs()
+            resourcesDir.mkdirs()

             jsBundleFile = file("$jsBundleDir/$bundleAssetName")

works for me thanks!

tuiza commented 9 months ago

Here's the temporary patch file using patch-package in case everyone needs it

react-native-code-push+8.2.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index f701564..4faf49f 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -60,8 +60,8 @@ gradle.projectsEvaluated {
             jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
             resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()

-            new File(jsBundleDir).mkdirs()
-            new File(resourcesDir).mkdirs()
+            jsBundleDir.mkdirs()
+            resourcesDir.mkdirs()

             jsBundleFile = file("$jsBundleDir/$bundleAssetName")

I'm using RN 0.73.2 and this solution worked for me, thanks 😊

3mv3 commented 9 months ago

Here's the temporary patch file using patch-package in case everyone needs it

react-native-code-push+8.2.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index f701564..4faf49f 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -60,8 +60,8 @@ gradle.projectsEvaluated {
             jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
             resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()

-            new File(jsBundleDir).mkdirs()
-            new File(resourcesDir).mkdirs()
+            jsBundleDir.mkdirs()
+            resourcesDir.mkdirs()

             jsBundleFile = file("$jsBundleDir/$bundleAssetName")

For anyone patching manually using yarn berry + yarn patch react-native-code-push on windows, the patch file may not be generated properly and will have extra diffs for a/windows-legacy/CodePush.Net46, these need deleting from the patch file. It needs to look exactly as above (although I needed an extra carriage return for it to work) 🤷‍♂️

Verified on RN 0.73.2 System: CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz Binaries: Node: 20.9.0 - ~\AppData\Local\Temp\xfs-b683883c\node.CMD Yarn: 4.0.2 - ~\AppData\Local\Temp\xfs-b683883c\yarn.CMD npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD

AnatolyPristensky commented 9 months ago

The fix has been merged, reopened issue for now. Will close it once release with the fix available.

AnatolyPristensky commented 9 months ago

The fix available in the latest 8.2.1 release. Closing this issue.