Update Unity's gradle wrapper and gradle plugin
In Unity, it seems my Android game is still using gradle wrapper 4.6 and gradle plugin 3.2.0. I updated the plugin from the .gradle file, but I don't know how to update the gradle wrapper version.
I tried copying over the gradle lib folder from my Android Studio projects, but then Unity said Invalid gradle installation
Answer by MechEthan · Feb 25, 2019 at 06:34 PM
The "Android Build Support" component of a Unity download/install comes with a bundled version of Gradle.
e.g. for 2017.4.20f1 on macOS, Gradle version 4.6 is found under 2017.4.20f1/PlaybackEngines/AndroidPlayer/Tools/gradle
~
You COULD upgrade the version in-place, by modifying your Unity install, but I wouldn't recommend it. The version Unity ships with is the version they've tested against, and a newer version might fail to build or cause subtle problems in "successful" builds. (Note: I haven't tried this -- maybe it's what you were describing in your post?)
~
Alternately, you can export the Android Studio project from Unity, and then specify which gradle version Android Studio builds with -- this at least would let you try other versions out without modifying your Unity install.
Your answer
Follow this Question
Related Questions
Control Camera Rotation with Mobile Device Gyroscope 2 Answers
Android gyro z-axis drift problem 0 Answers
Code works in editor, but not on Android device(audio mixer) 1 Answer
hi how to recenter cardboard camera orientation 0 Answers
Unity3d 5 failed to re-package resources (Android build problem) 1 Answer