Open JofBigHealth opened 5 years ago
I am getting similar error in Android Studio when I am building React Native project. Please can you suggest how to solve? I have Android SDK platform 9.0. SDK Tools 28.0.1
Below is the error:
Argument for @NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null java.lang.IllegalArgumentException: Argument for @NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null at com.android.tools.idea.gradle.project.sync.GradleSyncState.$$$reportNull$$$0(GradleSyncState.java) at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncFailed(GradleSyncState.java) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.doPopulateProject(IdeaSyncPopulateProjectTask.java:135) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.populate(IdeaSyncPopulateProjectTask.java:97) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.access$000(IdeaSyncPopulateProjectTask.java:39) at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask$1.run(IdeaSyncPopulateProjectTask.java:86) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144) at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395) at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
@ashwanimm Try downgrading Android Studio to 3.1.x
And then do the Clean and Restart option and maybe also delete the project dotfiles Android Studio adds.
If all else fails, upgrade React Native and all associated packages. That's what we did. Took a day or two of work but solved everything. Had to remove some unmaintained third party packages though
@JofBigHealth Great! Thank you so much. I am able to resolve the issue as per your guidance.
For anyone else who is reading this, RN doesn't support Android Studio 3.2.x currently (0.57.7 - see release notes for 0.57.x) due to changes with Gradle. So try 3.1.x first.
@JofBigHealth Thanks a lot. I solved my problem. I had to downgrade the Android Studio to 3.1.x in order to make it work.
@AugustoAleGon Where can i downgrade to Android Studio to 3.1.x?
@jeongsd Honestly, you have to enter in the developer.android website and you have to search the version that you want. In my case I have installed 3.1.2
The app builds on the CLI (
./gradlew assembleRelease
,react-native run-android
etc). Builds in Android Studio at least sometimes (I think I've had at least one instance when it won't build in this state due toArgument for @NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null
). Presents the following message:Android Studio 3.2.1
Have done:
1) invalidate caches/restart 2) removed node_modules, yarn.lock and global yarn cache 3) deleted Android Studio project files
Reverting to 5.1.0 fixes it.
app/build.gradle
build.gradle