AAPT2错误:查看日志以了解详细信息吗?

时间:2018-07-09 09:28:49

标签: android android-studio

我是Android Studio的初学者,我遵循了本教程https://www.simplifiedcoding.net/bottom-navigation-android-example/
甚至当我下载它时,它也会返回此错误1,这是我的文件样式.xml代码,但是显示错误的文件我没有使用它们`

   <resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="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>

`
 设计导航出现的唯一位置是在我的activity_main.xml

           <android.support.design.widget.BottomNavigationView
    android:id="@+id/navigation"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimary"
    app:itemIconTint="@color/colorNavIcon"
    app:itemTextColor="@color/colorNavText"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:menu="@menu/navigation" />

1 个答案:

答案 0 :(得分:0)

Android资产打包工具(AAPT)会为您的活动获取应用程序res文件,例如AndroidManifest.xmlxml文件,并进行编译。

有时可能会发生AAPT错误,因此请尝试在CleanRebuild之后重启android studio