onepf / OpenIAB

Open In-App Billing for Google Play, SlideMe, Amazon Store, Nokia Store, Samsung Apps, Yandex.Store, Appland, Aptoide, AppMall and Fortumo.
http://onepf.org/openiab/
Apache License 2.0
474 stars 171 forks source link

0.9.7.2 (response: 3:Billing Unavailable) #451

Open almalence opened 9 years ago

almalence commented 9 years ago

Hi!

New release ruined work of our billing. Version 0.9.7.2 working fine. Found in FAQ similar error with 0.9.7.2, but description of fix is absolutely not clear.

Error on init stage below.

openiab-0.9.8.4.jar, google market, Note 4

D/OpenIAB (16714): checkOptions() Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={com.google.play=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnztuXLNughHjGW55Zlgicr9r5bFP/K5DBc3jYhnOOo1GKX8M2grd7+SWeUHWwQk9lgQKat/ITESoNPE7ma0ZS1Qb/VfoY87uj9PhsRdkq3fg+31Q/tv5jUibSFrJqTf3Vmk1l/5K0ljnzX4bXI0p1gUoGd/DbQ0RJ3p4Dihl1p9pJWgfI9zUzYfvk2H+OQYe5GAKBYQuLORrVBbrF/iunmPkOFN8OcNjrTpLwWWAcxV5k0l5zFPrPVtkMZzKavTVWZhmzKNhCvs1d8NRwMM7XMejzDpI9A7T9egl6FAN4rRNWqlcZuGIMVizJJhvOfpCLtY971kQkYNXyilD40fefwIDAQAB, com.yandex.store=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6KzaraKmv48Y+Oay2ZpWu4BHtSKYZidyCxbaYZmmOH4zlRNic/PDze7OA4a1buwdrBg3AAHwfVbHFzd9o91yinnHIWYQqyPg7L1Swh5W70xguL4jlF2N/xI9VoL4vMRv3Bf/79VfQ11utcPLHEXPR8nPEp9PT0wN2Hqp4yCWFbfvhVVmy7sQjywnfLqcWTcFCT6N/Xdxs1quq0hTE345MiCgkbh1xVULmkmZrL0rWDVCaxfK4iZWSRgQJUywJ6GMtUh+FU6/7nXDenC/vPHqnDR0R6BRi+QsES0ZnEfQLqNJoL+rqJDr/sDIlBQQDMQDxVOx0rBihy/FlHY34UF+bwIDAQAB}, samsungCertificationRequestCode=899} D/OpenIAB (16714): checkGoogle() verify mode = 0 D/OpenIAB (16714): checkGoogle() google key available = true D/OpenIAB (16714): checkSamsung() activity = com.almalence.opencam.MainScreen@4af82418 D/OpenIAB (16714): hasRequestedPermission() is false for com.nokia.payment.BILLING D/OpenIAB (16714): checkNokia() has permission = false D/OpenIAB (16714): checkNokia() ignoring Nokia wrapper D/OpenIAB (16714): checkFortumo() fortumo sdk available: false D/OpenIAB (16714): checkFortumo() fortumo billing required: false D/OpenIAB (16714): checkFortumo() ignoring fortumo wrapper. D/OpenIAB (16714): checkAmazon() amazon sdk available: false D/OpenIAB (16714): checkAmazon() amazon billing required: false D/OpenIAB (16714): checkAmazon() ignoring amazon wrapper. D/OpenIAB (16714): startSetup() options = Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={com.google.play=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnztuXLNughHjGW55Zlgicr9r5bFP/K5DBc3jYhnOOo1GKX8M2grd7+SWeUHWwQk9lgQKat/ITESoNPE7ma0ZS1Qb/VfoY87uj9PhsRdkq3fg+31Q/tv5jUibSFrJqTf3Vmk1l/5K0ljnzX4bXI0p1gUoGd/DbQ0RJ3p4Dihl1p9pJWgfI9zUzYfvk2H+OQYe5GAKBYQuLORrVBbrF/iunmPkOFN8OcNjrTpLwWWAcxV5k0l5zFPrPVtkMZzKavTVWZhmzKNhCvs1d8NRwMM7XMejzDpI9A7T9egl6FAN4rRNWqlcZuGIMVizJJhvOfpCLtY971kQkYNXyilD40fefwIDAQAB, com.yandex.store=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6KzaraKmv48Y+Oay2ZpWu4BHtSKYZidyCxbaYZmmOH4zlRNic/PDze7OA4a1buwdrBg3AAHwfVbHFzd9o91yinnHIWYQqyPg7L1Swh5W70xguL4jlF2N/xI9VoL4vMRv3Bf/79VfQ11utcPLHEXPR8nPEp9PT0wN2Hqp4yCWFbfvhVVmy7sQjywnfLqcWTcFCT6N/Xdxs1quq0hTE345MiCgkbh1xVULmkmZrL0rWDVCaxfK4iZWSRgQJUywJ6GMtUh+FU6/7nXDenC/vPHqnDR0R6BRi+QsES0ZnEfQLqNJoL+rqJDr/sDIlBQQDMQDxVOx0rBihy/FlHY34UF+bwIDAQAB}, samsungCertificationRequestCode=899} D/OpenIAB (16714): setupWithStrategy() store search strategy = 0 D/OpenIAB (16714): setupWithStrategy() package name = com.almalence.opencam D/OpenIAB (16714): setupWithStrategy() package installer = null D/OpenIAB (16714): finishSetup() === SETUP DONE === result: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable) Appstore: null V/Main billing(16714): Setup finished. V/Main billing(16714): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

