相关疑难解决方法(0)

无法在Android studio中加载具有未知错误的AppCompat ActionBar

下面是我的xml文件.在预览中有两个错误"无法加载具有未知错误的AppCompat ActionBar"和"无法实现多个类".怎么能运行app.But应用程序崩溃,在Logcat中没有显示错误.

这是我的预览屏幕截图在此输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">


    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="506dp" />

    <LinearLayout
        android:id="@+id/layout_main"
        android:orientation="vertical"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:weightSum="1"
        tools:context=".Activity.MainActivity">


    <LinearLayout
        android:id="@+id/main_layout"
        android:orientation="vertical"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.7"
        tools:context=".Activity.MainActivity">

        <!-- our tablayout to display tabs  -->
        <android.support.design.widget.TabLayout
            android:id="@+id/tabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="50dp"
            app:tabMode="scrollable"
            app:tabSelectedTextColor="@color/colorBlack"
            app:tabTextColor="@color/colorWhite"
            android:background="@color/colorOran"
            android:minHeight="?attr/actionBarSize"
            />

        <!-- View pager to swipe views -->
        <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </LinearLayout>

        <LinearLayout
            android:id="@+id/ll"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:layout_alignParentBottom="true"
            android:background="#ffffff"
            android:orientation="horizontal"
            android:layout_weight="0.3"
            android:weightSum="4"
            tools:layout_editor_absoluteX="8dp" …
Run Code Online (Sandbox Code Playgroud)

android android-actionbar

151
推荐指数
9
解决办法
18万
查看次数

Android Studio渲染库

我刚刚在Test里面创建了项目Android Studio,我收到了以下消息:

摘要:

渲染问题:此版本的渲染库比您的Android Studio版本更新.请更新Android Studio.

细节:

org.jetbrains.android.uipreview.RenderingException: This version of the rendering library is more recent than your version of Android Studio. Please update Android Studio
    at org.jetbrains.android.uipreview.LayoutLibraryLoader.load(LayoutLibraryLoader.java:90)
    at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:159)
    at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:164)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:475)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
    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)
Run Code Online (Sandbox Code Playgroud)

然而我的Android Studio IS是最新的,当我通过Help- > 检查它时Check for Update,我得到了Your already …

android intellij-idea android-studio

30
推荐指数
1
解决办法
2万
查看次数

在Android Studio 3.0布局编辑器中渲染错误

我刚开始学习Kotlin进行android开发,并开始了一个空项目并添加了一个活动.我已经在Kotlin文档中添加了所需的gradle依赖项.默认情况下,MainActivity的xml文件仅包含TextView.但是当我尝试在布局编辑器中预览xml时,它会显示"渲染错误"

Render problem

Failed to load AppCompat ActionBar with unknown error.
Run Code Online (Sandbox Code Playgroud)

我也得到了这个

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
Run Code Online (Sandbox Code Playgroud)

我尝试过重建项目并手动刷新布局.但似乎没有任何效果. …

android android-studio

26
推荐指数
5
解决办法
3万
查看次数

为Android Studio渲染问题

从昨天起我就开始与Android工作室合作了.我的问题是当我进行布局时.我有下一个错误(观看屏幕截图以获取更多信息):

渲染问题:此版本的渲染库比您的Android Studio版本更新.请更新Android Studio

问题

如果我检查更新,他说我已经有最新版本的Android工作室,所以我无法更新.

没有更新

我还在SDK管理器中安装了一些东西,请参见下面的截图.

SDK经理

任何人都可以帮我解决这个问题吗?
谢谢.

rendering android-studio

13
推荐指数
2
解决办法
4万
查看次数

Android Studio无法渲染布局

我已经开始了一个新的android工作室项目,并且在打开主要活动时,设计视图显示了这个错误并且没有在模拟器上显示布局:

org.jetbrains.android.uipreview.RenderingException:无法加载LayoutLib:com/android/layoutlib/bridge/Bridge:org.jetbrains.android.uipreview.LayoutLibraryLoader.load中不支持的major.minor版本52.0(LayoutLibraryLoader.java:90 )位于com.intellij.android.designer的com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:166)的org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:180). design.Surface.AndroidDesignerEditorPanel $ 6.run(AndroidDesignerEditorPanel.java:475)at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue) .java:310)at com.intellij.util.ui.update.MergingUpdateQueue $ 2.run(MergingUpdateQueue.java:254)at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)at com .intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)位于com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)位于com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)com.intellij.util.Alarm $ Request $ 1.run(Alarm.java:351)at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:439)at java.util.concurrent.FutureTask $ Sync.innerRun(FutureTask.java:303)at java.util.concurrent.FutureTask.run(FutureTask. java:138)at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:895)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:918)at java.lang.Thread.run (Thread.java:695)

