- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
切换到 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
withTextView
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/
以下代码中的 alert(`${info} : ${pokemondetails[info]}\n`) 的含义是什么?有人可以用更简单的形式向我解释一下吗? let checkname = funct
C-x C-f blah.info 以基本模式打开文件。我使用了 apropos 并发现了 Info-mode,我认为它可能会从基本模式更改为 Info 模式,但这会引发 lisp 错误。 如何在 e
我想在另一个 Info.plist 键 (NSContactsUsageDescription) 的值中使用“Bundle 显示名称”(CFBundleDisplayName) 的值。 我尝试了以下方
我正在使用 Python 3.6.4。我第一次遇到 logger.setLevel(logging.INFO) 被忽略的问题,然后遇到了 this answer ,这让我感到困惑并引发了这个问题。 鉴
我是python新手 如果 logging.info() 足以进行日志记录,为什么我们必须使用 getLogger() 方法实例化一个记录器? 最佳答案 在没有名称的情况下调用 getLogger()
下面是来自源代码的示例代码:https://docs.python.org/3/howto/logging.html import logging logging.basicConfig(filena
我在网上阅读的所有内容都在谈论 Info.plist。当我创建项目时,XCode 为我创建了一个 [应用程序名称]-Info.plist 文件,它似乎与我在网上看到的示例 Info.plist 具有相
我定义了一个记录器实例如下: private static final Logger LOGGER = Logger.getLogger(Main.class.getName()); 我有一个要记录的
我的应用程序因 Info.plist 文件中缺少用途字符串而被拒绝(特别是对于 NSMicrophoneUsageDescription 用法)。 这取决于 react-native-permissi
我正在 Windows 下使用 Python 3.4.2。就我而言, import logging logger = logging.getLogger('logger') logger.setLev
我的背景主要是使用 C 和 C++ 进行 Windows 编程。最近我也有机会使用一些嵌入式 Linux 系统,但我对此还是个新手。 现在我正在为 Openwrt 开发一个实用程序,它需要对正常操作期
所以我只是按照此处所述运行了 INFO 命令 http://redis.io/commands/info 但它只给我默认部分——比如 cpu 信息和其他 当我尝试添加 [section] 参数时 -
我正在尝试了解 QEMU 内存管理(使用 i386 guest ,没有 KVM)。 QEMU 监视器允许列出 CPU 寄存器信息( info registers )、USB 设备( info usb
我的包中有 package-info.java,Hibernate 需要它来实现某些功能(编程实体扫描)。 但是,mvn package 不会导致 package-info.class 在 class
我遇到了似乎很常见的错误,因为 Xcode 似乎找不到我的“Info.plist”文件。 我已经检查了这两个 StackOverflow 问题的答案( Could not read from Info
我一直在尝试阅读 XEP-0030 Service Discovery但发现该语言非常不透明。 我的问题很简单:disco#info 规范和 disco#items 规范有什么区别? 我的猜测是 di
这个问题已经有答案了: String concatenation performance in Log4j (3 个回答) 已关闭 4 年前。 之前我通常使用log.info(“dsasdds ” +
我从 Erlang 文档中看到 supervisor:start_child 可以返回两个不同的非错误结果:{ok, Child} 和 {ok, Child, Info}。这个信息在哪里设置? sim
我使用的是 Crystal 0.25.0,File.info(string).symlink? 在以下示例中应返回 true 时返回 false: `mkdir -p /tmp/delete` Di
对于属性: Persist Security Info=true 和 Persist Security Info=false 你能告诉我它们之间有什么区别吗,如果我不把它放在我的连接中会发生什么? c
我是一名优秀的程序员,十分优秀!