Skip to content

Fix android payments

Rafał Mikrut requested to merge github/fork/volzhs/fix_android_payments into master

Created by: volzhs

I compiled with latest commit (2b64f73b0459190d20b2f6de39275ee7979317c4) and run on HTC nexus 9 (android 5.1.1). App crashed with below logs.

06-29 02:42:36.188: D/AndroidRuntime(5524): Shutting down VM
06-29 02:42:36.194: E/AndroidRuntime(5524): FATAL EXCEPTION: main
06-29 02:42:36.194: E/AndroidRuntime(5524): Process: com.macaron.macaron, PID: 5524
06-29 02:42:36.194: E/AndroidRuntime(5524): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.macaron.macaron/com.android.godot.Godot}: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.android.vending.billing.InAppBillingService.BIND }
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ActivityThread.access$800(ActivityThread.java:151)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.os.Handler.dispatchMessage(Handler.java:102)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.os.Looper.loop(Looper.java:135)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ActivityThread.main(ActivityThread.java:5254)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at java.lang.reflect.Method.invoke(Native Method)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at java.lang.reflect.Method.invoke(Method.java:372)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
06-29 02:42:36.194: E/AndroidRuntime(5524): Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.android.vending.billing.InAppBillingService.BIND }
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1680)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1779)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ContextImpl.bindService(ContextImpl.java:1757)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.content.ContextWrapper.bindService(ContextWrapper.java:539)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at com.android.godot.payments.PaymentsManager.initService(PaymentsManager.java:50)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at com.android.godot.Godot.initializeGodot(Godot.java:367)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at com.android.godot.Godot.onCreate(Godot.java:532)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.Activity.performCreate(Activity.java:5990)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
06-29 02:42:36.194: E/AndroidRuntime(5524):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
06-29 02:42:36.194: E/AndroidRuntime(5524):     ... 10 more

I fixed this error by this (http://stackoverflow.com/questions/24480069/google-in-app-billing-illegalargumentexception-service-intent-must-be-explicit).

I tested this Nexus 9 (5.1.1), Galaxy S3 (4.1.2), LG-SU760 (2.3.5). and works fine.

Merge request reports