Android Studio 渲染错误 [英] Android Studio rendering Error

查看:33
本文介绍了Android Studio 渲染错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我只是尝试渲染我的一个 xml 视图,但出现此错误:

So I just tried to render one of my xml views and I got this error:

Exception raised during rendering: Binary XML file line #-1: No start tag found!

有什么想法吗?我在下面添加了清单文件______________________________清单:

Any ideas? I've included the manifest file below______________________________ manifest:

   <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.adrian.trucktracker">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/legionicon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Locator"
            android:label="@string/title_activity_locator" >
        </activity>
    </application>

</manifest>

推荐答案

由于我还不能发表评论,我将其作为回复发布.这似乎是 Android Studio 中的一个错误,当您直接编辑 xml 文件时,它的图形布局尚未更新.该问题已被提出,我认为它尚未得到纠正.这是 该问题供您投票.

Since I cannot comment yet, I'm posting this as a reply. This seems to be a bug in Android Studio where when you edit the xml file directly, it doesn't update in it's graphical layout yet. The issue has been raised and I don't think it has been corrected yet. Here's the issue for you to upvote.

目前,虽然您不需要重新启动整个 Android Studio.只需关闭选项卡并从项目导航窗格中重新打开它.它会正确加载.它会为您节省很多时间.

For now, though you don't need to restart the entire Android Studio. Just close the tab and reopen it from the project navigation pane. It'll load correctly. It'll save you a lot of time.

这篇关于Android Studio 渲染错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