gpt4 book ai didi

使用 AppCompatActivity API16 的 Android 应用程序崩溃

转载 作者:太空狗 更新时间:2023-10-29 14:47:21 25 4
gpt4 key购买 nike

我正在开发一个简单的 android 应用程序,它带有一个扩展 AppCompatActivity 的 webview。这是我的应用 list

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

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:name=".App"
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:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>

minSdkVersion:16targetSdk版本:24'com.android.support:appcompat-v7:24.0.0'

问题是当我在我的物理设备上测试应用程序时,它在 API18 及更高版本上运行时没有错误。但是当我在 API16 上尝试时,应用程序崩溃了

E/VdcInflateDelegate: Exception while inflating <vector>
android.content.res.Resources$NotFoundException: Resource is not a ColorStateList

E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo

如果我从 AppCompatActivity 更改为 Activity,应用程序在 API16 上运行良好。我已经尝试了很多在网上找到的解决方案,但都没有奏效。提前致谢

最佳答案

更新构建工具后解决

关于使用 AppCompatActivity API16 的 Android 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38432205/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com