购买测试期间 Amazon App Tester 崩溃 (Xamarin)
Posted
技术标签:
【中文标题】购买测试期间 Amazon App Tester 崩溃 (Xamarin)【英文标题】:Amazon App Tester crash (Xamarin) during purchase test 【发布时间】:2016-10-06 01:04:02 【问题描述】:使用 Amazon App Tester 测试应用内购买时,应用在此行崩溃
RequestOutput response = IAPService.Purchase(request);
我在关注code sample from here
在输出窗口中,购买似乎调用成功。
06-06 19:42:56.238 D/Mono (24121): Searching for 'nativePurchaseJson'.
06-06 19:42:56.238 D/Mono (24121): Probing 'nativePurchaseJson'.
06-06 19:42:56.238 D/Mono (24121): Found as 'nativePurchaseJson'.
06-06 19:42:56.240 D/AmazonIapV2 Bridge(24121): Executing native Purchase
06-06 19:42:56.246 I/AmazonIapV2(24121): purchase called
06-06 19:42:56.247 I/AmazonIapV2(24121): purchase sku:carquiz.coinsforsale1
06-06 19:42:56.247 D/c (24121): In App Purchasing SDK - Sandbox Mode: sendPurchaseRequest
06-06 19:42:56.267 D/AmazonIapV2 Bridge(24121): java method called
06-06 19:42:56.268 D/AmazonIapV2android(24121): Successfully called native code in 30 ms
我还在我的 AndroidManifest.xml 文件中添加了以下权限
<receiver android:name="com.amazon.device.iap.ResponseReceiver">
<intent-filter>
<action
android:name="com.amazon.inapp.purchasing.NOTIFY"
android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY" />
</intent-filter>
</receiver>
我已经注册了PurchaseResponse
事件,但它从未调用过,因为它在购买过程中崩溃了。
iapService.AddPurchaseResponseListener(EventHandler);
我错过了什么?
更新:
我注意到我的手机通知栏中有一条来自 Amazon App Tester 的通知。它只是部分可见,无法展开以显示完整信息。单击它会将我带到 Amazon App Tester。它说
Implementation Problem Detected
com.myapp.carquiz failed to call PurchasingS..
我猜是PurchasingService
更新 2 我的日志猫
06-07 15:35:07.548 E/AndroidRuntime( 9699): FATAL EXCEPTION: main
06-07 15:35:07.548 E/AndroidRuntime( 9699): Process: com.amazon.sdktestclient, PID: 9699
06-07 15:35:07.548 E/AndroidRuntime( 9699): Theme: themes:default=overlay:com.cyngn.themes.hexo, iconPack:com.cyngn.themes.hexo, fontPkg:com.cyngn.themes.hexo, com.android.systemui=overlay:com.cyngn.themes.hexo, com.android.systemui.navbar=overlay:com.cyngn.themes.hexo
06-07 15:35:07.548 E/AndroidRuntime( 9699): java.lang.RuntimeException: Unable to start activity ComponentInfocom.amazon.sdktestclient/com.amazon.sdktestclient.iap.ui.PurchaseActivity: java.lang.IllegalArgumentException: Path must not be empty.
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.ActivityThread.-wrap11(ActivityThread.java)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.os.Handler.dispatchMessage(Handler.java:102)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.os.Looper.loop(Looper.java:148)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.ActivityThread.main(ActivityThread.java:5461)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at java.lang.reflect.Method.invoke(Native Method)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-07 15:35:07.548 E/AndroidRuntime( 9699): Caused by: java.lang.IllegalArgumentException: Path must not be empty.
06-07 15:35:07.548 E/AndroidRuntime( 9699): at com.squareup.picasso.Picasso.load(Picasso.java:297)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at com.amazon.sdktestclient.iap.ui.PurchaseActivity.updateProductDetails(PurchaseActivity.java:214)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at com.amazon.sdktestclient.iap.ui.PurchaseActivity.onCreatePurchaseActivity(PurchaseActivity.java:120)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at com.amazon.sdktestclient.iap.ui.PurchaseActivity.onCreate(PurchaseActivity.java)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.Activity.performCreate(Activity.java:6251)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
06-07 15:35:07.548 E/AndroidRuntime( 9699): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
06-07 15:35:07.548 E/AndroidRuntime( 9699): ... 9 more
06-07 15:35:07.552 W/JsonSuggestProvider( 4000): ext: null, mimeType: null, handles: false
06-07 15:35:07.552 D/ApplicationSuggestionService( 4000): handles? false
06-07 15:35:07.552 W/ActivityManager( 831): Force finishing activity com.amazon.sdktestclient/.iap.ui.PurchaseActivity
06-07 15:35:07.555 W/DropBoxManagerService( 831): Dropping: data_app_crash (1687 > 0 bytes)
06-07 15:35:07.556 W/ActivityManager( 831): Force finishing activity com.borneomobile.carquiz/md546d24a5175fed40732720790778ad3a9.GameView
【问题讨论】:
我上传了我的应用并通过 Live Environment 运行了应用内购买测试,它似乎可以工作。不确定这个问题是否与 Amazon App Tester 有关。 【参考方案1】:我通过我的开发者仪表板提交应用内项目来解决此问题,下载 JSON 文件只是为了确保我使用正确的格式并将其 adb 推送到我的设备中。
当我再次运行测试时,它可以正常工作。
【讨论】:
【参考方案2】:我通过更新 JSON 文件为 JSON 中指定的每个项目包含一个 smallIconUrl 来解决此问题。
例如
"com.company.apptype.appname.444444" :
"itemType": "CONSUMABLE",
"price": "0.99",
"title": "100 Bullets",
"description": "100 bullets to shoot at bad guys.",
"smallIconUrl": "http://mycdn.com/icons/512/Link-512.png"
,
【讨论】:
需要小图标吗?以上是关于购买测试期间 Amazon App Tester 崩溃 (Xamarin)的主要内容,如果未能解决你的问题,请参考以下文章
Amazon App Tester工具的安装和配置-Amazon内购接入流程以及测试
Amazon Live Testing 工具中的应用内购买退款