-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 signature of method: java.util.ArrayList.get() is applicable for argument types: () values: [] #2470
Comments
I'm facing the same issue ! |
This error occurred on the react-native v0.70.4. Problem was here this line. |
What do you mean @purevsurena? You missed the line? or changed something inside the file? |
The line 5 in codepush.gradle should return a map, and is returning an ArrayList which doesn't support get() method I just pushed a PR with the solution to this issue #2471 |
Facing same issue |
I used v8 on a newly created project and it worked fine for both iOS and Android. But for my old project. it only worked for iOS and gave this error for Android. As @jvgeee said, I downgraded to v7 and it worked fine @malikzype downgrade to v7 for a quick fix |
I am facing same error |
@vlack-coder Yes downgrading to v7 works fine |
Same problem goes for me.
|
v8 only works with react-native 0.71. Nothing is mentioned in the docs. |
i work on react native version 0.66, codepush version 8.0.0 and got this issue too. |
Any update? Facing same on rn 0.68.0 |
Downgrading to 7..0.0 with RN 0.70.5 is working. |
same here for React Native 0.64.2 |
Hello. I have solved this issue by doing the following: @OverRide
so i have ownerName like nguyenquocan and app name like testApp And you want to make update change you must change versionCode in android/app/build.gradle build.gradle will have this object -> android{defaultConfig{versionCode}} change like 1 -> 2. And change versionName don't make update in your app. It is the target you will update. if you have version 1.0.0 and version 1.0.1, it will not update version 1.0.0 to 1.0.1 if you want more details. You can read in this docs. And 1 more thing. Version codepush support differnt sdk. So i have sdk version 30 codepush version 8.0.0 seem not support this. So i use version 7.0.4 then it work. Detail of my sdk i use: That's all. |
same with RN 0.70.5 |
For anyone who is still facing the issue. follow these steps with library "react-native-code-push": "^7.0.1" , "react-native": "0.70.5" Install appcenter CLI - npm install -g appcenter-cli
Create a new app - PS: Replace app name and os to your requirements. Create Production and Staging keys using -
PS: Replace ownerName and appName to your ownerName and appName Once the app is set up, verify it with the appcenter. Changes in React Native codebase.
PS: Dont enter the above code in the If block. PS: this code creates a codepush wrapper class and we wrap the App component in this class
Once all of the above steps are completed, run the following command to create the deployment. And run the following command to update your deployment.
PS: Replace the app_name and deployment_name to your app’s name and Staging/Production respectively. Note: Codepush might have some issues with some versions of ReactNative So make sure you have “react-native-code-push” → “7.0.1” if using “react-native" → “^0.70.0” |
i solved this solved issue "react-native": "0.68.2", I didn't import the import com.microsoft.codepush.react.CodePush; Note! You might have the following error. Cannot add task 'bundleDebugJsAndAssets' as a task with that name already exists. |
I solved this guys. |
+1 I'm also facing same issue. |
please recheck the if you follow all the steps correctly or not |
yes followed all the steps still facing same issue. |
show your code or if you want help then will connect |
Just got the same error. But I solved it by downgrading from 8.0.1 to 7.0.1 code push version. |
Upgraded React Native to 0.71.4 and V8 of rn-code-push no longer causes this error in Android. If you're on an earlier version of React Native, the solution is to use v7 of this plugin, e.g. |
If you want to make it work with a We use the following versions: If you use react-native-code-push+8.0.1.patchdiff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index a0f9d27..09a0951 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -1,9 +1,15 @@
// Adapted from https://raw.githubusercontent.com/facebook/react-native/d16ff3bd8b92fa84a9007bf5ebedd8153e4c089d/react.gradle
+/**
+ * A patch was applied to this file to fix an issue with the CodePush plugin
+ * Issue: https://github.com/microsoft/react-native-code-push/issues/2470#issuecomment-1519511406
+ * Patch: https://github.com/microsoft/react-native-code-push/pull/2471
+ */
+
import java.nio.file.Paths;
-def config = project.extensions.findByName("react") ?: []
-def bundleAssetName = config.bundleAssetName.get() ?: "index.android.bundle"
+def config = project.extensions.findByName("react") ?: [:]
+def bundleAssetName = config.bundleAssetName ? config.bundleAssetName.get() : "index.android.bundle"
// because elvis operator
def elvisFile(thing) {
@@ -24,7 +30,7 @@ android.buildTypes.each { buildType ->
}
gradle.projectsEvaluated {
- def debuggableVariants = config.debuggableVariants.get() ?: ['debug']
+ def debuggableVariants = config.debuggableVariants ? config.debuggableVariants.get() : ['debug']
android.applicationVariants.all { variant ->
// No code push for debuggable variants
@@ -49,8 +55,8 @@ gradle.projectsEvaluated {
def jsBundleFile;
// Additional node commandline arguments
- def nodeExecutableAndArgs = config.nodeExecutableAndArgs.get() ?: ["node"]
- def extraPackagerArgs = config.extraPackagerArgs.get() ?: []
+ def nodeExecutableAndArgs = config.nodeExecutableAndArgs ? config.nodeExecutableAndArgs.get(): ["node"]
+ def extraPackagerArgs = config.extraPackagerArgs ? config.extraPackagerArgs.get() : []
// Make this task run right after the bundle task
def generateBundledResourcesHash;
@@ -73,11 +79,11 @@ gradle.projectsEvaluated {
runBefore("merge${targetName}Assets", generateBundledResourcesHash)
} else {
def jsBundleDirConfigName = "jsBundleDir${targetName}"
- jsBundleDir = elvisFile(config."$jsBundleDirConfigName").get() ?:
+ jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ? elvisFile(config."$jsBundleDirConfigName").get():
file("$buildDir/intermediates/assets/${targetPath}")
def resourcesDirConfigName = "resourcesDir${targetName}"
- resourcesDir = elvisFile(config."${resourcesDirConfigName}").get() ?:
+ resourcesDir = elvisFile(config."${resourcesDirConfigName}") ? elvisFile(config."${resourcesDirConfigName}").get():
file("$buildDir/intermediates/res/merged/${targetPath}")
// In case version of 'Android Plugin for Gradle'' is lower than 1.3.0 |
downgrade v7.0.4 working for me |
Same issue with:
|
For anyone reading this, fyi |
Downgrading helped me but then faced this error : The CodePush module doesn't appear to be properly installed. |
Iam Still facing the same issue downgraded the Codepush version to 7 still the same currently Iam using [email protected] 1: Task failed with an exception.
2: Task failed with an exception.
|
use patch package and change file codepush.gradle |
Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
Getting this error when running Android build (in Android Studio) on the latest version of RN Codepush (8.0.0)
Works fine on V7, assume that either the docs need to be upgraded for v8 or there's a bug somewhere
The text was updated successfully, but these errors were encountered: