Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused and need some help. #50

Open
djrain opened this issue Jun 16, 2023 · 10 comments
Open

Confused and need some help. #50

djrain opened this issue Jun 16, 2023 · 10 comments

Comments

@djrain
Copy link

djrain commented Jun 16, 2023

Hey, so I'm new to all the IAP stuff. Trying to implement for Godot 3.5.2 using 2.0-rc1. But I'm very uncertain, seems like the docs aren't up to date and I don't know what to trust. Google mentions needing to use onResume() function, but the Godot signal billing_resume is not mentioned anywhere in 3.5 docs, only in 4.

Can I just go by the docs for Godot 4, even though I'm using 3.5? Is there up-to-date sample code anywhere? Anything else I should know?

Thanks a bunch!

@NianoTT
Copy link

NianoTT commented Jun 16, 2023

The 2.0-rc1 isn't matched by any of the docs, those refer to the older 1.x variants.

Right now, building from master (so #45) and using the old docs is probably easiest, as they are very close.
If you stay with 2.0, you will have to make a few changes (sku->product in names, querypurchases is async, return dictionaries changed somewhat). You can figure it all out by looking at the code of #36

Feel free to ask for details on the Godot discord in mobile channel!

@djrain
Copy link
Author

djrain commented Jun 16, 2023

@NianoTT thanks for the reply!

To clarify, you're saying I shouldn't simply use the .aar and .gdap files for 2.0 given here, which are outdated: https://github.com/godotengine/godot-google-play-billing/releases And instead I need to compile with the latest changes?

Also, do you happen to know, will this work the same in Godot 4? I have another project there.

@NianoTT
Copy link

NianoTT commented Jun 16, 2023

There are 2 variants of a "new" plugin currently here: one is based on #36, its the aar/gdap 2.0-rc1 release. It has some changes compared to the previous one - which is described in the docs - so you have to adapt the code from there.

The current master, based on #45, doesn't have a release yet, you would have to build it yourself, but it keeps compatibility with the old version (mostly), so you can use the code from the docs. It also includes a few bugfixes.

Probably better to use the latter if building it from source isn't an issue for you. It also is supposed to work with Godot 4, but I haven't tried myself. The ones from here: https://github.com/godotengine/godot-google-play-billing/releases do not work with Godot 4 to my knowledge.

@djrain
Copy link
Author

djrain commented Jun 16, 2023

Gotcha. I'll give it a shot, really appreciate the info.

@finepointcgi
Copy link
Contributor

finepointcgi commented Jun 18, 2023

Hey I have a release located
https://github.com/finepointcgi/godot-google-play-billing/releases/tag/1.1.2
With #45 built. It does work with Godot 4 and 3.5. If you need help let me know! I did a tutorial on this as well.

@combsbt
Copy link

combsbt commented Jun 26, 2023

@finepointcgi

I have followed your tutorial and got it working with Godot 3.5 Unfortunately my project is in Godot 4 and it crashes when trying to call querySkuDetails() Is there a different function to work with Godot 4? Someone commented in #43 that getSkus is deprecated and you need to use getProducts manually? You say you have tested and it works with Godot 4 - is that with the code from your tutorial and the 1.1.2 release or is there something else I should be using? Thanks

@finepointcgi
Copy link
Contributor

What errors are you currently getting? If you do an adb logcat what errors are there? I have tested my release of 1.1.2 and it worked fine for me.

@combsbt
Copy link

combsbt commented Jun 26, 2023

@finepointcgi

I removed some of the account string because I'm not sure if that is some unique identifier for me.

It connects fine but when trying to call querySkuDetails it returns this:

06-26 16:21:12.512 6994 7762 I Finsky : [2470] kki.a(19): org.godotengine.intransitivedice: Account from first account - [GSyNHxMN...REDACTED]
06-26 16:21:12.514 6994 7762 I Finsky : [2470] kki.a(67): Billing preferred account via installer for org.godotengine.intransitivedice: [GSyNHxMN...REDACTED]
06-26 16:21:15.113 8230 8230 F DEBUG : Cmdline: org.godotengine.intransitivedice
06-26 16:21:15.114 8230 8230 F DEBUG : pid: 7680, tid: 7784, name: GLThread 2359 >>> org.godotengine.intransitivedice <<<
06-26 16:21:15.114 8230 8230 F DEBUG : #00 pc 03318ef4 /data/app/~~0Y6fNUnnPDegL1M9atpqmQ==/org.godotengine.intransitivedice-uc83ROQhtgUKPr0LcGRxwg==/base.apk!libgodot_android.so
06-26 16:21:15.114 8230 8230 F DEBUG : #1 pc 006ce2ec /data/app/~~0Y6fNUnnPDegL1M9atpqmQ==/org.godotengine.intransitivedice-uc83ROQhtgUKPr0LcGRxwg==/base.apk!libgodot_android.so (Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitSignal+672)
06-26 16:21:15.114 8230 8230 F DEBUG : #4 pc 001be33c [anon:dalvik-classes.dex extracted in memory from /data/app/~~0Y6fNUnnPDegL1M9atpqmQ==/org.godotengine.intransitivedice-uc83ROQhtgUKPr0LcGRxwg==/base.apk] (org.godotengine.godot.plugin.GodotPlugin.lambda$emitSignal$0+8)
06-26 16:21:15.114 8230 8230 F DEBUG : #6 pc 001bd940 [anon:dalvik-classes.dex extracted in memory from /data/app/~~0Y6fNUnnPDegL1M9atpqmQ==/org.godotengine.intransitivedice-uc83ROQhtgUKPr0LcGRxwg==/base.apk] (org.godotengine.godot.plugin.GodotPlugin$$ExternalSyntheticLambda0.run+12)
06-26 16:21:15.114 8230 8230 F DEBUG : #8 pc 001b6c7c [anon:dalvik-classes.dex extracted in memory from /data/app/~~0Y6fNUnnPDegL1M9atpqmQ==/org.godotengine.intransitivedice-uc83ROQhtgUKPr0LcGRxwg==/base.apk] (org.godotengine.godot.gl.GLSurfaceView$GLThread.guardedRun+688)
06-26 16:21:15.114 8230 8230 F DEBUG : #10 pc 001b736c [anon:dalvik-classes.dex extracted in memory from /data/app/~~0Y6fNUnnPDegL1M9atpqmQ==/org.godotengine.intransitivedice-uc83ROQhtgUKPr0LcGRxwg==/base.apk] (org.godotengine.godot.gl.GLSurfaceView$GLThread.run+52)
06-26 16:21:15.194 1187 8281 W ActivityManager: crash : org.godotengine.intransitivedice,10381

Then there are logs for closing the app.

EDIT: Sorry I had logcat only outputting with findstr godot and that was my app rather than the test app but still the same relevant code. Here's the output from the test app right after the "Billing preferred acount..." line:

06-26 17:04:45.051 21019 21161 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8aaa6108 in tid 21161 (GLThread 2389), pid 21019 (tengine.IAPTest)
...
and a bunch of seemingly unrelated log stuff....
...

then this that semes relevant:

06-26 17:04:46.737 366 366 I lmkd : 0(delay), 50(swap), 7(freelimit), 0(reentrymode) memory pressure events were skipped after a kill!
06-26 17:04:47.053 21919 21919 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-26 17:04:47.053 21919 21919 F DEBUG : Build fingerprint: 'samsung/a13ue/a13:13/TP1A.220624.014/A135U1UES3CWD4:user/release-keys'
06-26 17:04:47.053 21919 21919 F DEBUG : Revision: '6'
06-26 17:04:47.053 21919 21919 F DEBUG : ABI: 'arm'
06-26 17:04:47.053 21919 21919 F DEBUG : Processor: '-1'
06-26 17:04:47.053 21919 21919 F DEBUG : Timestamp: 2023-06-26 17:04:45.270205276-0400
06-26 17:04:47.053 21919 21919 F DEBUG : Process uptime: 25s
06-26 17:04:47.053 21919 21919 F DEBUG : Cmdline: org.godotengine.IAPTest
06-26 17:04:47.053 21919 21919 F DEBUG : pid: 21019, tid: 21161, name: GLThread 2389 >>> org.godotengine.IAPTest <<<
06-26 17:04:47.053 21919 21919 F DEBUG : uid: 10387
06-26 17:04:47.053 21919 21919 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8aaa6108
06-26 17:04:47.054 21919 21919 F DEBUG : r0 c4c71c28 r1 c5e344e0 r2 00000005 r3 0000000c
06-26 17:04:47.054 21919 21919 F DEBUG : r4 c4c71b28 r5 c4c71b58 r6 c4c71b20 r7 c4c71b30
06-26 17:04:47.054 21919 21919 F DEBUG : r8 00000001 r9 0000002d r10 c4c71b58 r11 c4c71b18
06-26 17:04:47.054 21919 21919 F DEBUG : ip f0011474 sp c4c71b08 lr c614e2f0 pc c8d98ef4
06-26 17:04:47.054 21919 21919 F DEBUG : backtrace:
06-26 17:04:47.054 21919 21919 F DEBUG : #00 pc 03318ef4 /data/app/~~aPrpk5-6L8BKYD2uhFaT8g==/org.godotengine.IAPTest-2ldaBDYnO7T86un18KCZ0g==/base.apk!libgodot_android.so
06-26 17:04:47.054 21919 21919 F DEBUG : #1 pc 006ce2ec /data/app/~~aPrpk5-6L8BKYD2uhFaT8g==/org.godotengine.IAPTest-2ldaBDYnO7T86un18KCZ0g==/base.apk!libgodot_android.so (Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitSignal+672)
06-26 17:04:47.054 21919 21919 F DEBUG : #2 pc 003c219d /apex/com.android.art/lib/libart.so (art_quick_generic_jni_trampoline+44) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.054 21919 21919 F DEBUG : #3 pc 000f053c /apex/com.android.art/lib/libart.so (nterp_helper+172) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.054 21919 21919 F DEBUG : #4 pc 001be33c [anon:dalvik-classes.dex extracted in memory from /data/app/~~aPrpk5-6L8BKYD2uhFaT8g==/org.godotengine.IAPTest-2ldaBDYnO7T86un18KCZ0g==/base.apk] (org.godotengine.godot.plugin.GodotPlugin.lambda$emitSignal$0+8)
06-26 17:04:47.054 21919 21919 F DEBUG : #5 pc 000f04c8 /apex/com.android.art/lib/libart.so (nterp_helper+56) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.054 21919 21919 F DEBUG : #6 pc 001bd940 [anon:dalvik-classes.dex extracted in memory from /data/app/~~aPrpk5-6L8BKYD2uhFaT8g==/org.godotengine.IAPTest-2ldaBDYnO7T86un18KCZ0g==/base.apk] (org.godotengine.godot.plugin.GodotPlugin$$ExternalSyntheticLambda0.run+12)
06-26 17:04:47.055 21919 21919 F DEBUG : #7 pc 000f192c /apex/com.android.art/lib/libart.so (nterp_helper+5276) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #8 pc 001b6c7c [anon:dalvik-classes.dex extracted in memory from /data/app/~~aPrpk5-6L8BKYD2uhFaT8g==/org.godotengine.IAPTest-2ldaBDYnO7T86un18KCZ0g==/base.apk] (org.godotengine.godot.gl.GLSurfaceView$GLThread.guardedRun+688)
06-26 17:04:47.055 21919 21919 F DEBUG : #9 pc 000f0f80 /apex/com.android.art/lib/libart.so (nterp_helper+2800) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #10 pc 001b736c [anon:dalvik-classes.dex extracted in memory from /data/app/~~aPrpk5-6L8BKYD2uhFaT8g==/org.godotengine.IAPTest-2ldaBDYnO7T86un18KCZ0g==/base.apk] (org.godotengine.godot.gl.GLSurfaceView$GLThread.run+52)
06-26 17:04:47.055 21919 21919 F DEBUG : #11 pc 003bd7d5 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #12 pc 003bd2d7 /apex/com.android.art/lib/libart.so (void art::quick_invoke_reg_setup(art::ArtMethod*, unsigned int*, unsigned int, art::Thread*, art::JValue*, char const*) (.__uniq.192663596067446536341070919852553954320.llvm.16200230356545185596)+158) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #13 pc 0028ab25 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #14 pc 00313fc9 /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*) (.__uniq.245181933781456475607640333933569312899.llvm.10448379941246030963)+40) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #15 pc 00313ed5 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValuesart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+164) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.055 21919 21919 F DEBUG : #16 pc 0033aa0f /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.056 21919 21919 F DEBUG : #17 pc 002f0c85 /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+416) (BuildId: 590aedf23e5d581a4e04a2e06fbf0388)
06-26 17:04:47.056 21919 21919 F DEBUG : #18 pc 000ade0b /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) (BuildId: e00cdd3a04a463527b3eb5e9f99a3dcb)
06-26 17:04:47.056 21919 21919 F DEBUG : #19 pc 00063e73 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: e00cdd3a04a463527b3eb5e9f99a3dcb)
06-26 17:04:47.115 455 455 E tombstoned: Tombstone written to: tombstone_19
06-26 17:04:47.124 1187 21924 I DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: failed to open /data/tombstones/tombstone_19.pb
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:342)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:229)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.os.NativeTombstoneManager.handleProtoTombstone(NativeTombstoneManager.java:151)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.os.NativeTombstoneManager.handleTombstone(NativeTombstoneManager.java:120)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.os.NativeTombstoneManager.-$$Nest$mhandleTombstone(Unknown Source:0)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.os.NativeTombstoneManager$TombstoneWatcher.lambda$onEvent$0(NativeTombstoneManager.java:564)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.os.NativeTombstoneManager$TombstoneWatcher.$r8$lambda$brzM_6e7cyhhJeR_ISUCuvFg3_s(Unknown Source:0)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.os.NativeTombstoneManager$TombstoneWatcher$$ExternalSyntheticLambda0.run(Unknown Source:4)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.Handler.handleCallback(Handler.java:942)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.Looper.loopOnce(Looper.java:226)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.Looper.loop(Looper.java:313)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at android.os.HandlerThread.run(HandlerThread.java:67)
06-26 17:04:47.130 1187 1321 W NativeTombstoneManager: at com.android.server.ServiceThread.run(ServiceThread.java:44)
06-26 17:04:47.134 1187 21923 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1252 com.android.server.am.AppErrors.crashApplicationInner:722 com.android.server.am.AppErrors.crashApplication:598 com.android.server.am.ActivityManagerService.handleApplicationCrashInner:10398 com.android.server.am.NativeCrashListener$NativeCrashReporter.run:88
06-26 17:04:47.135 1187 21923 W ActivityManager: crash : org.godotengine.IAPTest,10387
06-26 17:04:47.138 1187 21923 W ActivityTaskManager: Force finishing activity org.godotengine.IAPTest/com.godot.game.GodotApp

I'm not sure what that means

@combsbt
Copy link

combsbt commented Jun 27, 2023

@finepointcgi

It seems that the problem is when a signal returns Object[].class I removed the return object from sku_details_query_completed and recompiled the plugin. It works now, with no details dictionary returned. This is fine for me because I know the item details already but still needed the query to be completed. It doesn't seem that the object is converted to a dictionary by the utils function as it should be and godot doesn't like the object that is returned I guess.

@kyadalu1
Copy link

kyadalu1 commented Jan 6, 2024

Try this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants