Render problem android studio как исправить

I'm using Android Studio 0.2.3 and when opened an activity layout normally, the preview should appear on the right side, so that I can switch between Text and Design mode, which should again show the

I’m using Android Studio 0.2.3 and when opened an activity layout normally, the preview should appear on the right side, so that I can switch between Text and Design mode, which should again show the preview of the layout.

But no preview is shown not on the right side neither when I’m in text mode nor in the design mode. I just get the error rendering problems...

When I compile everything and install the app on my device, it works without any errors. For developing and experimenting with the layout, it would still be nice if I could get the preview to work.

I have also tried to switch between different devices in the studio, but no success.

Does anyone know how solve this?

ישו אוהב אותך's user avatar

asked Aug 12, 2013 at 20:10

wasp256's user avatar

6

Change your android version on your designer preview into your current version depend on your Manifest. rendering problem caused your designer preview used higher API level than your current android API level.

Adjust with your current API Level

Adjust with your current API Level. If the API level isn’t in the list, you’ll need to install it via the SDK Manager.

answered Jul 2, 2014 at 5:04

Adiyat Mubarak's user avatar

Adiyat MubarakAdiyat Mubarak

10.1k4 gold badges36 silver badges50 bronze badges

7

In new update android studio 2.2 facing rendering issue then follow this steps.

I fixed it — in styles.xml file I changed

"Theme.AppCompat.Light.DarkActionBar"

to

"Base.Theme.AppCompat.Light.DarkActionBar"

It’s some kind of hack I came across a long time ago to solve similar rendering problems in previous Android Studio versions.

answered Nov 14, 2016 at 6:27

Arpit Patel's user avatar

Arpit PatelArpit Patel

6,9345 gold badges54 silver badges66 bronze badges

1

  1. Open AndroidManifest.xml
  2. Change:

    android:theme="@style/AppTheme"

    to something like:

    android:theme="@style/Theme.AppCompat.Light"
  3. Hit «refresh» button in the «Previev» tab.

H. Pauwelyn's user avatar

H. Pauwelyn

13.1k26 gold badges80 silver badges140 bronze badges

answered Oct 29, 2014 at 13:40

Andrew's user avatar

AndrewAndrew

35.6k11 gold badges138 silver badges110 bronze badges

In the Latest Android Studio 3.1.3, Dependency:

implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'

or

Even in latest by 27th of Aug 18 ie

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
facing similar issue

Change it to

    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1

This will solve your problem of Preview.

UPDATE

Still, in beta01 there is a preview problem for latest appcompact v7 library
make the above change as changing it to alpha01 for solving rendering problem

answered Jul 5, 2018 at 11:38

KRIPA SHANKAR JHA's user avatar

4

When I set that android:autofillHints="" /> in .xml file, I met the issue, Android Studio rendering problems, so I set that android:autofillHints="testHint" />, this issue is gone.

answered Mar 20, 2021 at 1:30

Jin's user avatar

JinJin

1561 silver badge4 bronze badges

2

I have solved the Problem by changing style.xml

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
     <!-- Customize your theme here. -->
</style>

this was an awesom solution.

answered Jun 4, 2015 at 16:43

Sajidkhan's user avatar

SajidkhanSajidkhan

6087 silver badges16 bronze badges

1

it still happens in Android Studio 1.5.1. on Ubuntu and you can solve it simply changing a setting from Gradle:

1) on app/build.gradle dependencies change from:

compile 'com.android.support:design:23.2.0'

to:

compile 'com.android.support:design:23.1.0'

2) rebuild project

3) refresh view

Best regards,

/Angel

answered Mar 2, 2016 at 7:24

Angel's user avatar

AngelAngel

9401 gold badge9 silver badges21 bronze badges

I had the same problem, current update, but rendering failed because I need to update.

Try changing the update version you are on. The default is Stable, but there are 3 more options, Canary being the newest and potentially least stable. I chose to check for updates from the Dev Channel, which is a little more stable than Canary build. It fixed the problem and seems to work fine.

To change the version, Check for Updates, then click the Updates link on the popup that says you already have the latest version.

answered Jun 9, 2015 at 17:41

John's user avatar

JohnJohn

1,4077 gold badges26 silver badges51 bronze badges

In build.gradle below dependencies add:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == "com.android.support") {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion "27.+"
            }
        }
    }
}

