无法从 Google 安装某些应用程序 在自定义 AOSP 上播放:项目不可用。原因:9
Unable to install some apps from Google Play on customized AOSP: Item is not available. Reason: 9
我在尝试从 Google Play 安装一些应用程序时遇到以下错误:
LibraryUtils.isAvailable: not available restriction=9
DocUtils.getAvailabilityRestrictionResourceId: Item is not available. Reason: 9
我正在 x86 硬件上 运行 定制 AOSP 版本(定制的 Android x86 风格)。我已经研究了很多,网上已经有很多模糊的 attempts/guesses 答案,但我专门在寻找 "Reason 9" 指的是什么。一旦我有了它,我希望我能在 AOSP 中想出一个 hack 来避免错误,因为当我侧载相同的应用程序时,它们 运行 很好。这是我的爱好,所以我不担心一些可能的意外副作用。
如果您从设备中提取 Play 商店 APK,则可以对其进行反编译。我反编译了 APK 并简单搜索了您的错误消息。可以在 class com.google.android.finsky.utils.DocUtils
中找到错误消息
$ grep -lr "Item is not available"
com/google/android/finsky/utils/DocUtils.java
方法如下:
public static int getAvailabilityRestrictionResourceId(Document document) {
int restriction = document.getAvailabilityRestriction();
int resourceId = R.string.availability_restriction_generic;
switch (restriction) {
case 2:
resourceId = R.string.availability_restriction_country;
break;
case 8:
resourceId = R.string.availability_restriction_not_in_group;
break;
case 9:
if (document.getDocumentType() != 1) {
resourceId = R.string.availability_restriction_hardware;
break;
}
resourceId = R.string.availability_restriction_hardware_app;
break;
case 10:
resourceId = R.string.availability_restriction_carrier;
break;
case 11:
resourceId = R.string.availability_restriction_country_or_carrier;
break;
case 12:
resourceId = R.string.availability_restriction_search_level;
break;
case 21:
resourceId = R.string.availability_restriction_for_managed_account;
break;
case 22:
resourceId = R.string.availability_restriction_missing_permission;
break;
}
FinskyLog.d("Item is not available. Reason: " + restriction);
return resourceId;
}
在您的情况下,响应的限制为 9。这将获得两个字符串之一。如果我们使用 ApkTool 反编译 APK 的资源,我们可以看到这两个字符串的值。
<string name="availability_restriction_hardware">"Your device isn't compatible with this item."</string>
<string name="availability_restriction_hardware_app">"Your device isn't compatible with this version."</string>
方法 getAvailabilityRestrictionResourceId(Document document)
在以下 class 中被调用:
$ grep -lr getAvailabilityRestrictionResourceId | grep -v DocUtils
com/google/android/finsky/activities/AppsPermissionsActivity.java
com/google/android/finsky/billing/lightpurchase/OfferResolutionActivity.java
com/google/android/finsky/detailspage/WarningMessageModule.java
com/google/android/finsky/layout/WarningMessageSection.java
如果您提供有关何时记录此信息的信息,将会很有帮助。
问题还是很模糊。通过在 Google 上搜索,一些人通过更改系统 属性 解决了类似问题(最常见于 /system/build.prop
)。
可能不是您想要的答案,但我希望我的研究对您有所帮助。
我在尝试从 Google Play 安装一些应用程序时遇到以下错误:
LibraryUtils.isAvailable: not available restriction=9
DocUtils.getAvailabilityRestrictionResourceId: Item is not available. Reason: 9
我正在 x86 硬件上 运行 定制 AOSP 版本(定制的 Android x86 风格)。我已经研究了很多,网上已经有很多模糊的 attempts/guesses 答案,但我专门在寻找 "Reason 9" 指的是什么。一旦我有了它,我希望我能在 AOSP 中想出一个 hack 来避免错误,因为当我侧载相同的应用程序时,它们 运行 很好。这是我的爱好,所以我不担心一些可能的意外副作用。
如果您从设备中提取 Play 商店 APK,则可以对其进行反编译。我反编译了 APK 并简单搜索了您的错误消息。可以在 class com.google.android.finsky.utils.DocUtils
$ grep -lr "Item is not available"
com/google/android/finsky/utils/DocUtils.java
方法如下:
public static int getAvailabilityRestrictionResourceId(Document document) {
int restriction = document.getAvailabilityRestriction();
int resourceId = R.string.availability_restriction_generic;
switch (restriction) {
case 2:
resourceId = R.string.availability_restriction_country;
break;
case 8:
resourceId = R.string.availability_restriction_not_in_group;
break;
case 9:
if (document.getDocumentType() != 1) {
resourceId = R.string.availability_restriction_hardware;
break;
}
resourceId = R.string.availability_restriction_hardware_app;
break;
case 10:
resourceId = R.string.availability_restriction_carrier;
break;
case 11:
resourceId = R.string.availability_restriction_country_or_carrier;
break;
case 12:
resourceId = R.string.availability_restriction_search_level;
break;
case 21:
resourceId = R.string.availability_restriction_for_managed_account;
break;
case 22:
resourceId = R.string.availability_restriction_missing_permission;
break;
}
FinskyLog.d("Item is not available. Reason: " + restriction);
return resourceId;
}
在您的情况下,响应的限制为 9。这将获得两个字符串之一。如果我们使用 ApkTool 反编译 APK 的资源,我们可以看到这两个字符串的值。
<string name="availability_restriction_hardware">"Your device isn't compatible with this item."</string>
<string name="availability_restriction_hardware_app">"Your device isn't compatible with this version."</string>
方法 getAvailabilityRestrictionResourceId(Document document)
在以下 class 中被调用:
$ grep -lr getAvailabilityRestrictionResourceId | grep -v DocUtils
com/google/android/finsky/activities/AppsPermissionsActivity.java
com/google/android/finsky/billing/lightpurchase/OfferResolutionActivity.java
com/google/android/finsky/detailspage/WarningMessageModule.java
com/google/android/finsky/layout/WarningMessageSection.java
如果您提供有关何时记录此信息的信息,将会很有帮助。
问题还是很模糊。通过在 Google 上搜索,一些人通过更改系统 属性 解决了类似问题(最常见于 /system/build.prop
)。
可能不是您想要的答案,但我希望我的研究对您有所帮助。