gpt4 book ai didi

android - 未找到输出 : error: resource style/TextAppearance. Compat.Notification.Info(又名 package_name :style/TextAppearance. Compat.Notification.Info)

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:45:59 30 4
gpt4 key购买 nike

切换到 Android Studio 3.2 canary 后,我收到以下构建错误。

我看过this发布这个人有类似问题但没有提到解决方案的地方。

我想尝试新的 Material 组件和喷气背包,所以有没有可能我不必切换回去。

com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: error: resource style/TextAppearance.Compat.Notification.Info (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Info) not found.
error: resource style/TextAppearance.Compat.Notification.Info (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Info) not found.
error: resource style/TextAppearance.Compat.Notification.Info (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Info) not found.
error: resource style/TextAppearance.Compat.Notification (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification) not found.
error: resource style/TextAppearance.Compat.Notification (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification) not found.
error: resource style/TextAppearance.Compat.Notification (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification) not found.
error: resource style/TextAppearance.Compat.Notification.Time (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Time) not found.
error: resource style/TextAppearance.Compat.Notification.Time (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Time) not found.
error: resource style/TextAppearance.Compat.Notification.Time (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Time) not found.
error: resource style/TextAppearance.Compat.Notification.Title (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Title) not found.
error: resource style/TextAppearance.Compat.Notification.Title (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Title) not found.
error: resource style/TextAppearance.Compat.Notification.Title (aka com.nsnik.nrs.kotlintest.debug:style/TextAppearance.Compat.Notification.Title) not found.
error: failed linking references.

Build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "com.nsnik.nrs.kotlintest"
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
buildTypes {
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
ext.alwaysUpdateBuildId = false
}
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-Xlint:cast" << "-Xlint:empty" << "-Xmaxerrs"
}
}
testOptions {
execution 'ANDROID_TEST_ORCHESTRATOR'
}
androidExtensions {
experimental = true
}
kapt {
correctErrorTypes = true
}
configurations.all {
exclude group: "androidx.core"
exclude module: "graphics"
}
buildToolsVersion '28.0.0 rc2'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

//KOTLIN
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

//ANDROID-KTX
implementation "androidx.core:core-ktx:$rootProject.androidKTXVersion"

//MATERIAL-COMPONENTS
implementation "com.google.android.material:material:$rootProject.materialComponentVersion"

//APPCOMPAT LIBRARY
implementation "com.android.support:appcompat-v7:$rootProject.supportLibVersion"

//RECYCLER VIEW
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibVersion"

//ANNOTATION SUPPORT LIBRARY
implementation "com.android.support:support-annotations:$rootProject.supportLibVersion"

//DESIGN SUPPORT LIBRARY
implementation "com.android.support:design:$rootProject.supportLibVersion"

//CONSTRAINT LAYOUT
implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLayoutVersion"

//FINDBUGS JSR305
implementation "com.google.code.findbugs:jsr305:$rootProject.findBugJsr305Version"

//RX-ANDROID
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxAndroidVersion"

//RX-JAVA
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxJavaVersion"

//RX BINDING
implementation "com.jakewharton.rxbinding2:rxbinding:$rootProject.rxBindingVersion"
implementation "com.jakewharton.rxbinding2:rxbinding-support-v4:$rootProject.rxBindingVersion"
implementation "com.jakewharton.rxbinding2:rxbinding-appcompat-v7:$rootProject.rxBindingVersion"
implementation "com.jakewharton.rxbinding2:rxbinding-design:$rootProject.rxBindingVersion"
implementation "com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:$rootProject.rxBindingVersion"

//TIMBER LOGGER
implementation "com.jakewharton.timber:timber:$rootProject.timberVersion"

//DAGGER 2
implementation "com.google.dagger:dagger-android:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
implementation 'com.android.support:support-v4:28.0.0-alpha1'
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"

//EVENT BUS
implementation "org.greenrobot:eventbus:$rootProject.eventBusVersion"

//AUTO VALUE
compileOnly "com.google.auto.value:auto-value:$rootProject.autoValueVersion"
annotationProcessor "com.google.auto.value:auto-value:$rootProject.autoValueVersion"

//AUTO PARCEL
annotationProcessor "com.ryanharter.auto.value:auto-value-parcel:$rootProject.autoParcelVersion"