This worked for me, I found it on stack, addressed as the «Theme Error solution»:
Theme Error — how to fix?

answered Sep 22, 2018 at 20:09

quant's user avatar

quantquant

4738 silver badges21 bronze badges

Rendering didn’t work for me too. I had <null> value on the right side of the android icon. I ran

sudo apt-get install gradle

I restarted Android studio then and <null> value changed to 23.

Voila, it renders now! :)

enter image description here

answered Dec 5, 2015 at 19:03

MartyIX's user avatar

MartyIXMartyIX

27.3k27 gold badges133 silver badges204 bronze badges

Just download minimum prefered SDK from SDK Manager, then build. Works for me.

answered Feb 8, 2016 at 23:59

Ryde's user avatar

RydeRyde

6438 silver badges22 bronze badges

Make sure your designer version and targetSdkVersion both is same.
Example : If your targetSdkVersion is 22 then change your designer version also 22, so this problem do not occur.

answered Aug 2, 2016 at 4:31

patel135's user avatar

patel135patel135

92713 silver badges19 bronze badges

Best Solution is go to
File -> Sync Project With Gradle Files

I hope this helped

answered Apr 16, 2018 at 2:00

Abdul Wahab's user avatar

Abdul WahabAbdul Wahab

991 gold badge2 silver badges11 bronze badges

All you had to do is go to styles.xml file and replace your parent theme from

 Theme.AppCompat.Light.DarkActionBar 
to 
 Base.Theme.AppCompat.Light.DarkActionBar

answered Sep 6, 2019 at 7:28

Maryam Azhdari's user avatar

Open your activity_main.xml .
Switch to Design view if you are in text view.
Look for the android version,with the android robo icon.
Change the android version.
Problem solved.

this issue is probably derived from the connection of the laptop to software products like AnyConnect. Killing the remote connection works for me.

answered Apr 19, 2021 at 6:04

Elvin Aghammadzada's user avatar

Содержание

  1. Tek Eye
  2. The Rendering Problems Quick Fix
  3. List of Possible Fixes for Android Studio Rendering Problems
  4. Change Android Version for Rendering Layouts
  5. Clean the Project to Fix Rendering Problems
  6. Update the Studio Cache to Fix Rendering Problems
  7. Sync Gradle to Fix Rendering Problems
  8. Update the Project Files to Use Different Library Versions
  9. Change an Apps Theme to Fix Rendering Problems
  10. See Also
  11. Do you have a question or comment about this article?

Tek Eye

This article covers several fixes that have solved the Android Studio rendering problems error message that occassionally occurs. Android Studio is Google’s development IDE for Android Apps. Studio is in constant development and as an Android developer you will get used to updating Studio often. Unfortunately the updates will sometimes break existing projects. One of the common errors after an update is an App’s screen failing to display when the layout file is opened in the editor’s Design tab. Instead of the correct screen being shown it is greyed out and overlaid with a Rendering Problems message. Even though the screen displayed correctly before the Studio update. For example the following rendering problems message is saying that there are Missing styles:

Other rendering problem bugs can appear, e.g. Rendering failed with a known bug or The following classes could not be instantiated. Changes in the Android Software Development Kit (SDK) can sometimes affect previously working projects. The project files may need some minor changes to update them to the new SDK.

The Rendering Problems Quick Fix

Sometimes just changing the rendering version (above the Design window) will fix the Rendering Problems error (see the item in the list of fixes). Also opening the the AppTheme dialog, using the AppTheme button (again at the top of the Design window), and clicking OK will fix the rendering problem. If that does not work try reselecting All then AppTheme in the Select Theme dialog. Another quick fix to try is to compile against a previous Android library version. Nearly every SDK update changes the Android libraries and can add beta versions of forthcoming Android releases. Reverting a probject from a beta library to a previous release can sometimes solve a rendering problem, as described in the Different Libraries solution in the following fixes. If these two fixes don’t work try the other fixes below as a solution to any rendering problems message.

List of Possible Fixes for Android Studio Rendering Problems

Here are some solutions to rendering problems in Android Studio. They may not solve you particular issue but have worked in the past, depending upon what has been updated in Studio. These fixes are for when a project was previously compiling and displaying OK in Studio, but after an update the App screens no longer display correctly. These fixes are not guaranteed to work, especially if the code was NOT previously compiling. For previously working code these fixes, or a combination of these solutions, have solved past rendering problems issues.

Change Android Version for Rendering Layouts

Changing the version of Android for rendering layouts can resolve the rendering problems error, especially is beta versions of new Android releases are installed. Use the dropdown above the design area for the opened layout to change the Android version for rendering:

Clean the Project to Fix Rendering Problems

Use the Clean Project menu option under the Build menu in Studio. This occasionally fixes rendering problems.

Update the Studio Cache to Fix Rendering Problems

Rebuilding Studio’s cache can sometimes fix the rendering problems. Close all but one Android project. Use the File menu to select Invalidate Caches/Restart. Confirm the action when the Invalidate Caches message box appears by clicking the Invalidate and Restart button.

Sync Gradle to Fix Rendering Problems

Try resyncing Gradle with the Android project. Use the Sync Project with Gradle Files button on the toolbar. Alternative use the Tools then Android menu option and select Sync Project with Gradle Files.

Update the Project Files to Use Different Library Versions

Check to see if the correct libraries for the project are still installed. For example the v7 appcompat library and associated v4 Support library. First check the SDK directory to see the versions of the libraries available:

Then check the version in the App’s Gradle file (the build.gradle file in the app directory):

Change the version if required, you may be prompted to synch Gradle.

Change an Apps Theme to Fix Rendering Problems

All of the above solutions to layout rendering problems do not change any of the code files for an App. If all the above has been tried and the problems persist further investigation of the error may be needed. Ultimately this could include recreating the App in a new project (copying all the code over) and comparing the new project with the old to determine the issue. (For large projects that may not be a trivial task). Alternatively changing the Apps theme has fixed rendering problems. Use the AppTheme button when viewing a screen in the Design tab to access the available theme definitions. Choose a new theme for an App, e.g. Holo.

See Also

  • Rendering Problems with WindowDecorActionBar
  • Overview of the Android Support Library
  • Styles and Themes on Android Developer

Author: Daniel S. Fowler Published: 2016-05-22 Updated: 2016-06-26

(Alternatively, use the email address at the bottom of the web page.)

↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.

Free Android Projects and Samples:

Источник

Tek Eye

This article covers several fixes that have solved the Android Studio rendering problems error message that occassionally occurs. Android Studio is Google’s development IDE for Android Apps. Studio is in constant development and as an Android developer you will get used to updating Studio often. Unfortunately the updates will sometimes break existing projects. One of the common errors after an update is an App’s screen failing to display when the layout file is opened in the editor’s Design tab. Instead of the correct screen being shown it is greyed out and overlaid with a Rendering Problems message. Even though the screen displayed correctly before the Studio update. For example the following rendering problems message is saying that there are Missing styles:

Other rendering problem bugs can appear, e.g. Rendering failed with a known bug or The following classes could not be instantiated. Changes in the Android Software Development Kit (SDK) can sometimes affect previously working projects. The project files may need some minor changes to update them to the new SDK.

The Rendering Problems Quick Fix

Sometimes just changing the rendering version (above the Design window) will fix the Rendering Problems error (see the item in the list of fixes). Also opening the the AppTheme dialog, using the AppTheme button (again at the top of the Design window), and clicking OK will fix the rendering problem. If that does not work try reselecting All then AppTheme in the Select Theme dialog. Another quick fix to try is to compile against a previous Android library version. Nearly every SDK update changes the Android libraries and can add beta versions of forthcoming Android releases. Reverting a probject from a beta library to a previous release can sometimes solve a rendering problem, as described in the Different Libraries solution in the following fixes. If these two fixes don’t work try the other fixes below as a solution to any rendering problems message.

List of Possible Fixes for Android Studio Rendering Problems

Here are some solutions to rendering problems in Android Studio. They may not solve you particular issue but have worked in the past, depending upon what has been updated in Studio. These fixes are for when a project was previously compiling and displaying OK in Studio, but after an update the App screens no longer display correctly. These fixes are not guaranteed to work, especially if the code was NOT previously compiling. For previously working code these fixes, or a combination of these solutions, have solved past rendering problems issues.

Change Android Version for Rendering Layouts

Changing the version of Android for rendering layouts can resolve the rendering problems error, especially is beta versions of new Android releases are installed. Use the dropdown above the design area for the opened layout to change the Android version for rendering:

