appcelerator-archive / ti.inappbilling

Other
25 stars 32 forks source link

Not working #31

Closed jamesboyle1968 closed 6 years ago

jamesboyle1968 commented 6 years ago

I am bit of a newbie but I am sure this module does not work with Appcelerator and SDK 7.1. Keeps on giving me a error on the device screen whenever I try to buy something. Checked my google play configuration - all seems fine, using an actual phone as well. Just does not seem to work.

nigelunderwood commented 6 years ago

I have the same issue in that the module does not work with 7.1 SDK. Apparently we have to wait for 7.2 SDK which is not good for me as I have to finish the app dev work. Trying to port back to 6.X SDK, but this version I find far too buggy so at the moment I have heading to a dead end.

jamesboyle1968 commented 6 years ago

Why do we have to wait....cant this be fixed to work with 7.1, I mean it says it works but from what I have tried and what you say also, it clearly does not work.

hansemannn commented 6 years ago

Guys, this is an archived module with being open source for anyone to contribute. If you need it today, you can simply patch your SDK with this pull request by @garymathews or apply the libraries manually using Gradle / by copying the files into your project.

jamesboyle1968 commented 6 years ago

Thank you for the information and the suggestion. I have tried clicking on the link https://jenkins.appcelerator.org/job/titanium-sdk/job/titanium_mobile/job/PR-9930/8/artifact/dist/mobilesdk-7.2.0.v20180314152013-osx.zip in the pull request but I do not have access to download this - gives me some read/write error.

hansemannn commented 6 years ago

The Jenkins artifacts are internal only (QE-team). You can use Git to clone this PR into the 7_1_X branch, which is effectively the 7.1.0.GA.

jamesboyle1968 commented 6 years ago

I worked all night trying to get this to work and whilst I got it to compile, I just end up with an error of

java.lang.NoSuchFieldError: No static field AppCompatTheme_viewInflaterClass of type I

when the app starts. Can someone not just provide a download as this is all beyond my knowledge and dont know what I am going to say to my client now.

hansemannn commented 6 years ago

Is this only happening with 7.1.0? If so, you could just downgrade to 7.0.x and wait for the next release. Otherwise, if you have a pro or enterprise shbscription, you might want to get in touch with support to prioritize the fix. I‘ll also try a few more things today, but it doesn‘t have a blocker priority right now.

jamesboyle1968 commented 6 years ago

Had to get some sleep after the overnighter. I have tried this on 7.0.X and 7.1.0, same error - found out I can look at adb log and I see this error

java.lang.ClassNotFoundException: android.support.v7.app.AppCompatViewInflater

jamesboyle1968 commented 6 years ago

Pretty much tried everything, even downgrading to SDK 5 and still the same java.lang.ClassNotFoundException

hansemannn commented 6 years ago

It looks like Google now requires it internally. The above mentioned PR will fix it for sure, so I may need to compile it for you guys ...

jamesboyle1968 commented 6 years ago

Recompiling is beyond me, so if you can do this that would be cool and mean I won't need another overnighter stabbing in the dark

hansemannn commented 6 years ago

I cherry-picked the commit into this branch. Compiling now ...

Please note that you will also need to have SDK level 27 installed, either via Android Studio (recommended) or CLI: <android-sdk-dir>/tools/bin/sdkmanager "platforms;android-27"

hansemannn commented 6 years ago

New module (5.1.0, requires the 7.1.1 custom build): Download 7.1.1 build (7.1.0.GA + the above pull request): Download

jamesboyle1968 commented 6 years ago

Thanks man, you are a life saver!

nigelunderwood commented 6 years ago

I will second that one for sure, thanks a bunch!

jamesboyle1968 commented 6 years ago

Removed all SDK's so only level 27 is present and then built using SDK7.1.1 and inappbilling module 5.1.1 and I got the same error as before

java.lang.ClassNotFoundException: android.support.v7.app.AppCompatViewInflater

What has google done to blow this all up!

hansemannn commented 6 years ago

Really weird. I‘ll give it another shot tomorrow!

jamesboyle1968 commented 6 years ago

Can't say thanks enough for this.

hansemannn commented 6 years ago

Try this module which is fixed via packaging support library v13 like described here.

jamesboyle1968 commented 6 years ago

I cleaned the project and rebuilt, tried several times to make sure as the build throws an exception of

Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle;

Listing a bunch of classes

hansemannn commented 6 years ago

Yeah, I expected that..Now you have two different support libraries bundled.

jamesboyle1968 commented 6 years ago

Is there anything that can be done to resolve this - tried a few things and continues to crash out

nigelunderwood commented 6 years ago

James - have you got anywhere with this? Interestingly, I think its a fault in this module rather than Appcelerator support libraries. I installed a games app with inapp purchases, run adb logcat and attempted to make a purchase. Well, the following came on the console from this games app

03-30 00:13:11.962 19694 19694 I AppCompatDelegate: Failed to instantiate custom view inflater android.support.v7.app.AppCompatViewInflater. Falling back to default. 03-30 00:13:11.962 19694 19694 I AppCompatDelegate: java.lang.ClassNotFoundException: android.support.v7.app.AppCompatViewInflater

And then the inapp purchase screen was displayed, so this must mean an exception is not being handled correctly in this ti.inappbilling module.

jamesboyle1968 commented 6 years ago

No man, no luck at all. Certainly interesting what you have found. I have looked into the AppCompatViewInflater and this is for backwards look and feel prior to KitkKat. So the fact that it is saying "Falling back to default", could it be that the module is ignoring the app theme and as such it has nothing to fall back on - this could make sense.

nigelunderwood commented 6 years ago

Ok this whole ClassNotFoundException is a complete distraction, this is perfectly fine as it means the device does not have inbuilt UI support for backwards compatibility - so we can ignore this as Android deals with it. I have this module working and one must follow exactly the Google Play setup for InApp Purchase testing

https://developer.android.com/google/play/billing/billing_testing.html

if you follow this guide it will work fine. No Support Library update is required, works perfectly fine with SDK 7.1.0.

jamesboyle1968 commented 6 years ago

Well done dude, had basically given up on this !!! I've read the guide and I see where I am going wrong now. Cheers man, life saver.