Bug Issue: iOS purchases not working


Pages: 1 2

makaydenko

  • Subscriber - Stencyl Studio
  • *
March 06, 2022, 06:19:52 am
Hi!

Stencyl 4.1.0-beta (b10928).

After launching the application on iOS, in-app purchases are not initialized. In the error logs:
Code: [Select]
...
[ios-deploy] throwing -10877
[ios-deploy] throwing -10877
stencyl.sw.util.StreamGobbler
[ios-deploy] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x147e0d930>.
[ios-deploy] Purchases initialize

This error "throwing -10877" is repeated many times.

Regards.
« Last Edit: March 06, 2022, 08:33:48 am by makaydenko »


Justin

  • Master Stencyler
  • *
March 08, 2022, 12:09:30 am
Everything related to purchases seems to work for me.

Your full logs may be more helpful in determining what went wrong here.


makaydenko

  • Subscriber - Stencyl Studio
  • *
March 08, 2022, 05:08:23 am
Thanks for the answer. I have attached the log file.


New attachment added by makaydenko - March 08, 2022, 05:08:37 am


makaydenko

  • Subscriber - Stencyl Studio
  • *
March 09, 2022, 09:09:10 am
Logs when app starts:
Code: [Select]
INFO 1646844978814004791 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     autoexit
INFO 1646844978796004790 stencyl.sw.util.StreamGobbler [ios-deploy] success
INFO 1646844977993004789 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     run
INFO 1646844977854004788 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     connect
INFO 1646844977854004787 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     command script add -s asynchronous -f fruitstrap_1f85673655d389fde983043ac300ef2e924086e4.safequit_command safequit
INFO 1646844977854004786 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     command script add -s asynchronous -f fruitstrap_1f85673655d389fde983043ac300ef2e924086e4.autoexit_command autoexit
INFO 1646844977854004785 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     command script add -s asynchronous -f fruitstrap_1f85673655d389fde983043ac300ef2e924086e4.run_command run
INFO 1646844977822004784 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     command script add -f fruitstrap_1f85673655d389fde983043ac300ef2e924086e4.connect_command connect
INFO 1646844977694004783 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     command script import "/tmp/C7B07046-76F6-41FD-A0FB-900C685495E4/fruitstrap_1f85673655d389fde983043ac300ef2e924086e4.py"
INFO 1646844976448004782 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     target modules search-paths add /usr "~/Library/Developer/Xcode/iOS DeviceSupport/15.2.1 (19C63)/Symbols/usr" /System "~/Library/Developer/Xcode/iOS DeviceSupport/15.2.1 (19C63)/Symbols/System" "/private/var/containers/Bundle/Application/BC9F7B86-14E3-412C-A5DC-267A10213989" "~/stencylworks/games-generated/Bugs/Export/ios/build/Release-iphoneos" "/var/containers/Bundle/Application/BC9F7B86-14E3-412C-A5DC-267A10213989" "~/stencylworks/games-generated/Bugs/Export/ios/build/Release-iphoneos" /Developer "~/Library/Developer/Xcode/iOS DeviceSupport/15.2.1 (19C63)/Symbols/Developer"
INFO 1646844976444004781 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     script fruitstrap_error_path=""
INFO 1646844976442004780 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     script fruitstrap_output_path=""
INFO 1646844976440004779 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     script fruitstrap_connect_url="connect://127.0.0.1:49491"
INFO 1646844976315004778 stencyl.sw.util.StreamGobbler [ios-deploy] (lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/BC9F7B86-14E3-412C-A5DC-267A10213989/Bugs.app"
INFO 1646844976297004777 stencyl.sw.util.StreamGobbler [ios-deploy] Current executable set to '~/stencylworks/games-generated/Bugs/Export/ios/build/Release-iphoneos/Bugs.app' (arm64).
Logs when app closes:
Code: [Select]
INFO 1646845484079004842 stencyl.sw.util.StreamGobbler [ios-deploy] PROCESS_EXITED
INFO 1646845484079004841 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:59:46.299659+0300 Bugs[829:18700] throwing -10877
INFO 1646845484079004840 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:59:46.290226+0300 Bugs[829:18700] throwing -10877
INFO 1646845484079004839 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/Data.hx:315: Load Atlas: 1
INFO 1646845484079004838 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/Data.hx:315: Load Atlas: 3
INFO 1646845484079004837 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/Data.hx:338: Unload Atlas: 2
INFO 1646845484078004836 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/Engine.hx:1892: Switching to scene 5
INFO 1646845484078004835 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/gamecenter/GameCenter.hx:34: Game Center: Authenticated
INFO 1646845484078004834 stencyl.sw.util.StreamGobbler [ios-deploy] Send Event: auth-success
INFO 1646845484078004833 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.853906+0300 Bugs[829:18619] Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x1067206d0>.
INFO 1646845484078004832 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.853714+0300 Bugs[829:18619] Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x1067206d0>.
INFO 1646845484078004831 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.853630+0300 Bugs[829:18619] Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x1067206d0>.
INFO 1646845484078004830 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.853379+0300 Bugs[829:18619] Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x1067206d0>.
INFO 1646845484078004829 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.851869+0300 Bugs[829:18619] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x10650ba70>.
INFO 1646845484078004828 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/Data.hx:315: Load Atlas: 0
INFO 1646845484078004827 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/Data.hx:315: Load Atlas: 2
INFO 1646845484078004826 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/purchases/Purchases.hx:159: Purchases: Started
INFO 1646845484078004825 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.272195+0300 Bugs[829:18619] Purchases initialize
INFO 1646845484078004824 stencyl.sw.util.StreamGobbler [ios-deploy] com/stencyl/graphics/GLUtil.hx:35: GL value of MAX_TEXTURE_SIZE: 16384
INFO 1646845484078004823 stencyl.sw.util.StreamGobbler [ios-deploy] [lime.utils.Preloader] Preload complete
INFO 1646845484078004822 stencyl.sw.util.StreamGobbler [ios-deploy] [lime.utils.Preloader] Loaded asset library: default [1/1]
INFO 1646845484078004821 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.188131+0300 Bugs[829:18619] Errors found! Invalidating cache...
INFO 1646845484076004820 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.188062+0300 Bugs[829:18619] fopen failed for data file: errno = 2 (No such file or directory)
INFO 1646845484076004819 stencyl.sw.util.StreamGobbler [ios-deploy] [lime.utils.Preloader] Preloading asset library: default
INFO 1646845484076004818 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:411: Scale Y: 1.775
INFO 1646845484076004817 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:410: Scale X: 1.775
INFO 1646845484076004816 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:409: Logical Height: 640
INFO 1646845484076004815 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:408: Logical Width: 384
INFO 1646845484076004814 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:388: Safe Area Insets: scaled = (left: 12, top: 0, right: 12, bottom: 0)
INFO 1646845484076004813 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:379: Safe Area Insets: offset = (left: 20.8, top: 0, right: 20.8, bottom: 0)
INFO 1646845484076004812 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:369: Safe Area Insets: mirrored = (left: 0, top: 0, right: 0, bottom: 0)
INFO 1646845484075004811 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:354: Safe Area Insets: original = (left: 0, top: 0, right: 0, bottom: 0)
INFO 1646845484075004810 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:257: Asset Scale: 1x
INFO 1646845484075004809 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:256: Theoretical Scale: 1.5
INFO 1646845484075004808 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:152: Scale Mode: SCALE_TO_FIT_FILL
INFO 1646845484075004807 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:151: Enabled Scales: [1x,2x]
INFO 1646845484075004806 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:150: FullScreen Height: 1136
INFO 1646845484075004805 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:149: FullScreen Width: 640
INFO 1646845484075004804 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:148: Window Height: 1136
INFO 1646845484075004803 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:147: Window Width: 640
INFO 1646845484075004802 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:146: Game Scale: 1
INFO 1646845484075004801 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:145: Game Height: 640
INFO 1646845484075004800 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:144: Game Width: 384
INFO 1646845484075004799 stencyl.sw.util.StreamGobbler [ios-deploy] Universal.hx:97: initScreen
INFO 1646845484075004798 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.137613+0300 Bugs[829:18619] Errors found! Invalidating cache...
INFO 1646845484075004797 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.137551+0300 Bugs[829:18619] fopen failed for data file: errno = 2 (No such file or directory)
INFO 1646845484075004796 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.117903+0300 Bugs[829:18619] Errors found! Invalidating cache...
INFO 1646845484075004795 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:23.117825+0300 Bugs[829:18619] fopen failed for data file: errno = 2 (No such file or directory)
INFO 1646845484075004794 stencyl.sw.util.StreamGobbler [ios-deploy] Primitive not found : native_system_ui_hide_launch_storyboard__0
INFO 1646845484074004793 stencyl.sw.util.StreamGobbler [ios-deploy] 2022-03-09 19:56:21.598437+0300 Bugs[829:18619] Could not load the "ipad-splash-sb.png" image referenced from a nib in the bundle with identifier "com.royagers.bugs"
INFO 1646845484051004792 stencyl.sw.util.StreamGobbler [ios-deploy] Process 829 exited with status = 0 (0x00000000)
« Last Edit: March 09, 2022, 09:41:09 am by makaydenko »


makaydenko

  • Subscriber - Stencyl Studio
  • *
March 25, 2022, 04:05:54 am
Are there any solutions?


Justin

  • Master Stencyler
  • *
March 27, 2022, 05:00:06 pm
Sorry, this one slipped my mind. I'll look into this before April.


Justin

  • Master Stencyler
  • *
March 31, 2022, 09:39:02 am
Again, things seem fine on my side. You said "after launching the application on iOS, in-app purchases are not initialized." From your logs, it looks like it's being initialized correctly. What are you expecting to happen in your game, and what's happening instead?

Would you mind posting the code you're using as well?


makaydenko

  • Subscriber - Stencyl Studio
  • *
April 01, 2022, 08:29:35 am
Yes, of course. I attached screenshots.

Screenshot 1. The start scene of my game contains behavior "StartActions". The event "Created" calls the custom event "Init". This event is called correctly.

Screenshot 2. The custom event "Init" contains the attribute "PurchasesChecked" and the request "Request info for product with ID" to get purchases prices. This event is called correctly.

Screenshot 3. The purchases event "When a product info request succeeds" waits callback from the request "Request info for product with ID". But this purchase event is never called.

Screenshot 4.  The start scene waits for update the attribute "PurchasesChecked" that never is changed.

That being said, it works fine for Android.


New attachment added by makaydenko - April 01, 2022, 08:29:46 am


New attachment added by makaydenko - April 01, 2022, 08:29:54 am


New attachment added by makaydenko - April 01, 2022, 08:30:01 am


New attachment added by makaydenko - April 01, 2022, 08:30:09 am


makaydenko

  • Subscriber - Stencyl Studio
  • *
April 01, 2022, 08:34:11 am
I removed game logic for show the only purchases logic on the screenshots.


makaydenko

  • Subscriber - Stencyl Studio
  • *
April 01, 2022, 10:20:42 am
I added debug logging (screenshot "If player can make purchases") for test.
The Stencyl doesn't show this debug logs.

But the log string "Purchases initialize" is added to logs only after closing the app (screenshot "If player can make purchases test"):
1. At 20:14:18:457 the app is started on the iPhone.
2. At 20:14:19:587 the log viewer stops to add any logs.
3. At 20:17:47:768 the app is closed on the iPhone.
4. At 20:17:47:781 the log viewer adds the string "Purchases initilalize".


New attachment added by makaydenko - April 01, 2022, 10:21:20 am


New attachment added by makaydenko - April 01, 2022, 10:21:31 am


Justin

  • Master Stencyler
  • *
April 01, 2022, 04:36:46 pm
It looks to me like the logs are being saved and only printed out when the game exits. That's a little strange, but seems to be what's going on (notice that there are two timestamps for the second set of logs).

The issue here appears to be with the <player can make purchases> block. I looked at the code that would set that to true, and surprisingly, it's only set to true after the first product info request succeeds. That seems counter-intuitive to me, and isn't mentioned in the block documentation either. Perhaps it's a bug.

For Android, it appears that the <player can make purchases> block becomes true quickly enough after the game starts that things work ok.

What you should be able to use, however, is the when [player can purchase goods] event. When that event is fired, you can make your product info requests (request info for product with ID [__]) and they should work.


makaydenko

  • Subscriber - Stencyl Studio
  • *
April 02, 2022, 03:02:19 am
There are two timestamps for the second set of logs because I waited 3 minutes for the purchases to initialize.
But this did not happen and I closed the application. Immediately after that, a notice added in the logs that the purchases were initialized.

If you ignore waiting and switch to another scene of the game, then after a while the following notices will added in the logs:

throwing -10877
throwing -10877
throwing -10877
...
throwing -10877

But the purchases will not be initialized until the application is closed.


makaydenko

  • Subscriber - Stencyl Studio
  • *
April 02, 2022, 03:03:13 am
But the strange thing is that in Android everything works correctly.


makaydenko

  • Subscriber - Stencyl Studio
  • *
April 30, 2022, 01:16:10 pm
Sorry, are there any solutions?


Pages: 1 2

Details

  • Reported
    March 06, 2022, 06:19:52 am
  • Updated
    June 21, 2022, 11:40:24 pm

  • View Status
    Public
  • Type
    Bug
  • Status
    New
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Compiling/Testing Games

Tags


Attachments

* 2022-03-08_14-49-14.log (13.53 kB - downloaded 261 times.)

* 1.png (24.82 kB, 621x218 - viewed 525 times.)

* 2.png (31.45 kB, 736x231 - viewed 523 times.)

* 3.png (44.1 kB, 1048x274 - viewed 516 times.)

* 4.png (23.68 kB, 626x203 - viewed 514 times.)

* If player can make purchases.png (35.26 kB, 498x235 - viewed 517 times.)

* If player can make purchases logs.png (252.47 kB, 1426x610 - viewed 518 times.)

* when-player-can-purchase-goods.png (33.07 kB, 533x255 - viewed 514 times.)