这里有什么问题?谢谢.

android android-layout android-studio

9
推荐指数
2
解决办法
2万
查看次数

渲染问题@ id /可见Android Studio

我有这个 xml文件.如果我编译它工作正常,但如果我去看预览它会显示我的错误:

在此输入图像描述

我试图寻找这个id,但我无法在任何地方找到它.什么是@ id/visible?我该如何解决这个问题?谢谢

xml android android-layout android-studio

9
推荐指数
2
解决办法
1万
查看次数

Android Studio无法加载平台渲染库

我在Android Studio上有一个从头开始的项目.布局编辑器工作正常.添加Google Play服务库后,现在当我打开布局XML文件时,我在"设计"选项卡中收到以下错误:"渲染问题:无法加载平台渲染库"

在Text选项卡中,我的TextView组件的所有属性都有一个警告"Unknown attribute android:[...]",其中[...]是声明的属性.

有谁知道如何解决这个问题?

android-studio

8
推荐指数
1
解决办法
3万
查看次数

渲染问题无法加载LayoutLib:

渲染问题无法加载LayoutLib:com.android.layoutlib.bridge.Bridge(详细信息)

org.jetbrains.android.uipreview.RenderingException: Failed to load the LayoutLib: com.android.layoutlib.bridge.Bridge
    at org.jetbrains.android.uipreview.LayoutLibraryLoader.load(LayoutLibraryLoader.java:90)
    at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:180)
    at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:166)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:475)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Run Code Online (Sandbox Code Playgroud)

屏幕

android android-layout

8
推荐指数
1
解决办法
1万
查看次数

此版本的渲染库比您的Android Studio版本更新.请更新Android Studio

我刚刚在android studio中创建了新项目.我是这个工具的新手.问题是,它没有向我显示我的设计,它给了我错误,

This version of the rendering library is more recent than your version of Android Studio. Please update Android Studio
Run Code Online (Sandbox Code Playgroud)

我研究它,通过阅读这个问题,我做了同样的Android Studio渲染库1

但是现在,我在MainActivity.java文件中遇到了java编译错误.

在此输入图像描述

在此输入图像描述

我需要导入任何库吗?

java android android-layout android-studio

6
推荐指数
1
解决办法
1万
查看次数

Android Studio 1.5.1渲染问题

我是android studio的新手,我安装了新版本(版本1.5.1).出于某种原因,我不断收到错误消息(每次我使用应用程序主题)时都说有渲染问题:缺少样式.我在网上寻找解决方案,但大多数已经过时或者根本不工作.

错误的图像

谢谢你的帮助.

清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.easycodingplus.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

建立gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.easycodingplus.myapplication"
        minSdkVersion 8
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}
Run Code Online (Sandbox Code Playgroud)

android android-theme android-studio

6
推荐指数
1
解决办法
4459
查看次数

渲染问题并不能解决Android Studio 2.0中的R,为什么会发生这种情况以及如何解决这些问题?

我试图在gradle和java中评论代码的junit部分.它运作正常.但这是解决这个问题的唯一方法吗?为什么评论junit它有效?为什么会出现这个问题?有更好的选择吗?

junit android rendering

5
推荐指数
1
解决办法
131
查看次数

如何解决在android studio中查看预览的问题?字符串索引超出范围:-1

我看不到这个布局的预览,是唯一有这个问题的,可以构建,其他一切都好。拉图特

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".PriceActivity">

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fabAddCart"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:clickable="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:srcCompat="@drawable/ic_baseline_add_shopping_cart_24" />

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            android:orientation="horizontal">

            <EditText
                android:id="@+id/editCode"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:autofillHints=""
                android:ems="10"
                android:hint="Code"
                android:inputType="number|text" />

            <ImageButton
                android:id="@+id/imgbScan"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:adjustViewBounds="true"
                android:background="@drawable/btn_primary"
                android:cropToPadding="true"
                android:padding="8dp"
                android:scaleType="fitCenter"
                android:tint="#fff"
                app:srcCompat="@drawable/ic_baseline_qr_code_scanner_24" />

        </LinearLayout>

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:visibility="gone"
            tools:srcCompat="@tools:sample/backgrounds/scenic" />

        <TextView
            android:id="@+id/txtPrice"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textColor="#2E7D32"
            android:textSize="24sp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/txtName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

java android android-layout

5
推荐指数
1
解决办法
463
查看次数