当我尝试将Android代码构建到设备中时,在Android Studio中出现了以下错误:
错误:未找到资源样式/Theme.Base(又名com.example.android.bluetoothlegatt:style / Theme.Base)。 错误:链接参考失败。
当我尝试将Android代码构建到设备中时,在Android Studio中出现了以下错误:
错误:未找到资源样式/Theme.Base(又名com.example.android.bluetoothlegatt:style / Theme.Base)。 错误:链接参考失败。
在您的清单文件中使用AppTheme,请检查代码并查看我将要注释的行
<application
android:name=".application.MyApplication"
android:allowBackup="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:roundIcon="@drawable/app_icon"
android:supportsRtl="true"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme"> // here
检查样式必须像这样:
<style name="AppTheme" parent="Theme.AppCompat.Light">
....customize Theme....
</style>
需要更新Appcompat库:
implementation 'com.android.support:appcompat-v7:28.0.0'
请查看这个链接,它与IT技术有关。
请修改以下任一项:
style name="AppBaseTheme"
为了
style name="AppTheme"
在你的styles.xml文件中。或者更改:
android:theme="@style/AppTheme"
为了
android:theme="@style/AppBaseTheme"
在您的清单应用标签中。
两者应该相同。基本上,您的应用程序正在尝试使用不存在的AppBaseTheme。