openiab-0.9.8.4.jar, google market, S5

D/OpenIAB (19784): checkOptions() Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={com.yandex.store=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6KzaraKmv48Y+Oay2ZpWu4BHtSKYZidyCxbaYZmmOH4zlRNic/PDze7OA4a1buwdrBg3AAHwfVbHFzd9o91yinnHIWYQqyPg7L1Swh5W70xguL4jlF2N/xI9VoL4vMRv3Bf/79VfQ11utcPLHEXPR8nPEp9PT0wN2Hqp4yCWFbfvhVVmy7sQjywnfLqcWTcFCT6N/Xdxs1quq0hTE345MiCgkbh1xVULmkmZrL0rWDVCaxfK4iZWSRgQJUywJ6GMtUh+FU6/7nXDenC/vPHqnDR0R6BRi+QsES0ZnEfQLqNJoL+rqJDr/sDIlBQQDMQDxVOx0rBihy/FlHY34UF+bwIDAQAB, com.google.play=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnztuXLNughHjGW55Zlgicr9r5bFP/K5DBc3jYhnOOo1GKX8M2grd7+SWeUHWwQk9lgQKat/ITESoNPE7ma0ZS1Qb/VfoY87uj9PhsRdkq3fg+31Q/tv5jUibSFrJqTf3Vmk1l/5K0ljnzX4bXI0p1gUoGd/DbQ0RJ3p4Dihl1p9pJWgfI9zUzYfvk2H+OQYe5GAKBYQuLORrVBbrF/iunmPkOFN8OcNjrTpLwWWAcxV5k0l5zFPrPVtkMZzKavTVWZhmzKNhCvs1d8NRwMM7XMejzDpI9A7T9egl6FAN4rRNWqlcZuGIMVizJJhvOfpCLtY971kQkYNXyilD40fefwIDAQAB}, samsungCertificationRequestCode=899} D/OpenIAB (19784): checkGoogle() verify mode = 0 D/OpenIAB (19784): checkGoogle() google key available = true D/OpenIAB (19784): checkSamsung() activity = com.almalence.opencam.MainScreen@65a57b D/OpenIAB (19784): hasRequestedPermission() is false for com.nokia.payment.BILLING D/OpenIAB (19784): checkNokia() has permission = false D/OpenIAB (19784): checkNokia() ignoring Nokia wrapper D/OpenIAB (19784): checkFortumo() fortumo sdk available: false D/OpenIAB (19784): checkFortumo() fortumo billing required: false D/OpenIAB (19784): checkFortumo() ignoring fortumo wrapper. D/OpenIAB (19784): checkAmazon() Android Lollipop not supported, ignoring amazon wrapper. D/OpenIAB (19784): startSetup() options = Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={com.yandex.store=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6KzaraKmv48Y+Oay2ZpWu4BHtSKYZidyCxbaYZmmOH4zlRNic/PDze7OA4a1buwdrBg3AAHwfVbHFzd9o91yinnHIWYQqyPg7L1Swh5W70xguL4jlF2N/xI9VoL4vMRv3Bf/79VfQ11utcPLHEXPR8nPEp9PT0wN2Hqp4yCWFbfvhVVmy7sQjywnfLqcWTcFCT6N/Xdxs1quq0hTE345MiCgkbh1xVULmkmZrL0rWDVCaxfK4iZWSRgQJUywJ6GMtUh+FU6/7nXDenC/vPHqnDR0R6BRi+QsES0ZnEfQLqNJoL+rqJDr/sDIlBQQDMQDxVOx0rBihy/FlHY34UF+bwIDAQAB, com.google.play=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnztuXLNughHjGW55Zlgicr9r5bFP/K5DBc3jYhnOOo1GKX8M2grd7+SWeUHWwQk9lgQKat/ITESoNPE7ma0ZS1Qb/VfoY87uj9PhsRdkq3fg+31Q/tv5jUibSFrJqTf3Vmk1l/5K0ljnzX4bXI0p1gUoGd/DbQ0RJ3p4Dihl1p9pJWgfI9zUzYfvk2H+OQYe5GAKBYQuLORrVBbrF/iunmPkOFN8OcNjrTpLwWWAcxV5k0l5zFPrPVtkMZzKavTVWZhmzKNhCvs1d8NRwMM7XMejzDpI9A7T9egl6FAN4rRNWqlcZuGIMVizJJhvOfpCLtY971kQkYNXyilD40fefwIDAQAB}, samsungCertificationRequestCode=899} D/OpenIAB (19784): setupWithStrategy() store search strategy = 0 D/OpenIAB (19784): setupWithStrategy() package name = com.almalence.opencam D/OpenIAB (19784): setupWithStrategy() package installer = null D/OpenIAB (19784): finishSetup() === SETUP DONE === result: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable) Appstore: null V/Main billing(19784): Setup finished. V/Main billing(19784): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

