Android studio ...を更新した後、私のプロジェクトは以下のエラーでクラッシュします
Android resource compilation failed
Output: C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1668: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1669: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1670: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1671: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1672: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1673: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1674: error: <item> inner element must either be a resource reference or empty.
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1700: error: <item> inner element must either be a resource reference or empty.
Command: C:\Users\aliya\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\c7465495da03cdfc80a78f27c03646df\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\res\merged\debug \
C:\Users\aliya\Desktop\EventsToday\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
私のプロジェクトレベルのグラドルは
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
mavenCentral()
// maven {
// url 'https://maven.google.com'
// }
// maven { url 'https://maven.fabric.io/public' }
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.Android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:5.4.1"
// classpath 'com.Android.tools.build:gradle:3.0.0-beta1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.Android.gms') {
details.useVersion '12.0.1'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '12.0.1'
}
}
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
そしてアプリレベルのグラドル
apply plugin: 'com.Android.application'
apply plugin: 'kotlin-Android'
apply plugin: 'kotlin-Android-extensions'
apply plugin: 'realm-Android'
Android {
compileSdkVersion 27
defaultConfig {
applicationId "waleed.com.eventstoday"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "Android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
buildTypes {
debug {
buildConfigField "String", "baseUrl", '"www.google.com"'
buildConfigField "String", "buildName", '"Development"'
buildConfigField "String", "countryCode", '"+92"'
}
release {
buildConfigField "String", "baseUrl", '"www.google.com"'
buildConfigField "String", "buildName", '"Release"'
buildConfigField "String", "countryCode", '"+92"'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.Android.support:appcompat-v7:27.1.1'
implementation 'com.Android.support.constraint:constraint-layout:1.1.3'
implementation 'com.Android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.Android.support.test:runner:1.0.2'
androidTestImplementation 'com.Android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.intuit.sdp:sdp-Android:1.0.5'
implementation 'com.facebook.Android:facebook-login:4.35.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.Android.gms:play-services-auth:16.0.0'
implementation 'com.parse:parsetwitterutils-Android:1.10.6'
implementation 'com.parse:parse-Android:1.16.3'
implementation 'io.smooch:core:5.12.1'
implementation 'io.smooch:ui:5.12.1'
implementation 'com.Android.support:recyclerview-v7:27.1.1'
implementation 'com.Android.support:cardview-v7:27.1.1'
implementation 'com.google.Android.gms:play-services-maps:15.0.1'
}
repositories {
mavenCentral()
}
realm {
syncEnabled = true
}
apply plugin: 'com.google.gms.google-services'
さらに情報が必要かどうか教えてください。任意の助けをいただければ幸いです。更新後は動作していませんが、gradleを3.1.0にダウングレードしようとしましたが、動作しませんでした。 .xml iにエラーがあります
uRIが登録されていないことを示すurn:oasis:names:tc:xliff:document:1.2
「xmlns:ns2 = "http://schemas.Android.com/tools" URIが登録されていないことを示しています
プロジェクト全体でtype = "id"を検索し、すべてのインスタンスでitemタグの内容を削除します。例:
これを変更します:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="item_click_support" type="id">2468</item>
</resources>
これに:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="item_click_support" type="id"/>
</resources>
プロジェクトで、すべてのsrc/main/res/values/<name>.xml
ファイルを調べて、次のような構造を探します。
<item type="id" name="my_id">some random value here</item>
重要なのは、IDには値を持たない(新しいIDを作成する)か、他のIDを参照する(値フィールドで@id/other_id
構文を使用)ことです。一致する値を削除するだけです:
<item type="id" name="my_id"></item>
または
<item type="id" name="my_id"/>