Google Play -505安装错误 [英] Google Play -505 install error
问题描述
我在Google Play中有一个应用程序,该应用程序是使用工具和API 22构建的。一切运行良好,但最后一次使用API 23(工具23.1)进行更新显示用户使用Android 6.0错误编号为-505应用程序或通知)。但它真的是随机的...我知道两个相同的设备 - 与6.0.1的Nexus 5 - 一个有-505,第二个安装更新没有问题....
$经过大量搜索后,我发现这个错误意味着重复的权限,但是哪些...? b $ b
<使用权限android:name =android.permission.INTERNET/>
< uses-permission android:name =android.permission.ACCESS_NETWORK_STATE/>
<使用权限android:name =android.permission.ACCESS_WIFI_STATE/>
< uses-permission android:name =android.permission.ACCESS_FINE_LOCATION/>
< uses-permission android:name =android.permission.ACCESS_COARSE_LOCATION/>
<! - GCM - >
<使用权限android:name =android.permission.GET_ACCOUNTS/>
<使用权限android:name =android.permission.WAKE_LOCK/>
< uses-permission android:name =com.google.android.c2dm.permission.RECEIVE/>
< permission
android:name =com.dummy.mobile.permission.C2D_MESSAGE
android:protectionLevel =signature/>
< uses-permission android:name =com.dummy.mobile.permission.C2D_MESSAGE/>
< android:使用权限
android:name =android.permission.READ_PHONE_STATE/>
< android:使用权限
android:name =android.permission.WRITE_EXTERNAL_STORAGE/>
< android:使用权限
android:name =android.permission.READ_EXTERNAL_STORAGE/>
ANY点子?
对每个使用Android Studio和Gradle和外部库的应用程序开发人员都有帮助。有些会受到影响,有些则不受影响,但例如 Google-Play-Services (在我的情况下,当前版本为8.4.0)会被调用,并且该库很受欢迎...
$ b
描述: 每个应用都有清单中的Gradle中还包含 application_id
,而 packageName
是Android Studio所必需的。 Gradle强制 强制 $ {applicationId}
在他们的声明中,例如从上面提到的GPS:
< provider
android :authorities =$ {applicationId} .google_measurement_service
...
没有声明 applicationId
构建系统使用库appId并且在apk创建之后,上面的提供者将是:
< provider
android:authorities =com.google.android.gms.measurement.google_measurement_service
...
它将被安装在系统中并且没有问题的情况下使用 your.lovely.app
。真正的问题将出现在另一个第二个应用程序 this.app.will.have.minus505
将使用相同的库,并创建时没有 applicationId
。在这个应用程序也有相同的包(在GPS示例com.google.android.gms ...),这是重复错误编号-505,导致 authorities
字段必须唯一 ...如果您在应用程序中声明 applicationId
上面的示例将是:
< provider
android:authorities =your.lovely.app.google_measurement_service
...
这对于整个系统来说是独一无二的,因为它应该是:)请注意,引用 $ {applicationId}
也可以在其他必须唯一的整体中声明 - 系统字段,例如权限,这也不能重复。
在我的例子中:Google-Play-Services和Google Cloud Messaging lib(就我所知的shure v 8.3和8.4)。以上示例第一段摘自推送消息提供者。我的应用程序在从7.x更新后(这个版本没有使用appId引用,也许 $ {packageName}
而不是?)到8.4(使用appId ref)开始崩溃安装-505在设备上,它已经安装了另一个应用程序(与我无关),它也遗漏了 applicationId
声明并使用了相同的GPS lib。首先安装的应用程序使用其原始库 applicationId
(原因是应用程序的/应用程序的/开发人员的缺失),并且该字段在整个系统中必须是唯一的,所以我的应用程序(安装后)变得-505 ...
解决方案: strong>
此处是doc,正确声明了packageName和applicationId。在你的应用中定义这个字段,它永远不会与另一个应用(真正自己的系统中唯一的提供者)干涉。
高级作业 反编译或者只是猜其他应用程序 I have an app in Google Play, which was built with tools and API 22. Everything was working well, but last update with API 23 (tools 23.1) shows users with Android 6.0 error numbered "-505" (in Google Play app or in notification). BUT.. its really random... I know about two same devices - Nexus 5 with 6.0.1 - one have -505, second is installing update without problem.... After a lot of searching I've found information that this error means duplicated permission, but which...? ANY ideas? Answer useful for every app developer who is using Android Studio with Gradle and external libraries. Some are affected, some not, but for example Google-Play-Services (in current 8.4.0 version, in my case) are involed, and this lib is pretty popular... Description: Every app have to declare own When you don't have declared And it will be installed in system with And this will be unique for shure in whole system as it should be :) Note that reference In my case: Google-Play-Services and Google Cloud Messaging lib (as I know for shure v 8.3 and 8.4). Above sample first snippet is from push messages provider. My app after lib update from 7.x (this version is not using appId reference, maybe Solution: Here is doc with proper declaration of both packageName and applicationId. Define this field in your app and it will never "interferre" with another app (really own provider unique in system). Homework for advanced: Decompile or just "guess" anothers app 这篇关于Google Play -505安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
提供程序
(或任何其他应该是唯一的生物)并在您自己的应用程序中声明它。你可能根本不使用它,但它可能会锁定这个原始应用程序的安装。似乎是锁定竞争对手(例如最大竞争对手)装置的不错方法。没有尝试过,希望这种可能性已经解决了...... <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- GCM -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.dummy.mobile.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.dummy.mobile.permission.C2D_MESSAGE" />
<android:uses-permission
android:name="android.permission.READ_PHONE_STATE" />
<android:uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<android:uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
applicationId
in Gradle, and also packageName
in manifest, but this is required by Android Studio. Gradle is not forcing applicationId
to be declared, but it should, beacuse some of libs are using reference ${applicationId}
in their declarations, for example from above mentioned GPS:<provider
android:authorities="${applicationId}.google_measurement_service"
...
applicationId
build system use libs appId and after apk creation above provider will be:<provider
android:authorities="com.google.android.gms.measurement.google_measurement_service"
...
your.lovely.app
without problem. Real problem will be when another, second app this.app.will.have.minus505
will be using same library and also created without applicationId
. In this app there is also same package (in GPS sample com.google.android.gms...) and this is duplication error numbered -505, cause authorities
field must be unique... If you declare in your app applicationId
above sample will be:<provider
android:authorities="your.lovely.app.google_measurement_service"
...
${applicationId}
might be also declared in other must-be-unique-in-whole-system fields, which are for example permissions, which can't duplicate also.${packageName}
instead?) to 8.4 (using appId ref) started crashing installation with -505 on devices, which already have installed another app (not related with my at all) which also misses applicationId
declaration and uses same GPS lib. First installed app "reserves" original Google Cloud Messaging provider authority
field using its "original" lib applicationId
(cause app's/developer's missing) and this field must be unique in whole system, so my app (as installed after) is getting -505...Provider
(or any other should-be-unique creature) and declare it in your own app. You may not use it at all, but it probably lock installation of this original app. Seems like pretty good method to lock installations of competitors (e.g. biggest rival). Didn't tried, hope this possibility is "solved" already...