akarimova commented 9 years ago

Hi @almalence, how do install the app? using adb? According to the logs, your verifyMode=0 = work only with the installer Probably, you don't use adb install -i storepackage /path/to/yourapk Please take a look at https://github.com/onepf/OpenIAB/releases/tag/0.9.8, https://github.com/onepf/OpenIAB/wiki/How-To-add-OpenIAB-to-an-app

almalence commented 9 years ago

Thanks. Added more corrections according to release 0.9.8 guides. Working with Google Play. Not tested with Samsung yet - will write an update later.

akarimova commented 9 years ago

Hi @almalence, we've fixed an issue on Samsung devices. Please try this build https://yadi.sk/d/d4ip8XYveob52 This jar will be published on Tuesday.

almalence commented 9 years ago

Thanks! Great! Will check

almalence commented 9 years ago

Hi!

We added application with IAP on samsung market. Received following error from test team. in my case on the same device everything is ok when installing as apk. The same error when using adb install -i storepackage /path/to/yourapk

03-05 16:54:19.037 16445 16445 D OpenIAB : startSetup() options = Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={}, samsungCertificationRequestCode=899} 03-05 16:54:19.037 16445 16445 D OpenIAB : setupWithStrategy() store search strategy = 0 03-05 16:54:19.037 16445 16445 D OpenIAB : setupWithStrategy() package name = com.almalence.opencam 03-05 16:54:19.037 16445 16445 D OpenIAB : setupWithStrategy() package installer = com.sec.android.app.samsungapps 03-05 16:54:19.057 16445 16445 D OpenIAB : packageInstalled() is true for com.sec.android.app.samsungapps

