poingstudios / godot-admob-android

Godot's AdMob Plugin for Android with support for Mediations.
https://poingstudios.github.io/godot-admob-plugin/
MIT License
354 stars 38 forks source link

[BUG] Error compiling Godot for iOS with module for version 3.2.4 beta 5 #41

Closed sjhennion closed 3 years ago

sjhennion commented 3 years ago

Describe the bug I'm trying to compile godot using Godot-AdMob-Android-iOS as a module, but I'm getting forward declaration errors in the iOS source:

Screen Shot 2021-01-11 at 10 03 26 PM

To Reproduce Steps to reproduce the behavior:

  1. Place ios/admob contents into godot/modules/admob
  2. Place google *.framework directories into godot/modules/admob/lib
  3. Run scons p=iphone target=debug

Expected behavior Builds an ios *.a file

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

gumaciel commented 3 years ago

Hmm, you don't need to compile by yourself, theres already compiled files: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/releases/tag/iOS_v3.0%2B

What version are you trying to compile? Be sure to choice the right version here: https://downloads.tuxfamily.org/godotengine/

gumaciel commented 3 years ago

Probably the error is because AdMob.h is not including the others "AdType" headers i will make a update here soon, please try it out when i commit

Edit: No, it's not this, hmm very strange i never saw this error, what's is version of your Mac OS and XCode?

Captura de Tela 2021-01-12 às 01 02 23

gumaciel commented 3 years ago

Maybe you've missed the place of the frameworks:

Captura de Tela 2021-01-12 às 01 07 33

here are some possible probabilities of why you have this error:

1 - You downloaded the updated code from the "master" branch of Godot, which is unstable and still in the alpha development phase, is being developed in version 4.0

2 - You put the files in the Godot source code folder wrong

3 - You must have updated your computer and perhaps the compilation of some language has changed (very unlikely, but remotely possible)

sjhennion commented 3 years ago

@gustavottc I'm compiling myself because I need to compile Godot with other custom modules besides just Godot-AdMob-Android-iOS

Godot version is the latest commit on the 3.2 branch, so 3.2.4 beta, macOS is 11.1 Big Sur, Xcode is 12.3.

Directory looks similar to yours:

Screen Shot 2021-01-11 at 11 16 04 PM

Do I need to be on a 3.2.3 tag on the godot repo?

gumaciel commented 3 years ago

Oh, yes, you need to compile by yourself if you want to use more modules for iOS, this is a problem with Godot, the engine currently doesn't support Plugins for iOS, but soon it will.

