appcelerator-archive / ti.inappbilling

Other
25 stars 32 forks source link

Does not work, throws an error on startIntentSenderForResult #4

Open dereklucas opened 10 years ago

dereklucas commented 10 years ago

I am getting the below error when trying to make purchases. I am using titanium SDK 3.3.0 and the Android version on device is running 4.0.3. I added to the android manifest:

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
        <uses-permission android:name="com.android.vending.BILLING" />
        </manifest>
     </android>

Error:

[INFO] :   queryInventory
[INFO] :   Query Inventory response: OK
[INFO] :   subscriptionsSupported: true
[INFO] :   queryInventory
[INFO] :   Query Inventory response: OK
[INFO] :   purchase gas
[INFO] :   dalvikvm: Could not find method android.app.Activity.startIntentSenderForResult, referenced from method org.appcelerator.titanium.util.TiActivitySupportHelper.launchIntentSenderForResult
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 146: Landroid/app/Activity;.startIntentSenderForResult (Landroid/content/IntentSender;ILandroid/content/Intent;IIILandroid/os/Bundle;)V
[DEBUG] :  dalvikvm: VFY: replacing opcode 0x74 at 0x0016
[WARN] :   W/System.err: java.lang.NoSuchMethodError: android.app.Activity.startIntentSenderForResult
[WARN] :   W/System.err:    at org.appcelerator.titanium.util.TiActivitySupportHelper.launchIntentSenderForResult(TiActivitySupportHelper.java:92)
[WARN] :   W/System.err:    at org.appcelerator.titanium.TiBaseActivity.launchIntentSenderForResult(TiBaseActivity.java:615)
[WARN] :   W/System.err:    at ti.inappbilling.util.IabHelper.launchPurchaseFlow(IabHelper.java:425)
[WARN] :   W/System.err:    at ti.inappbilling.InappbillingModule.purchase(InappbillingModule.java:219)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107)
[WARN] :   W/System.err:    at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347)
[WARN] :   W/System.err:    at ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:942)
[WARN] :   W/System.err:    at android.os.Handler.dispatchMessage(Handler.java:95)
[WARN] :   W/System.err:    at android.os.Looper.loop(Looper.java:154)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[ERROR] :  TiExceptionHandler: (main) [33724,33724] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [1,33725] - In app.js:89,26
[ERROR] :  TiExceptionHandler: (main) [3,33728] - Message: Uncaught Error: android.app.Activity.startIntentSenderForResult
[ERROR] :  TiExceptionHandler: (main) [1,33729] - Source:             InAppBilling.purchase({
[ERROR] :  V8Exception: Exception occurred at app.js:89: Uncaught Error: android.app.Activity.startIntentSenderForResult

Any ideas? I've seen other people with this same problem dating back several weeks, but I can't find any solutions at all.. or even anything pointing in the right direction!

natefollmer commented 10 years ago

I wonder if this isn't what's happening with the issue I just submitted. I have a few users on 4.0.4 that cannot purchase anything, but restoring works. I don't have any devices running 4.0.3 or 4.0.4 so I can't never seen the error they get in the log.

bogdansmc commented 9 years ago

Same issue in android 2.3.7 with all SDKs (3.2.2.GA, 3.4.0.GA, 3.5.0) in InappbillingModule.java, function purchase(HashMap hm) after line: final int resultCode = activitySupport.getUniqueResultCode();

there is error: [INFO] : dalvikvm: Could not find method android.app.Activity.startIntentSenderForResult, referenced from method org.appcelerator.titanium.util.TiActivitySupportHelper.launchIntentSenderForResult [WARN] : dalvikvm: VFY: unable to resolve virtual method 146: Landroid/app/Activity;.startIntentSenderForResult (Landroid/content/IntentSender;ILandroid/content/Intent;IIILandroid/os/Bundle;)V [DEBUG] : dalvikvm: VFY: replacing opcode 0x74 at 0x0016

and after mHelper.launchPurchaseFlow it gets all other errors.

bogdansmc commented 9 years ago

This is titanium bug, not this module! I'll make pull request to titanium_mobile to fix this...

bitshftr commented 9 years ago

Was this ever fixed? Did anyone find a solution?

natefollmer commented 9 years ago

I haven't yet and I think this is happening with some versions of Android 5 also. I've had a few people email me and say that purchasing and restoring isn't working on Samsung S5/S6, but I don't have one to test with.

spudz000 commented 9 years ago

I also have the same problem on both 4.0.4. and 3.2 honeycomb. Not sure what to do here?

natefollmer commented 9 years ago

I think development has stopped on this module. I haven't been able to find a suitable replacement nor do I have the time or skill to fix this (it's been awhile since I've Java'ed). Might be time for me to look into more though, I need to get this fixed.

On Tue, Sep 15, 2015 at 10:39 AM, spudz000 notifications@github.com wrote:

I also have the same problem on both 4.0.4. and 3.2 honeycomb. Not sure what to do here?

— Reply to this email directly or view it on GitHub https://github.com/appcelerator-modules/ti.inappbilling/issues/4#issuecomment-140414873 .