03-05 16:54:20.887 16445 16445 V Main billing: onActivityResult(899,-1,null 03-05 16:54:20.887 16445 16445 D OpenIAB : handleActivityResult() requestCode: 899 resultCode: -1 data: null 03-05 16:54:20.887 16445 16445 D AndroidRuntime: Shutting down VM 03-05 16:54:20.887 1215 1751 D LockPatternUtilsCache: getCarrierLockPlusMode() 03-05 16:54:20.887 1215 1751 D LockPatternUtilsCache: value : false 03-05 16:54:20.887 16445 16445 E AndroidRuntime: FATAL EXCEPTION: main 03-05 16:54:20.887 16445 16445 E AndroidRuntime: Process: com.almalence.opencam, PID: 16445 03-05 16:54:20.887 16445 16445 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=899, result=-1, data=null} to activity {com.almalence.opencam/com.almalence.opencam.MainScreen}: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.sec.android.iap.service.iapService } 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:3976) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:4019) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ActivityThread.access$1400(ActivityThread.java:172) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1471) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.os.Looper.loop(Looper.java:145) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5834) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.sec.android.iap.service.iapService } 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1982) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2090) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ContextImpl.bindService(ContextImpl.java:2068) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.content.ContextWrapper.bindService(ContextWrapper.java:559) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at org.onepf.oms.appstore.SamsungAppsBillingService.bindIapService(SamsungAppsBillingService.java:383) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at org.onepf.oms.appstore.SamsungAppsBillingService.handleActivityResult(SamsungAppsBillingService.java:268) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at org.onepf.oms.OpenIabHelper.handleActivityResult(OpenIabHelper.java:1341) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at com.almalence.opencam.MainScreen.onActivityResult(MainScreen.java:3197) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:6475) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:3972) 03-05 16:54:20.887 16445 16445 E AndroidRuntime: ... 10 more

Our code is the following

Map<String, String> storeKeys = new HashMap<String, String>();
            storeKeys.put(OpenIabHelper.NAME_GOOGLE, base64EncodedPublicKeyGoogle);
            storeKeys.put("com.yandex.store", base64EncodedPublicKeyYandex);

            OpenIabHelper.Options.Builder builder = new OpenIabHelper.Options.Builder()
            .setStoreSearchStrategy(OpenIabHelper.Options.SEARCH_STRATEGY_INSTALLER);

            OpenIabHelper.Options.Builder builder = new OpenIabHelper.Options.Builder()
.setStoreSearchStrategy(OpenIabHelper.Options.SEARCH_STRATEGY_INSTALLER_THEN_BEST_FIT)
            .setVerifyMode(OpenIabHelper.Options.VERIFY_EVERYTHING)
            .addStoreKeys(storeKeys);

            mHelper = new OpenIabHelper(this, builder.build());
almalence commented 9 years ago

Hi!

Are there any news? It's a problem in my code or some known issue?

RomanZhilich commented 9 years ago

Looks like another one of those Lollipop crashed with implicit intent. I'll check our code and get back to you.

RomanZhilich commented 9 years ago

With b836e2dff5a5234418e7d1ef6534c875d2950359 your issue is hopefully fixed. Please try out latest build: https://yadi.sk/d/hugMOgiZeye9y

almalence commented 9 years ago

Hi

tested with this version

