Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.3 Beta 1 + Support 25.1.0 = Preview broken

Tags:

Android Studio 2.3 Canary 3. Support libraries 25.1.0.

Layout previews are totally broken. Anything that contains a support-related View seems to break during preview.

In all cases, this is the beginning of the stack:

Exception Details java.lang.NoSuchFieldError: ViewBackgroundHelper   
at android.support.v7.widget.AppCompatBackgroundHelper.loadFromAttributes(AppCompatBackgroundHelper.java:46)   
at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:63)   
at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:56)
....

.. Etc.

Doesn't matter what the layout is like, I'm now getting this bloody ViewBackgroundHelper-related issue come up. Doesn't seem to matter what kind of layout is is or what views are in it.. anything that seems to go through AppCompat hits this error in the preview.

Have never seen this before. Previously had Android Studio 2.3 Canary 2 + Support libs 25.0.1.

Seems like it's just not possible to ever upgrade Android Studio or its support libs without spending hours on this type of stuff, hey?

Thanks for any hints, thanks-

UPDATE

Looks like I'm not the only one. Found a bug logged here, starred by many people already:

https://code.google.com/p/android/issues/detail?id=230183

UPDATE 2

Still an issue with AS 2.3 Beta 1. Still can't see my layouts. Same java.lang.NoSuchFieldError: ViewBackgroundHelper error everywhere.

like image 590
Matthew Housser Avatar asked Dec 14 '16 02:12

Matthew Housser


People also ask

Why is Android Studio not working?

If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version of Android Studio or an incompatible plugin.

What is the latest version of Android studio now?

Android Studio Chipmunk | 2021. With Android Studio Chipmunk Patch 2 and Android Gradle 7.2. 2, you can compile against Android 13 APIs by setting compileSdk=33 . The highest supported minimum SDK version is 32.

Does Android studio still support Java?

On May 7, 2019, Kotlin replaced Java as Google's preferred language for Android app development. Java is still supported, as is C++.


1 Answers

According to the issue tracker, as of Jan 10, 2017:

https://code.google.com/p/android/issues/detail?id=230183

For those of you using the 2.3.0-beta1 Gradle plugin could you please disable the build cache by adding

android.enableBuildCache=false

to your gradle.properties file and let us know if that fixes the issue for you. After adding the line to your gradle.properties, please rebuild the project.

Thanks.

Has proven to solve the issue for some users.

like image 91
Tim Malseed Avatar answered Nov 09 '22 04:11

Tim Malseed