Clean the Project to Fix Rendering Problems

Use the Clean Project menu option under the Build menu in Studio. This occasionally fixes rendering problems.

Update the Studio Cache to Fix Rendering Problems

Rebuilding Studio’s cache can sometimes fix the rendering problems. Close all but one Android project. Use the File menu to select Invalidate Caches/Restart. Confirm the action when the Invalidate Caches message box appears by clicking the Invalidate and Restart button.

Sync Gradle to Fix Rendering Problems

Try resyncing Gradle with the Android project. Use the Sync Project with Gradle Files button on the toolbar. Alternative use the Tools then Android menu option and select Sync Project with Gradle Files.

Update the Project Files to Use Different Library Versions

Check to see if the correct libraries for the project are still installed. For example the v7 appcompat library and associated v4 Support library. First check the SDK directory to see the versions of the libraries available:

Then check the version in the App’s Gradle file (the build.gradle file in the app directory):

Change the version if required, you may be prompted to synch Gradle.

Change an Apps Theme to Fix Rendering Problems

All of the above solutions to layout rendering problems do not change any of the code files for an App. If all the above has been tried and the problems persist further investigation of the error may be needed. Ultimately this could include recreating the App in a new project (copying all the code over) and comparing the new project with the old to determine the issue. (For large projects that may not be a trivial task). Alternatively changing the Apps theme has fixed rendering problems. Use the AppTheme button when viewing a screen in the Design tab to access the available theme definitions. Choose a new theme for an App, e.g. Holo.

See Also

  • Rendering Problems with WindowDecorActionBar
  • Overview of the Android Support Library
  • Styles and Themes on Android Developer

Author: Daniel S. Fowler Published: 2016-05-22 Updated: 2016-06-26

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.

Free Android Projects and Samples:

Источник

Android Studio 3.4.1 Render Problem With AppBarLayout #391

Comments

autthapol-k commented Jun 11, 2019

It happened after use
com.google.android.material.appbar.AppBarLayout (lib version: 1.1.0-alpha07)
in xml

The text was updated successfully, but these errors were encountered:

autthapol-k commented Jun 11, 2019 •

got this after force refresh layout

java.lang.IllegalArgumentException: java.lang.ClassCastException@199bfe3d at sun.reflect.GeneratedMethodAccessor1027.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108) at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:143) at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java) at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38) at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387) at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990) at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674) at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637) at android.animation.ValueAnimator.start(ValueAnimator.java:1069) at android.animation.ValueAnimator.start(ValueAnimator.java:1088) at android.animation.ObjectAnimator.start(ObjectAnimator.java:852) at android.animation.StateListAnimator.start(StateListAnimator.java:188) at android.animation.StateListAnimator.setState(StateListAnimator.java:181) at android.view.View.drawableStateChanged(View.java:21105) at android.view.ViewGroup.drawableStateChanged(ViewGroup.java:7101) at com.google.android.material.appbar.AppBarLayout.drawableStateChanged(AppBarLayout.java:393) at android.view.View.refreshDrawableState(View.java:21160) at android.view.View.dispatchAttachedToWindow(View.java:18379) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:335) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:391) at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:195) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:540) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$5(RenderTask.java:666) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) 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)

autthapol-k commented Jun 11, 2019

I guess that the problem from this line, com.google.android.material.appbar.AppBarLayout.drawableStateChanged(AppBarLayout.java:393)

nauhalf commented Jun 11, 2019 •

I got the same problem. I don’t know the problem only appeared in 3.4.1 only or not.

java.lang.IllegalArgumentException: java.lang.ClassCastException@7167546 at sun.reflect.GeneratedMethodAccessor307.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108) at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:143) at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java) at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38) at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387) at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990) at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1339) at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1471) at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146) at android.animation.AnimationHandler.access$100(AnimationHandler.java:37) at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947) at android.view.Choreographer.doCallbacks(Choreographer.java:761) at android.view.Choreographer_Delegate.doFrame(Choreographer_Delegate.java:66) at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:559) at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:425) at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:120) at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:151) at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:133) at com.android.tools.idea.rendering.RenderTask.lambda$null$8(RenderTask.java:755) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) 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)

If I want to show the preview I must to get rid the AppBarLayout (make the code to be a comment).

Источник

Ошибка рендеринга в Android Studio 3.0 Layout Editor

