无法在自定义AOSP上安装Google Play中的某些应用程序:该项目不可用。原因:9 [英] Unable to install some apps from Google Play on customized AOSP: Item is not available. Reason: 9

查看:1246
本文介绍了无法在自定义AOSP上安装Google Play中的某些应用程序:该项目不可用。原因:9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试从Google Play安装某些应用时出现以下错误:

  LibraryUtils.isAvailable:not available限制= 9 
DocUtils.getAvailabilityRestrictionResourceId:项目不可用。原因:9

我在x86上运行定制版本的AOSP(自定义Android x86风格)硬件。我已经研究了很多,网上已经有很多模糊的尝试/猜测答案,但我特别在寻找Reason 9是指什么。一旦我有了这些,我希望我可以在AOSP中想出一个黑客来避免这个错误,因为当我装载相同的应用程序时,它们运行良好。这是我的爱好,所以我不担心一些可能的意外副作用。 如果您从设备上下载Play商店APK,则可以对其进行反编译。我反编译APK,并简单搜索了您的错误消息。错误消息可以在 com.google.android.finsky.utils.DocUtils

$ grep -lrItem 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(限制){
案例2:
resourceId = R.string.availability_restriction_country;
休息;
案例8:
resourceId = R.string.availability_restriction_not_in_group;
休息;
案例9:
if(document.getDocumentType()!= 1){
resourceId = R.string.availability_restriction_hardware;
休息;
}
resourceId = R.string.availability_restriction_hardware_app;
休息;
案例10:
resourceId = R.string.availability_restriction_carrier;
休息;
案例11:
resourceId = R.string.availability_restriction_country_or_carrier;
休息;
案例12:
resourceId = R.string.availability_restriction_search_level;
休息;
情况21:
resourceId = R.string.availability_restriction_for_managed_account;
休息;
案例22:
resourceId = R.string.availability_restriction_missing_permission;
休息;
}
FinskyLog.d(Item is not Available。Reason:+ restriction);
返回resourceId;



$ b $ p
$ b

在你的情况下,响应的限制是9。两个字符串之一。如果我们使用 ApkTool 反编译APK的资源,我们可以看到这两个字符串的值。

 < string name =availability_restriction_hardware>您的设备与此商品不兼容。< / string> 
< string name =availability_restriction_hardware_app>您的设备与此版本不兼容。< / string>

方法 getAvailabilityRestrictionResourceId(Document document)是在以下类中调用:

  $ 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 )中解决了类似问题。



可能不是您希望的答案,但我希望我的研究能够帮助您。


I'm getting the following error when trying to install some apps from Google Play:

LibraryUtils.isAvailable: not available restriction=9 
DocUtils.getAvailabilityRestrictionResourceId: Item is not available. Reason: 9

I'm running a customized version of AOSP (a customized Android x86 flavor) on x86 hardware. I've researched a lot and there are lots of vague attempts/guesses at answers already on the net but I'm specifically looking for what "Reason 9" refers to. Once I have that, I'm hoping I can come up with a hack in AOSP to avoid the error as when I sideload the same apps they run fine. This is hobby I'm doing so I'm not worried about some possible unintended side effects.

解决方案

If you pull the Play Store APK from your device you can decompile it. I decompiled the APK and did a simple search for your error message. The error message can be found in the class com.google.android.finsky.utils.DocUtils

$ grep -lr "Item is not available"
com/google/android/finsky/utils/DocUtils.java

Here is the method:

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;
}

In your case, the response has a restriction of 9. This would either get one of two strings. If we decompile the resources of the APK using ApkTool we can see the values of these two strings.

<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>

The method getAvailabilityRestrictionResourceId(Document document) is invoked in the following classes:

$ 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

It would be beneficial if you provide info on when this gets logged.


The problem is still vague. From searching on Google, some people have solved similar problems by changing a system property (most often in /system/build.prop).

Probably not the answer your hoping for, but I hope my research helps out.

这篇关于无法在自定义AOSP上安装Google Play中的某些应用程序:该项目不可用。原因:9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