今天做in_app billing feature时发现一个问题,当进行到 添加 Credit Card界面里程序会crash (下图是在play store里支持付费app时的界面,会遇到同样的问题,所以用在此处作为参照)
点击 Continue之后 就会Crash... Crash 信息如下:
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40942068
Starting: Intent { cmp=com.android.vending/com.google.android.finsky.activities.FinskyCreateInstrumentActivity (has extras) } from pid 746
Could not find method android.app.Activity.getActionBar, referenced from method com.google.android.finsky.layout.CustomActionBarFactory.getInstance
VFY: unable to resolve virtual method 115: Landroid/app/Activity;.getActionBar ()Landroid/app/ActionBar;
VFY: replacing opcode 0x6e at 0x0006
VFY: dead code 0x0009-0010 in Lcom/google/android/finsky/layout/CustomActionBarFactory;.getInstance (Landroid/app/Activity;)Lcom/google/android/finsky/layout/CustomActionBar;
VFY: dead code 0x0012-0017 in Lcom/google/android/finsky/layout/CustomActionBarFactory;.getInstance (Landroid/app/Activity;)Lcom/google/android/finsky/layout/CustomActionBar;
GC_EXTERNAL_ALLOC freed 223K, 42% free 3778K/6471K, external 1017K/1028K, paused 39ms
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x401a3568)
FATAL EXCEPTION: main
java.lang.NullPointerException
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment.getAddressSpec(AddCreditCardFragment.java:249)
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment.setupWidgets(AddCreditCardFragment.java:349)
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment.onBillingCountriesLoaded(AddCreditCardFragment.java:286)
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment.access$400(AddCreditCardFragment.java:55)
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment$3.run(AddCreditCardFragment.java:271)
at com.google.android.finsky.billing.GetBillingCountriesAction.run(GetBillingCountriesAction.java:40)
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment.loadBillingCountries(AddCreditCardFragment.java:268)
at com.google.android.finsky.billing.creditcard.AddCreditCardFragment.onCreateView(AddCreditCardFragment.java:243)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:870)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:420)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3694)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
产生这个错误的原因是:Google 发现你处于没有被授权支付的国度。这好像是无法躲过检查的,SIM卡里的地理信息好像是伪装不了的。
When an invalid country (one not authorized/enabled for purchases like China) code is read from the SIM and not found in the list mCountries ( BillingPreferences.BILLING_COUNTRIES ), the mSelectedCountry is set to NULL:
private void setupWidgets(Bundle bundle)
{
mSelectedCountry =
BillingUtils.findCountry(BillingUtils.getDefaultCountry(getActivity(), null),
mCountries);
...
mBillingAddress.setAddressSpec(mSelectedCountry,
getAddressSpec(mSelectedCountry));
...
}
SUGGESTED FIX:
com.google.android.finsky.billing.creditcard.AddCreditCardFragment.getAddressSpecroutine should check parameter NULL condition.
上网搜索,发现了有人与我遇到了同样的问题:
参考资料:
http://code.google.com/p/android/issues/detail?id=27188这里面详细说明了问题出现的原因
http://code.google.com/p/android/issues/detail?id=28162
分享到:
相关推荐
Android In-App Billing v3 Library This is a simple, straight-forward implementation of the Android v3 In-app billing API. It supports: In-App Product Purchases (both non-consumable and consumable) ...
A2billing installing script procedure
android-play-billing-master.zip源码对你学习android会有帮助
3.2.23 计费模式(Billing_Mode)实体 76 3.2.24 属性值单位(Attr_Value_Unit)实体 76 3.2.25 属性值类型(Attr_Value_Type)实体 77 3.2.26 时间段(Time_Segment)实体 77 第4章 客户域模型 79 4.1 客户域概念设计 79 ...
ActiveMerchant :: Billing :: Base . mode = :production ActiveMerchant :: Billing :: EpsilonGateway . contract_code = '12345678' ActiveMerchant :: Billing :: EpsilonGateway . proxy_port = 8080 Acti
InterCompany_Billing_IDoc
安卓计费Android 测试应用程序专注于 Google Play In-app Billing。 第一个版本或多或少基于。
android-billing-services将模块连接到项目1.将子模块添加到项目存储库git submodule add https://github.com/LimeHD/android-billing-services.git2.将模块导入项目文件->新建->导入模块... 指定模块的路径,然后...
Android SDK r14离线安装包 1、基础包------ android-sdk_r14-windows_1.zip 包含:Tools Android SDK Tools Android SDK Platform-tools Extras Android Support package Google Admob Ads Sdk package ...
billing_service.h
billing_file.h
billing_file.c
billing_service.c
google-billing-4.0.0.jar
自己转换的Android开发指南中的In-app Billing章节, 制作成了6寸的PDF,专门为Kindle3等6寸电纸书设计。
asterisk 計費模塊,提供軟交換機計費之用。
可云性 Cloudability 的 API 的简单 javascript 包装器。 安装 将其添加到您的 package.json 文件中。 { ... "dependencies" : { ... ... query ( 'billing_reports' , query_params , function
注意!注意!注意!:需要导入jar然后将AndroidManifest.xml的权限和Activity声明整合到自己...从com.android.billingclientbilling1.2.aar中提取出来的资源,里面包括jar和AndroidManifest.xml,方便eclipse的用户使用
Google Play 结算库 Jar包,用于Android手机版Google 支付接入SDK 内有billing-2.0.3.jar android-support-v4-27.1.1.jar AndroidManifest.xml
具有developerPayload支持的计费库 它是Play计费库的分支: : 原始文件:com.android.billingclient:billing:1.0 原始版本缺少... .setSku( " inapp_1 " ) .setType( SkuType . INAPP ) .setDeveloperP