My Xcode version is the same as yours, the different is with the versions of Operational System, mine is Catalina (i don't updated to Big Sur yet because i heard theres a lot of bugs haha)

I strong recommend you to use 3.2.3 stable, because 3.2.4 beta is with some bugs, is taking too long to be released, so i don't recommend to release a game with 3.2.4 beta version.

But i will try to compile by myself on 3.2.4 beta to see how it works, soon i will give you an answer.

By the way, i'm downloading from here: https://downloads.tuxfamily.org/godotengine/3.2.4/beta5/godot-3.2.4-beta5.tar.xz

sjhennion commented 3 years ago

Yeah, I didn't want to go to Big Sur, but I was behind Catalina when I was trying to deploy the compiled versions last week, and the only upgrade I could do was all the up to Big Sur. Trust me, I would have avoided it if I could.

Let me know what you find, I will try with 3.2.3 stable in the morning!

gumaciel commented 3 years ago

Same error, lol Captura de Tela 2021-01-12 às 01 44 57

I fixed it, but another erros appear: Captura de Tela 2021-01-12 às 01 52 54

Ok, more errors: Captura de Tela 2021-01-12 às 01 54 50

gumaciel commented 3 years ago

I don't know what they did, but from what I'm seeing a lot has changed in version 3.2.4, apparently it will take a while because I'm afraid to "fix" it and give some bugs after that, so for please use stable version 3.2.3: https://downloads.tuxfamily.org/godotengine/3.2.3/godot-3.2.3-stable.tar.xz

gumaciel commented 3 years ago

@naithar can you please give a look? Do you know what we need to fix these errors? Thanks!

naithar commented 3 years ago

@gustavottc yeah, some stuff has changed in iOS platform code to address some memory issues and make it more stable and compatible with 4.0. You might have to look at this two PRs: https://github.com/godotengine/godot/pull/42459 and https://github.com/godotengine/godot/pull/42582

For the most part there has been added a support for ARC, so there is no need to call retain and release messages on objects anymore. Some files names have beed changed too due to the switch to Objective-C++ from Objective-C. Some methods names has been changed too, but they give access to Godot's classes making the work a little bit easier, like godotView for ViewController. And compilation is now more demanding due to the enabled werror=yes flag.

So basically you have to add some headers first, like view_controller.h, godot_view.h, maybe something else, depending on what you are using. And switch to using new methods/properties that was added, like AppDelegate.viewController and viewController.godotView. PRs might work as an examples, since I had to fix modules in them too. Then remove retain/release calls, or add a -no-objc-arc flag to scons file of this module. But I would recommend switching to ARC. After that you might have to fix errors that come from incorrect code that worked only with werror=no. It shouldn't be that hard, but might take some time. For example error on this line: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/blob/master/ios/admob/src/AdMobBanner.mm#L12 can be fixed simply by changing initialize to init like Obj-C actually requires initializer to be named.

gumaciel commented 3 years ago

@naithar did everything that you said, but is giving me this error on Xcode: AdMob[11108:240737] ERROR: AudioOutputUnitStart failed, code: -50

full log:


*********** main.m
running app main
Path: /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/436D55F6-A0DD-411A-861C-6BCD0AC90AC4/AdMob.app
godot_iphone /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/436D55F6-A0DD-411A-861C-6BCD0AC90AC4/AdMob.app/AdMob
cwd /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/436D55F6-A0DD-411A-861C-6BCD0AC90AC4/AdMob.app
os created
setting data dir to /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Data/Application/98D323B6-FE1B-447C-8C31-4745226048D2/Documents from /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Data/Application/98D323B6-FE1B-447C-8C31-4745226048D2/Documents
setup 0
2021-01-12 13:22:44.041893-0300 AdMob[11828:259229] Setting up an OpenGL ES 2.0 context.
2021-01-12 13:22:44.042207-0300 AdMob[11828:259229] failed to make complete framebuffer object 8cd6
2021-01-12 13:22:44.042318-0300 AdMob[11828:259229] Failed to create frame buffer!
******** setting up keyboard input view
******** adding observer for keyboard show/hide
2021-01-12 13:22:44.065684-0300 AdMob[11828:259229] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600001498520> F8BB1C28-BAE8-11D6-9C31-00039315CD46
start animation!
2021-01-12 13:22:44.091312-0300 AdMob[11828:259229] **ERROR**: AudioOutputUnitStart failed, code: -50
2021-01-12 13:22:44.091432-0300 AdMob[11828:259229]    At: drivers/coreaudio/audio_driver_coreaudio.cpp:256:start() - AudioOutputUnitStart failed, code: -50
2021-01-12 13:22:44.131883-0300 AdMob[11828:259229] Godot Engine v3.2.4.beta5.custom_build - https://godotengine.org
2021-01-12 13:22:44.141972-0300 AdMob[11828:259229] OpenGL ES 2.0 Renderer: Apple Software Renderer
2021-01-12 13:22:44.150068-0300 AdMob[11828:259229] OpenGL ES Batching: ON
2021-01-12 13:22:44.331058-0300 AdMob[11828:259229] 
2021-01-12 13:22:44.331893-0300 AdMob[11828:259733] [aurioc] AURemoteIO.h:323:entry: Unable to join I/O thread to workgroup ((null)): 2
2021-01-12 13:22:44.539040-0300 AdMob[11828:259782] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 13:22:44.539200-0300 AdMob[11828:259782] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 13:22:44.539361-0300 AdMob[11828:259645] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 13:22:44.539901-0300 AdMob[11828:259645] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 13:22:44.539953-0300 AdMob[11828:259782] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 13:22:44.540349-0300 AdMob[11828:259645] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 13:22:44.540403-0300 AdMob[11828:259782] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
(lldb) 
gumaciel commented 3 years ago

Branch for this issue: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/tree/3.2.4

naithar commented 3 years ago

Does module work after your changes?

AudioOutputUnitStart failed, code: -50 is Godot's audio error and it does happen sometimes when app isn't finished loading yet, but it's nothing to worry about really. Failed to create frame buffer! is more serious in that respect.

I'll need MRP to test everything with latest Godot beta if it's really needed.

Edit: Also, does Godot's Project work on iOS with recent beta or 3.2 branch version without your module?

Edit: Found an stackoverflow question by searching The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated. https://stackoverflow.com/questions/52455652/xcode-10-seems-to-break-com-apple-commcenter-coretelephony-xpc Are you using simulator for testing?

Searching AURemoteIO.h:323:entry: Unable to join I/O thread to workgroup ((null)): 2 indicates that it might be simulator only issue on latest macOS.

gumaciel commented 3 years ago

@naithar yes, my godot project work on iOS 3.2.4 beta5 without the module(without compiling), i will try to compile without admob to see how it goes

yes, i am using a simulator because i don't have a real iPhone :(

this error "coretelephony-xpc" also appear on 3.2.3

about: AURemoteIO i don't know about it

naithar commented 3 years ago

But does your project work with module? From what I've seen everything should work fine, did you build it?

gumaciel commented 3 years ago

Doesn't work with AdMob module, i just compiled here without the AdMob and it's working:

Full log

*********** main.m
running app main
Path: /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/2CF56A1B-3A70-4749-8924-28344FF373EB/AdMob.app
godot_iphone /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/2CF56A1B-3A70-4749-8924-28344FF373EB/AdMob.app/AdMob
cwd /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/2CF56A1B-3A70-4749-8924-28344FF373EB/AdMob.app
os created
setting data dir to /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Data/Application/AC39F000-2E03-4AC1-B411-C898F4242F11/Documents from /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Data/Application/AC39F000-2E03-4AC1-B411-C898F4242F11/Documents
setup 0
2021-01-12 14:40:52.678662-0300 AdMob[15349:302811] Setting up an OpenGL ES 2.0 context.
2021-01-12 14:40:52.681313-0300 AdMob[15349:302811] failed to make complete framebuffer object 8cd6
2021-01-12 14:40:52.681465-0300 AdMob[15349:302811] Failed to create frame buffer!
******** setting up keyboard input view
******** adding observer for keyboard show/hide
2021-01-12 14:40:52.798487-0300 AdMob[15349:302811] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000a6a6e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
start animation!
2021-01-12 14:40:52.871873-0300 AdMob[15349:302811] **ERROR**: AudioOutputUnitStart failed, code: -50
2021-01-12 14:40:52.872069-0300 AdMob[15349:302811]    At: drivers/coreaudio/audio_driver_coreaudio.cpp:256:start() - AudioOutputUnitStart failed, code: -50
2021-01-12 14:40:52.943721-0300 AdMob[15349:302811] Godot Engine v3.2.4.beta5.custom_build - https://godotengine.org
2021-01-12 14:40:52.957129-0300 AdMob[15349:302811] OpenGL ES 2.0 Renderer: Apple Software Renderer
2021-01-12 14:40:52.980840-0300 AdMob[15349:302811] OpenGL ES Batching: ON
2021-01-12 14:40:53.313817-0300 AdMob[15349:302811] 
2021-01-12 14:40:53.315738-0300 AdMob[15349:303576] [aurioc] AURemoteIO.h:323:entry: Unable to join I/O thread to workgroup ((null)): 2
2021-01-12 14:40:53.501555-0300 AdMob[15349:303456]  - <Google>[I-ACS025031] AdMob App ID changed. Original, new: (nil), ca-app-pub-3940256099942544~1458002511
2021-01-12 14:40:53.638879-0300 AdMob[15349:303458]  - <Google>[I-ACS023007] Analytics v.70100000 started
2021-01-12 14:40:53.639774-0300 AdMob[15349:303458]  - <Google>[I-ACS023008] To enable debug logging set the following application argument: -APMAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2021-01-12 14:40:53.641799-0300 AdMob[15349:303460] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:53.641990-0300 AdMob[15349:303460] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:53.642151-0300 AdMob[15349:303408] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:53.642838-0300 AdMob[15349:303408] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:53.642893-0300 AdMob[15349:303458] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:53.643899-0300 AdMob[15349:303458] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:53.644227-0300 AdMob[15349:303408] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 14:40:54.715872-0300 AdMob[15349:303458]  - <Google>[I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2021-01-12 14:40:54.989937-0300 AdMob[15349:303460]  - <Google>[I-ACS023012] Analytics collection enabled
2021-01-12 14:40:55.217447-0300 AdMob[15349:303408] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
2021-01-12 14:40:55.881018-0300 AdMob[15349:303459]  - <Google>[I-ACS023130] Configuration not found. Using default configuration

Don't pay attention to Google's warnings, I'm just important in the frameworks in the Xcode project, but I didn't compile in Godot

Captura de Tela 2021-01-12 às 14 43 10

@naithar

naithar commented 3 years ago

What errors does module give you on compilation? I thought that you already managed to compile module, but it seems I was mistaken.

gumaciel commented 3 years ago

I managed to compile with the AdMob module, the compile was finished with success, but when i replace the '.a' file, the game crashes in Xcode.

I'm compiling again to check the warnings

naithar commented 3 years ago

Are you building in debug mode? It should provide more information about the crash.

gumaciel commented 3 years ago

I wasn't, now i'm:

Captura de Tela 2021-01-12 às 15 10 12

gumaciel commented 3 years ago

This is the unique command that i'm using right now: scons p=iphone tools=no target=debug arch=x86_64

naithar commented 3 years ago

So it does build, but crashes? I find it really hard to actually understand what's the problem is :) Try running project with debug library it should give you more details about the crash.

gumaciel commented 3 years ago

Here are the log of debug: (the file size is like 3x more big)

*********** main.m
running app main
Path: /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/7850D088-4D9B-4DEB-A431-C3FD4B707D0A/AdMob.app
godot_iphone /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/7850D088-4D9B-4DEB-A431-C3FD4B707D0A/AdMob.app/AdMob
cwd /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Bundle/Application/7850D088-4D9B-4DEB-A431-C3FD4B707D0A/AdMob.app
os created
setting data dir to /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Data/Application/B5C3F4DC-7C14-4E25-99BB-6BA18DDDF143/Documents from /Users/gustavomaciel/Library/Developer/CoreSimulator/Devices/57347C22-0741-4AE4-ACD0-1EB5652B5441/data/Containers/Data/Application/B5C3F4DC-7C14-4E25-99BB-6BA18DDDF143/Documents
setup 0
2021-01-12 15:26:40.517026-0300 AdMob[21951:358885] Setting up an OpenGL ES 2.0 context.
2021-01-12 15:26:40.518244-0300 AdMob[21951:358885] failed to make complete framebuffer object 8cd6
2021-01-12 15:26:40.518339-0300 AdMob[21951:358885] Failed to create frame buffer!
******** setting up keyboard input view
******** adding observer for keyboard show/hide
2021-01-12 15:26:40.541739-0300 AdMob[21951:358885] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600001186620> F8BB1C28-BAE8-11D6-9C31-00039315CD46
start animation!
2021-01-12 15:26:40.570473-0300 AdMob[21951:358885] **ERROR**: AudioOutputUnitStart failed, code: -50
2021-01-12 15:26:40.570585-0300 AdMob[21951:358885]    At: drivers/coreaudio/audio_driver_coreaudio.cpp:256:start() - AudioOutputUnitStart failed, code: -50
**ERROR**: AudioOutputUnitStart failed, code: -50
   At: drivers/coreaudio/audio_driver_coreaudio.cpp:256:start() - AudioOutputUnitStart failed, code: -50
2021-01-12 15:26:40.688452-0300 AdMob[21951:359416]  - <Google>[I-ACS025031] AdMob App ID changed. Original, new: (nil), ca-app-pub-3940256099942544~1458002511
2021-01-12 15:26:40.833327-0300 AdMob[21951:358885] Godot Engine v3.2.4.beta5.custom_build - https://godotengine.org
Godot Engine v3.2.4.beta5.custom_build - https://godotengine.org
2021-01-12 15:26:40.834370-0300 AdMob[21951:359418]  - <Google>[I-ACS023007] Analytics v.70100000 started
2021-01-12 15:26:40.834809-0300 AdMob[21951:359418]  - <Google>[I-ACS023008] To enable debug logging set the following application argument: -APMAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2021-01-12 15:26:40.838251-0300 AdMob[21951:359414] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.838391-0300 AdMob[21951:359414] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.838538-0300 AdMob[21951:359415] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.838572-0300 AdMob[21951:359414] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.839021-0300 AdMob[21951:359415] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.839066-0300 AdMob[21951:359414] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.839593-0300 AdMob[21951:359415] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.839717-0300 AdMob[21951:359414] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2021-01-12 15:26:40.852435-0300 AdMob[21951:358885] OpenGL ES 2.0 Renderer: Apple Software Renderer
OpenGL ES 2.0 Renderer: Apple Software Renderer
2021-01-12 15:26:40.876635-0300 AdMob[21951:358885] OpenGL ES Batching: ON
OpenGL ES Batching: ON
2021-01-12 15:26:41.104163-0300 AdMob[21951:358885] 

2021-01-12 15:26:41.105893-0300 AdMob[21951:359548] [aurioc] AURemoteIO.h:323:entry: Unable to join I/O thread to workgroup ((null)): 2
2021-01-12 15:26:41.522203-0300 AdMob[21951:358885] **SCRIPT ERROR**: Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.
2021-01-12 15:26:41.522365-0300 AdMob[21951:358885]    At: res://src/main/Main.gdc:88:GDScript::load_byte_code() - Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.
**SCRIPT ERROR**: Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.
   At: res://src/main/Main.gdc:88:GDScript::load_byte_code() - Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.
2021-01-12 15:26:41.522482-0300 AdMob[21951:358885] **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
2021-01-12 15:26:41.522593-0300 AdMob[21951:358885]    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
**ERROR**: Method failed. Returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
2021-01-12 15:26:41.522893-0300 AdMob[21951:358885] **ERROR**: Cannot load byte code from file 'res://src/main/Main.gdc'.
2021-01-12 15:26:41.522993-0300 AdMob[21951:358885]    At: modules/gdscript/gdscript.cpp:2311:load() - Condition "err != OK" is true. Returned: RES()
**ERROR**: Cannot load byte code from file 'res://src/main/Main.gdc'.
   At: modules/gdscript/gdscript.cpp:2311:load() - Condition "err != OK" is true. Returned: RES()
2021-01-12 15:26:41.523461-0300 AdMob[21951:358885] **ERROR**: Failed loading resource: res://src/main/Main.gdc. Make sure resources have been imported by opening the project in the editor at least once.
2021-01-12 15:26:41.523560-0300 AdMob[21951:358885]    At: core/io/resource_loader.cpp:279:_load() - Condition "found" is true. Returned: RES()
**ERROR**: Failed loading resource: res://src/main/Main.gdc. Make sure resources have been imported by opening the project in the editor at least once.
   At: core/io/resource_loader.cpp:279:_load() - Condition "found" is true. Returned: RES()
2021-01-12 15:26:41.525569-0300 AdMob[21951:358885] **ERROR**: res://src/main/Main.tscn:4 - Parse Error: [ext_resource] referenced nonexistent resource at: res://src/main/Main.gd
2021-01-12 15:26:41.525698-0300 AdMob[21951:358885]    At: scene/resources/resource_format_text.cpp:440:poll() - res://src/main/Main.tscn:4 - Parse Error: [ext_resource] referenced nonexistent resource at: res://src/main/Main.gd
**ERROR**: res://src/main/Main.tscn:4 - Parse Error: [ext_resource] referenced nonexistent resource at: res://src/main/Main.gd
   At: scene/resources/resource_format_text.cpp:440:poll() - res://src/main/Main.tscn:4 - Parse Error: [ext_resource] referenced nonexistent resource at: res://src/main/Main.gd
2021-01-12 15:26:41.525894-0300 AdMob[21951:358885] **ERROR**: Failed to load resource 'res://src/main/Main.tscn'.
2021-01-12 15:26:41.526005-0300 AdMob[21951:358885]    At: core/io/resource_loader.cpp:208:load() - Condition "err != OK" is true. Returned: RES()
**ERROR**: Failed to load resource 'res://src/main/Main.tscn'.
   At: core/io/resource_loader.cpp:208:load() - Condition "err != OK" is true. Returned: RES()
2021-01-12 15:26:41.526409-0300 AdMob[21951:358885] **ERROR**: Failed loading resource: res://src/main/Main.tscn. Make sure resources have been imported by opening the project in the editor at least once.
2021-01-12 15:26:41.526520-0300 AdMob[21951:358885]    At: core/io/resource_loader.cpp:279:_load() - Condition "found" is true. Returned: RES()
**ERROR**: Failed loading resource: res://src/main/Main.tscn. Make sure resources have been imported by opening the project in the editor at least once.
   At: core/io/resource_loader.cpp:279:_load() - Condition "found" is true. Returned: RES()
2021-01-12 15:26:41.526665-0300 AdMob[21951:358885] **ERROR**: Failed loading scene: res://src/main/Main.tscn
2021-01-12 15:26:41.526771-0300 AdMob[21951:358885]    At: main/main.cpp:1942:start() - Condition "!scene" is true. Returned: false
**ERROR**: Failed loading scene: res://src/main/Main.tscn
   At: main/main.cpp:1942:start() - Condition "!scene" is true. Returned: false
2021-01-12 15:26:42.377750-0300 AdMob[21951:359410]  - <Google>[I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2021-01-12 15:26:43.527559-0300 AdMob[21951:359410]  - <Google>[I-ACS023012] Analytics collection enabled
gumaciel commented 3 years ago

This time is not crashing, just staying on a purple screen:

Captura de Tela 2021-01-12 às 15 28 46

naithar commented 3 years ago

I guess this is the source of the issue.

**SCRIPT ERROR**: Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.
2021-01-12 15:26:41.522365-0300 AdMob[21951:358885]    At: res://src/main/Main.gdc:88:GDScript::load_byte_code() - Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.
**SCRIPT ERROR**: Parse Error: Too few arguments for "load_banner()" call. Expected at least 3.

AdMob.load_banner() requires parameters that's not passed - load_banner(const String &ad_unit_id, int position, const String &size)

gumaciel commented 3 years ago

The load_banner() method is missing parameters, but everything is ok Captura de Tela 2021-01-12 às 15 31 49

Captura de Tela 2021-01-12 às 15 31 38

naithar commented 3 years ago

Error gives you the hint on where the problem actually is Main.gdc:88

func _on_EnableBanner_pressed():
    EnableBanner.disabled = true
    EnableNative.disabled = true
    AdMob.load_banner()
naithar commented 3 years ago

Since your GDScript singleton and AdMob module singleton have the same name, Godot is probably mistaking one for another when module is actually compiled.

gumaciel commented 3 years ago

Yes, i just change the singleton to "AdMob1" and it's working, hmmm

Captura de Tela 2021-01-12 às 15 38 04

naithar commented 3 years ago

Yeah, I've finally managed to setup project and everything is working fine after singleton name change, but I guess basic stuff for upgrading is done. Your should probably fix other warning just to make compiler happy.

I've also encountered your previous issue: https://github.com/godotengine/godot/issues/44681. I'm still not sure how to reproduce it 100%, but I'll take a closer look when I can.

gumaciel commented 3 years ago

I tried to change the name of Godot Singleton to GoogleAdMob and seems is not working, i need to change the name of the Classes?

Captura de Tela 2021-01-12 às 16 02 56

Parse Error: Non-static function "connect" can only be called from an instance.
**SCRIPT ERROR**: Parse Error: Non-static function "connect" can only be called from an instance.
   At: res://src/main/Main.gdc:23:GDScript::load_byte_code() - Parse Error: Non-static function "connect" can only be called from an instance.

Captura de Tela 2021-01-12 às 16 06 07

naithar commented 3 years ago

No, singleton name doesn't have to match with class name. The error you are referencing is on Main.gdc:23, so you should look at 23rd line.

https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/blob/43346062bc3e5f320d85e2958fdd5ea63eaa948c/example/src/main/Main.gd#L22-L30

So you might have to double check Godot's singleton name.

gumaciel commented 3 years ago

The line 23 was a comment: Captura de Tela 2021-01-12 às 16 13 12

I fixed changing the name of the class: Captura de Tela 2021-01-12 às 16 14 37

Captura de Tela 2021-01-12 às 16 16 32

So strange

naithar commented 3 years ago

Yeah, but I don't this that's the class name is the source of the issue. Because plugins basically use the same system and they are not really bound to the class name. At least in my testing the weren't. But anyway if it's working this way so be it.

gumaciel commented 3 years ago

@naithar , do you know how to pause the game in iOS with Objective-C? because when i play a interstitial or rewarded ad the game doesn't stop, but in Android stops without do any additional configuration

so i need to do this to force stop, but it's not recommended:

Captura de Tela 2021-01-12 às 20 00 47

naithar commented 3 years ago

https://github.com/godotengine/godot/blob/8b6357cf28944301dc816b2bd07900c16396f7a7/platform/iphone/os_iphone.mm#L710-L44

This two functions should probably cover your case, but it requires testing anyway.

gumaciel commented 3 years ago

@naithar Omg works! I tried to do that in years ago but only could do that today thanks to you!

But it's only working for 3.2.4, theres any way to do that in < 3.2.3?

I'm using this method: OSIPhone::get_singleton()->on_focus_out(); on_focus_in();

I saw that in 3.2.3 this is implemented in app_delegate.mm, but i don't know how to use the method

sjhennion commented 3 years ago

@gustavottc Busy day! Just wanted to chime in here that I've pulled your latest changes as of 20 minutes ago, compiling against the 3.2 HEAD on godot and it looks like everything is working just as it was when I was using the precompiled versions earlier this week. Thanks to you as well @naithar!

gumaciel commented 3 years ago

@sjhennion hey! great news! i will close here the issue since the main problem is solved

@naithar thank you so much man, you are amazing!