小编Alé*_*lho的帖子

找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'.更新到支持库26.0.0时

我在更新到最新的支持库版本26.0.0时遇到此问题(https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0):

错误:(18,21)找不到与给定名称匹配的资源:attr'android:keyboardNavigationCluster'.

/.../app/build/intermediates/res/merged/beta/debug/values-v26/values-v26.xml
Error:(15, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:(18, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:(15, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:(18, 21) No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
Error:Execution failed for task ':app:processBetaDebugResources'.
Run Code Online (Sandbox Code Playgroud)

com.android.ide.common.process.ProcessException:无法执行aapt

该文件来自支持库:

<style name="Base.V26.Widget.AppCompat.Toolbar" parent="Base.V7.Widget.AppCompat.Toolbar">
    <item name="android:touchscreenBlocksFocus">true</item>
    <item name="android:keyboardNavigationCluster">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)

我们使用以下版本:

ext.COMPILE_SDK_VERSION = 26
ext.BUILD_TOOLS_VERSION = "26.0.1"

ext.MIN_SDK_VERSION = 17
ext.TARGET_SDK_VERSION = …
Run Code Online (Sandbox Code Playgroud)

android android-appcompat android-support-library android-gradle-plugin

213
推荐指数
10
解决办法
14万
查看次数

Android O:通知频道本地化

我创建了一个这样的通知频道:

NotificationChannel channel = new NotificationChannel(CHANNEL_ID_FOOBAR, getContext().getString(R.string.notification_channel_foobar), NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
Run Code Online (Sandbox Code Playgroud)

我为R.string.notification_channel_foobar提供了不同的翻译,并且使用创建时使用的语言创建了频道,因此如果我最终更改了设备的语言,那么该频道将保留旧语言.有没有办法克服这个问题,或者这是一个限制,即通过设计?

android localization android-8.0-oreo notification-channel

10
推荐指数
1
解决办法
2058
查看次数

几个新的Proguard在Multidex项目中发布了Google Play服务v10.2.6到v11.0.0

我更新了我们的应用程序以使用最新的Android Firebase SDK v11.0.0(https://firebase.google.com/support/release-notes/android#20170607),突然出现了一堆新的proguard错误,FYI在proguard之前,一切都运转良好.

之前:

compile 'com.google.firebase:firebase-messaging:10.2.6'
compile 'com.google.android.gms:play-services-vision:10.2.6'
Run Code Online (Sandbox Code Playgroud)

后:

compile 'com.google.firebase:firebase-messaging:11.0.0'
compile 'com.google.android.gms:play-services-vision:11.0.0'
Run Code Online (Sandbox Code Playgroud)

问题是它似乎不是一个简单的新缺失的proguard条目,但它似乎打破了整个事情,突然其他几个库似乎受到这种变化的影响.

这些是与GMS相关的Proguard问题:

Note: the configuration keeps the entry point 'com.google.android.gms.ads.identifier.AdvertisingIdClient { com.google.android.gms.internal.zzfd zza(android.content.Context,com.google.android.gms.common.zza); }', but not the descriptor class 'com.google.android.gms.common.zza'
Note: the configuration keeps the entry point 'com.google.android.gms.flags.impl.FlagProviderImpl { void init(com.google.android.gms.dynamic.IObjectWrapper); }', but not the descriptor class 'com.google.android.gms.dynamic.IObjectWrapper'
Note: the configuration keeps the entry point 'com.google.android.gms.measurement.AppMeasurement { AppMeasurement(com.google.android.gms.internal.zzchx); }', but not the descriptor class 'com.google.android.gms.internal.zzchx'
Note: the configuration keeps the entry point 'com.google.android.gms.measurement.AppMeasurement { …
Run Code Online (Sandbox Code Playgroud)

android firebase google-play-services android-proguard okhttp3

8
推荐指数
1
解决办法
1826
查看次数

Fabric BETA 添加了 TwitterAdvertisingInfoPreferences 应用程序的数据

我们使用 Fabric Crashlytics 和 BETA 来分发我们的构建,我们注意到它向应用程序数据添加了某些不需要的首选项。其中之一称为“TwitterAdvertisingInfoPreferences”,它似乎对我们的使用没有用处,可能会成为隐私问题。我们如何防止 Crashlytics 添加它?

android crashlytics-beta android-sharedpreferences crashlytics-android

4
推荐指数
1
解决办法
778
查看次数

无法在'Android L'模拟器上使用OkHttp运行应用程序

我们的应用程序使用最新版本的OkHttp(2.0.0)+ Okio(1.0.0)+ Picasso(2.3.2),我想在新的"Android L"模拟器(英特尔)上试用它并安装它但是当加载应用程序我得到这个:

06-27 09:47:16.214: E/AndroidRuntime(2815): FATAL EXCEPTION: main
06-27 09:47:16.214: E/AndroidRuntime(2815): java.lang.NoSuchMethodError: No static method source(Ljava/io/File;)Lokio/Source; in class Lokio/Okio; or its super classes (declaration of 'okio.Okio' appears in /system/framework/okhttp.jar)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at   com.squareup.okhttp.internal.DiskLruCache.readJournal(DiskLruCache.java:243)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.okhttp.internal.DiskLruCache.open(DiskLruCache.java:224)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.okhttp.Cache.<init>(Cache.java:146)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.picasso.OkHttpDownloader.<init>(OkHttpDownloader.java:74)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.picasso.OkHttpDownloader.<init>(OkHttpDownloader.java:51)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.picasso.OkHttpDownloader.<init>(OkHttpDownloader.java:41)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.picasso.Utils$OkHttpLoaderCreator.create(Utils.java:407)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.picasso.Utils.createDefaultDownloader(Utils.java:255)
06-27 09:47:16.214: E/AndroidRuntime(2815):     at com.squareup.picasso.Picasso$Builder.build(Picasso.java:596)
Run Code Online (Sandbox Code Playgroud)

它来自使用Picasso.with(Context)创建Picasso对象.请注意,相同的代码,在没有任何更改的情况下,在之前的仿真器4.4.2(英特尔)上运行良好.

我不明白这是什么 …

android picasso okhttp okio android-5.0-lollipop

2
推荐指数
1
解决办法
2480
查看次数

Retrofit是否有'ResponseInterceptor'(作为其对应的RequestInterceptor)组件?

我正在使用Retrofit及其大部分组件,如ErrorHandler,Callbacks和RequestInterceptor等.但我错过了像'ResponseInterceptor'这样的东西,它允许我以通用的方式过滤或读取响应中的标题,作为中心点,而不必为每个服务调用设置回调.这是目前我知道如何实现这一目标的唯一方法,但不得不在非常服务调用上显式传递回调对象.

我想要的是对任何存在特定标头的响应采取行动,因此它就像一个分析每个响应的通用对象('ResponseInterceptor').

有这样的事吗?或者更好的想法如何实现这一点,而无需在每个服务调用上设置一个Callback对象?

提前致谢!

android retrofit okhttp

1
推荐指数
1
解决办法
349
查看次数