Gradle error upgrading to Android Studio 3.0 Beta 1

不打扰是莪最后的温柔 提交于 2019-11-27 07:57:40
der_Fidelis

Credit to @Grsmto

As per this blog post you need to open a terminal and launch the following commands sequentially:

UPDATE

Now the workaround it's easier, you just need to go to Build -> Clean Project and then sync.

Windows

gradlew clean

gradlew assemble

Linux/Mac

./gradlew clean

./gradlew assemble

then sync the project.

From https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html, this is a known issue: If you have an existing Android Studio project that's using an alpha version of Android plugin 3.0.0 (such as 3.0.0-alpha9), you may get the following error when you migrate to Android plugin 3.0.0-beta1 and sync your project: Gradle project refresh failed. You could solve it by doing the following steps:

Selecting Build > Clean Project from the menu bar—you need to perform this action only once for each project. You can then sync your project files with Gradle by clicking Sync Project from the toolbar.

See the release note for more details. https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html

Happy coding!

Its a known issue :As Documented here

Just do this simply (No need to type commands)

  • Build > Clean Project from the menu bar.

  • Then sync your project files with Gradle by clicking Sync Project from the toolbar.

Gradle sync failed: Cause: java.lang.NullPointerException
            at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:98)
            at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
            at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
            at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
            at java.nio.file.Paths.get(Paths.java:84)

Read official Release Guideline

Resolve this issue selecting Build > Clean Project from the menu bar—you need to perform this action only once for each project. You can then sync your project files with Gradle by clicking Sync Project from the toolbar.

NOTE

3.0 Beta 1 or 3.0 Beta 2

An early version of a program or application that contains most of the major features, but is not yet complete. Sometimes these versions are released only to a select group of people, or to the general public, for testing and feedback .

Also if none of the 'clean', 'build' etc did not work, then go to Build menu and select "Make Project". It fixed the error for me.

Although it is advisable to perform a clean and build before this.

If clean and sync doesn't quite work for your Java+Kotlin-mixed project, it's possible that you need to change your Kotlin version to be consistent with the IDE supplied Kotlin version, which as of Android Studio 3.0 Beta 2 is 1.1.3-2. I was using 1.1.4 at the time and I found that I had drop it back down, did my clean and sync before it all works again, at which point I can move back to 1.1.4.

Known issue: If you have an existing Android Studio project that's using an alpha version of Android plugin 3.0.0 (such as 3.0.0-alpha9), you may get the following error when you migrate to Android plugin 3.0.0-beta1 and sync your project: Gradle project refresh failed.

Resolve this issue selecting Build > Clean Project from the menu bar—you need to perform this action only once for each project. You can then sync your project files with Gradle by clicking Sync Project from the toolbar.

See the release note for more details. https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!