创建新项目时出现很多错误

时间:2019-05-30 18:05:09

标签: android project new-operator

当我使用Android Studio创建新项目时,我会遇到很多奇怪的错误。该项目是一个全新的项目,我什么也没做,只是尝试运行它而已。

例如,它告诉我没有默认活动,我进入“编辑配置”菜单,更改为“指定活动”,选择创建的新活动。仍然是一个错误,它告诉我我需要在androidManifest中声明它。但是已经是。 如果我尝试重新编译项目,它会告诉我colors.xml(在res文件夹中)存在一些错误。文件不完整。如果我修复它,则其他XML文件有问题。例如res \ mipmap-anydpi-v26 \ ic_launcher_round.xml包含来自另一个项目的代码!

colors.xml中的代码

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
    <component name="AndroidLayouts">
        <shared>
            <config />
        </shared>
    </component>
    <component name="AndroidLogFilters">
        <option n

清单中的代码:

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

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

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

</manifest>

0 个答案:

没有答案