java - Android Update 3 后 Android 资源链接失败
问题描述
在 Android SDK 28+ 更新后,我将我的 gradle 更新到 5.5.1 版本并将 gradle 插件更新到 3.4.2 我收到以下错误,这很烦人,因为我认为我的代码没有错!
“Android 资源链接失败警告:删除资源 com.anirudh.gighub:string/com_facebook_loginview_logged_in_using_facebook_f1gender 而不需要默认值。
F:\gigHub\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1437:错误:找不到资源dimen/smallTxtSize(又名com.anirudh.gighub:dimen/smallTxtSize)。
F:\gigHub\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1438:错误:资源 drawable/facebook_signin_btn(又名 com.anirudh.gighub:drawable/facebook_signin_btn)未找到。错误:链接引用失败。”
Here is the build.gradle
//noinspection GradleCompatible
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.anirudh.gighub"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.13-beta-3'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.facebook.android:facebook-login:5.0.1'
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Here is the App Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.anirudh.gighub">
<uses-permission android:name="android.permission.INTERNET"/>
<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"
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString">
<activity android:name=".MainActivity">
</activity>
<activity android:name=".Register" />
<activity android:name=".SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
</application>
</manifest>*
解决方案
尝试File -> Invalidate Caches / Restart -> Invalidate and Restart
推荐阅读
- function - 使用函数获取组合
- javascript - 选择一个列表以生成另一个列表
- sql - 记录数正确显示,但当日期是相当旧的日期时,“新计算开始日期”列显示所有“######”格式,例如:01-DEC-1184
- excel - 如何用另一个工作表中关于另一个单元格值的另一个单元格信息有条件地替换excel中的单元格信息
- php - 通过字符串操作从另一个创建新变量
- python - 我正在学习 python,所以写了这个小代码来添加 2 个具有 ROI 的图像,但它显示错误
- mesos - OpenEBS 是否支持或有任何适用于 DCOS 或 MESOS 的插件?
- javascript - javascript映射折线,如果条件不匹配,则将不透明度设置为零
- java - 在哪里以及如何存储使用 Jar 执行的 python 脚本?
- c - 生产者/消费者:1 个生产者,多个消费者 - 1 个信号量,1 个互斥体,1 个条件变量