Я только начал изучать Kotlin для разработки под Android, запустил пустой проект и добавил активность. Я добавил необходимые зависимости gradle, как сказано в документации Kotlin. По умолчанию XML-файл MainActivity содержит только TextView. Но когда я пытаюсь просмотреть XML в Layout Editor, он показывает «Ошибка рендеринга»

Также я получаю это

Я попытался восстановить проект и обновить макет вручную. Но, похоже, ничего не работает.

Так что мне делать? Я использую Android Studio 3.0 Canary 2 с Kotlin

Я добился определенного прогресса. Я обнаружил, что ни одна из моих тем AppCompat не работает.

11 ответов

Хорошо, проверьте ваш gradle, вы добавили поддержку: зависимость appcompat в файле app / build.gradle? также appcompat: зависимость дизайна

Я столкнулся с той же проблемой, когда я пытался автозаполнения. но это будет работать для меня. Убедитесь, что вы добавили эти зависимости:

Если ничего из вышеперечисленного не работает, попробуйте это:

  • Перейдите в Инструменты> Android> SDK Manager
  • Внутренний внешний вид и поведение> Параметры системы> Android SDK выберите вкладку Инструменты SDK.
  • обновите Android SDK Build-Tools до 26.0.1 или более поздней версии.

Этот ответ, скорее всего, решит проблему проблема.

У меня также есть эта проблема, решаемая следующим образом: измените appcompat-v7:26.0.0-beta2 на build.gradle ( modle:app ) на appcompat-v7:26.0.0-beta1 .

Я решил проблему, обновив версию подключаемого модуля gradle до 3.0.0-alpha2 и используя упаковщик gradle gradle-4.0-milestone-1-all.zip.

Я зарегистрировал проблему в трекере проблем андроид-студии — https://issuetracker.google.com/ п / 1 / вопросы / 62251892

Это решение может помочь вам. Изменить style.xml из:

Не удалось выполнить рендеринг в Android Studio android.support.v7.widget.AppCompatImageView

Среда, в которой я работал:
Android Studio 3.0.1

Причина найдена в файле app/build.gradle :

Я изменил некоторые из соответствующих строк следующим образом:

И мне не нужно ничего менять в файле styles.xml . Большинство ответов выше предложили изменить следующую строку:

Я добавил «База». в родительском, чтобы он работал правильно!

Я решил эту проблему, изменив версию дизайна поддержки на ту же версию приложения. Это мой пример зависимости

Ранее я использовал

Есть проблема с версией 25.4.0 поддерживаемых мной библиотек. Я вернулся к версии 25.3.1 и рендер макета работает.

Источник

Я только начал изучать Kotlin для разработки android и начал пустой проект и добавил активность. Я добавил необходимые зависимости gradle, как сказано в документах Kotlin. По умолчанию xml-файл MainActivity содержит только TextView. Но когда я пытаюсь просмотреть xml в Редакторе макета, он показывает «ошибку рендеринга»

Render problem

Failed to load AppCompat ActionBar with unknown error.

и вот это