//AUTO VALUE GSON
annotationProcessor "com.ryanharter.auto.value:auto-value-gson:$rootProject.autoValueGsonExtension"
provided "com.ryanharter.auto.value:auto-value-gson:$rootProject.autoValueGsonExtension"

//LEAK CANARY
debugImplementation "com.squareup.leakcanary:leakcanary-android:$rootProject.leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$rootProject.leakCanaryVersion"

//BLOCK CANARY
implementation "com.github.markzhai:blockcanary-android:$rootProject.blockCanaryVersion"

// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.architectureComponentVersion"
// Lifecycles only (no ViewModel or LiveData). Some UI
implementation "androidx.lifecycle:lifecycle-runtime:$rootProject.architectureComponentVersion"
// alternately - if using Java8, use the following instead of lifecycle-compiler
implementation "androidx.lifecycle:lifecycle-common-java8:$rootProject.architectureComponentVersion"
// optional - ReactiveStreams support for LiveData
implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$rootProject.architectureComponentVersion"
// optional - Test helpers for LiveData
testImplementation "androidx.arch.core:core-testing:$rootProject.architectureComponentVersion"

//room
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion"
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:$rootProject.roomVersion"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:$rootProject.roomVersion"
// Test helpers
testImplementation "androidx.room:room-testing:$rootProject.roomVersion"

//paging
implementation "androidx.paging:paging-runtime:$rootProject.pagingVersion"
// RxJava support
//implementation "androidx.paging:paging-rxjava2:$rootProject.pagingVersion"

//NAVIGATION
implementation "android.arch.navigation:navigation-fragment-ktx:$rootProject.navVersion"
// use -ktx for Kotlin
implementation "android.arch.navigation:navigation-ui:$rootProject.navVersion"
androidTestImplementation "android.arch.navigation:navigation-testing-ktx:$rootProject.navVersion"

//WORK-MANAGER
implementation "android.arch.work:work-runtime-ktx:$rootProject.workVersion"
implementation "android.arch.work:work-firebase:$rootProject.workVersion"
androidTestImplementation "android.arch.work:work-testing:$rootProject.workVersion"

//RETROFIT
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"

//OkHttpInterceptor
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.okHttp3InterceptorVersion"

//GSON
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"

//GSON CONVERTER
implementation "com.squareup.retrofit2:converter-gson:$rootProject.gsonConverterVersion"

//RX JAVA RETROFIT ADAPTER
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.rxJavaAdapterVersion"

//SERIAL
implementation "com.twitter.serial:serial:$rootProject.serialVersion"

//MOCKITO
testImplementation "org.mockito:mockito-core:$rootProject.mockitoVersion"

//JETBRAINS ANNOTATION
implementation "org.jetbrains:annotations:$rootProject.jetBrainsAnnotationVersion"

//JUNIT 4
testImplementation "junit:junit:$rootProject.jUnitVersion"

// ANDROID JUNIT RUNNER AND JUNIT RULES
androidTestImplementation "com.android.support.test:runner:$rootProject.runnerVersion"
androidTestImplementation "com.android.support.test:rules:$rootProject.rulesVersion"
androidTestUtil "com.android.support.test:orchestrator:$rootProject.orchestratorVersion"

//ESPRESSO
androidTestImplementation "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$rootProject.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
androidTestImplementation "com.android.support.test.espresso.idling:idling-concurrent:$rootProject.espressoVersion"

//androidTestImplementation "com.android.support.test.espresso:espresso-accessibility:$rootProject.espressoVersion"
implementation "com.android.support.test.espresso:espresso-idling-resource:$rootProject.espressoVersion"

//ROBO-ELECTRIC
testImplementation "org.robolectric:robolectric:$rootProject.roboElectricVersion"
}

最佳答案

I think you should try adding style as below in your styles.xml file. For me it worked perfectly, for the similar kind of issue.

<style name="TextAppearance.AppCompat.Notification">
<item name="android:textSize">12sp</item>
<item name="android:textColor">?android:attr/textColorWhichYouWant</item>
</style>

Or you can use @style/TextAppearance.AppCompat.Notification with TextView in XML file:

<TextView
android:id="@+id/tvNotification"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:maxLines="1"
android:text="Test notification"
android:textAppearance="@style/TextAppearance.AppCompat.Notification" />

Please check this link, You can create your custom notification layout.

关于android - 未找到输出 : error: resource style/TextAppearance. Compat.Notification.Info(又名 package_name :style/TextAppearance. Compat.Notification.Info),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50323729/

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