D/OpenIAB (31969): checkOptions() Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={}, samsungCertificationRequestCode=899} D/OpenIAB (31969): checkGoogle() verify mode = 0 D/OpenIAB (31969): checkGoogle() google key available = false D/OpenIAB (31969): checkGoogle() ignoring GooglePlay wrapper. D/OpenIAB (31969): checkSamsung() activity = com.almalence.opencam.MainScreen@3290e3c9 D/OpenIAB (31969): hasRequestedPermission() is false for com.nokia.payment.BILLING D/OpenIAB (31969): checkNokia() has permission = false D/OpenIAB (31969): checkNokia() ignoring Nokia wrapper D/OpenIAB (31969): checkFortumo() fortumo sdk available: false D/OpenIAB (31969): checkFortumo() fortumo billing required: false D/OpenIAB (31969): checkFortumo() ignoring fortumo wrapper. D/OpenIAB (31969): checkAmazon() amazon sdk available: false D/OpenIAB (31969): checkAmazon() amazon billing required: false D/OpenIAB (31969): checkAmazon() ignoring amazon wrapper. D/OpenIAB (31969): startSetup() options = Options={availableStores=[], availableStoreNames=[], preferredStoreNames=[], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={}, samsungCertificationRequestCode=899} D/OpenIAB (31969): setupWithStrategy() store search strategy = 0 D/OpenIAB (31969): setupWithStrategy() package name = com.almalence.opencam D/OpenIAB (31969): setupWithStrategy() package installer = com.sec.android.app.samsungapps

D/OpenIAB (31969): packageInstalled() is true for com.sec.android.app.samsungapps

D/OpenIAB (31969): handleActivityResult() requestCode: 899 resultCode: -1 data: null

D/OpenIAB (31969): Init IAP connection status code: 0

D/OpenIAB (31969): getItemsInbox, startNum = 1, endNum = 100

E/OpenIAB (31969): Illegal state for operation (launchPurchaseFlow): IAB helper setup failed. W/System.err(31969): java.lang.IllegalStateException: IAB helper setup failed. Can't perform operation: launchPurchaseFlow W/System.err(31969): at org.onepf.oms.OpenIabHelper.checkSetupDone(OpenIabHelper.java:1556) W/System.err(31969): at org.onepf.oms.OpenIabHelper.launchPurchaseFlow(OpenIabHelper.java:1329) W/System.err(31969): at org.onepf.oms.OpenIabHelper.launchPurchaseFlow(OpenIabHelper.java:1314) W/System.err(31969): at com.almalence.opencam.MainScreen.purchaseMultishot(MainScreen.java:3083) W/System.err(31969): at com.almalence.opencam.ui.AlmalenceStore.purchasePressed(AlmalenceStore.java:451) W/System.err(31969): at com.almalence.opencam.ui.AlmalenceStore.access$0(AlmalenceStore.java:427) W/System.err(31969): at com.almalence.opencam.ui.AlmalenceStore$5.onClick(AlmalenceStore.java:416) W/System.err(31969): at android.view.View.performClick(View.java:5156) W/System.err(31969): at android.view.View$PerformClick.run(View.java:20755) W/System.err(31969): at android.os.Handler.handleCallback(Handler.java:739) W/System.err(31969): at android.os.Handler.dispatchMessage(Handler.java:95) W/System.err(31969): at android.os.Looper.loop(Looper.java:145) W/System.err(31969): at android.app.ActivityThread.main(ActivityThread.java:5834) W/System.err(31969): at java.lang.reflect.Method.invoke(Native Method) W/System.err(31969): at java.lang.reflect.Method.invoke(Method.java:372) W/System.err(31969): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388) W/System.err(31969): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183) E/Main billing(31969): Purchase result IAB helper setup failed. Can't perform operation: launchPurchaseFlow

but this is probably because I don't have version with IAP on samsung store?

RomanZhilich commented 9 years ago

Try enabling Samsung test mode, as suggested in documentation.

almalence commented 9 years ago

Thanks!

Confirm - working.

Tested on S5 and Note 4.

Closing issue. Thanks for assistance!

almalence commented 9 years ago

when loading to samsung market I see - "This binary does not support IAP." Probably built you sent doesn't have some option?

I removed - SamsungApps.isSamsungTestMode = true;

akarimova commented 9 years ago

Was it OK before? Are you a commercial seller http://developer.samsung.com/forum/board/thread/view.do?boardName=SDK&messageId=270942 ?

almalence commented 9 years ago

it was ok before. I tried old OpenIAB libs and old my apk - the same message. Probably this is samsung issues with store... checking. will write an update later.