The following classes could not be instantiated:
- android.support.v7.widget.AppCompatImageView (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.ActionBarContainer (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.Toolbar (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.AppCompatTextView (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache)
- android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)


Exception Details java.lang.ClassNotFoundException: android.support.v4.view.TintableBackgroundView

Я попытался перестроить проект и обновить макет вручную. Но ничего, кажется работа.

Так что же мне делать? Я использую Android Studio 3.0 Canary 2 с Kotlin

редактировать:

Я сделал некоторый прогресс. Я обнаружил, что ни одна из моих тем AppCompat не работает.

11 ответов


ну, проверьте свой gradle, вы добавили поддержку: зависимость appcompat в app / build.файл gradle ? также appcompat: зависимость от дизайна


это решение может вам помочь.
Изменить стиль.xml от:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
</style>

в:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
</style>

у меня также есть эта проблема, решаемая следующим образом: измените appcompat-v7:26.0.0-beta2 on build.gradle (modle:app) к appcompat-v7:26.0.0-beta1.


чувак
Я также имеющих одинаковую проблему с помощью Android студия 3.0,
Я получил решение, просто внесите некоторые изменения в файл стиля в папке значений res.

здесь…

<!-- Base application theme. -->
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

Я добавил » Base.»в родитель, чтобы заставить его работать правильно!

12

автор: Anand Shrivastava


ошибка :

implementation 'com.android.support:appcompat-v7:26.0.0-beta2' 

изменения :

implementation 'com.android.support:appcompat-v7:26.0.0-beta1'

существует проблема с версией 25.4.0 библиотек поддержки мной. Я вернулся к версии 25.3.1 и макет работает визуализация.


ошибка рендеринга в Android Studio android.поддержка.В7.штучка.AppCompatImageView

окружающая среда, над которой я работал:

Android Studio 3.0.1

причина была найдена в :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24           -----> 1
    buildToolsVersion "24.0.0"     -----> 2

    defaultConfig {
        applicationId "com.example.some_project"
        minSdkVersion 15
        targetSdkVersion 24        -----> 3
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.0.0'        -----> 4
}

Я изменил некоторые из соответствующих строк следующим образом:

compileSdkVersion 26                       <------------ 1
buildToolsVersion "26.0.3"                 <------------ 2

targetSdkVersion 26                        <------------ 3

compile 'com.android.support:appcompat-v7:26.1.0'  <---- 4

и мне не нужно было ничего менять в . Большинство ответов, приведенных выше, предлагали: изменить следующую строку:

<style name="AppTheme" parent="Theme.AppCompat.Light">

в следующее:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light">

но я не хотел этого делать. Похоже, что Google Android переместил Theme(s) API от Base пакет в более корневой пакет, когда они обновили API.


2

автор: Vivekananda Athukuri


Если ни одна из вышеперечисленных работ не работает, попробуйте это:

  • перейти к инструменты > Android > SDK Manager
  • внешний вид и поведение > настройки системы > Android SDK выберите вкладку Инструменты SDK.
  • обновите Android SDK Build-Tools до 26.0.1 или последней доступной версии.

этой ответ, скорее всего, решит проблему.


Я решил эту проблему, изменив версию дизайна поддержки на ту же версию appcompat. Это мои примеры зависимостей

dependencies {
    compile 'com.android.support:appcompat-v7:25.3.1'  
    compile 'com.android.support:design:25.3.1'
}

раньше я использовал

compile 'com.android.support:design:25.4.0


я столкнулся с той же проблемой, когда я попробовал автозаполнение. но
Это будет работать на меня. Убедитесь, что вы добавили эти зависимости:

compile "com.android.support:support-core-utils:26.0.0-beta2"
compile "com.android.support:support-v4:26.0.0-beta2"
compile "com.android.support:support-v13:26.0.0-beta2"
compile "com.android.support:appcompat-v7:26.0.0-beta2"
compile 'com.android.support:design:26.0.0-beta2'

и

classpath 'com.android.tools.build:gradle:2.3.3'                  

1

автор: Anything You Want


Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Hassan Osman

heeeeeeeeeeeeeeeeeeellllllllllllllp

3 Answers

Ben Jakuben

STAFF

Hey Hassan Osman, for your first step, try out the solution posted here on StackOverflow: http://stackoverflow.com/a/30253591/475217

After that you’ll need to click on the Gradle Sync button (the one with the green arrow pointing down). That may pull in the required classes to fix your rendering problems. If not, post back here with details. :smile:

Daniel Chapman May 21, 2015 7:26pm

Hi,

I tried the solution in Stack Overflow then followed your instructions after that and I’m still getting an error:

Rendering Problems The following classes could not be instantiated:
— android.support.v7.internal.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.NoClassDefFoundError: Could not initialize class android.support.v7.internal.widget.ActionBarOverlayLayout   at java.lang.reflect.Constructor.newInstance(Constructor.java:422)   at android.view.LayoutInflater.inflate(LayoutInflater.java:482)   at android.view.LayoutInflater.inflate(LayoutInflater.java:414)   at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:84)   at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:56) Copy stack to clipboard

Any ideas what else I can try. Also, i downloaded JDK SE Development Kit 8 instead of 7 — do you think this is causing the problem?

Daniel Chapman May 22, 2015 4:50pm

so my computer had to restart a couple times and then I opened Android Studio and all of a sudden its all working…. so not sure if i just restarting my computer resolved the issue here.

Понравилась статья? Поделить с друзьями:
  • Render job failed as the current clip could not be processed davinci как исправить
  • Render initialization error the division 2
  • Render error you must have valid objects selected
  • Render error wot blitz
  • Render error wink