Closed blue7un closed 3 years ago
I'm currently having the same issue. I've been unable to get Admob v6.0.0 to link on iOS. I've tried both a blank new project using the HelloWorld example (as described above) as well as my own game project that was previously using Admob v5.4.0. Using Unity 2020.3.6f1 and XCode 12.5.
The same problem.
I'm currently having the same problem.
same problem.
same problem
unity 2019.4.22f1 xcode 12.4
Same problem here and it is a huge issue for us.
@JillSong Similar issue on Unity 2018.4.10f1:
Undefined symbols for architecture armv7:
"_GADURequestInterstitial", referenced from:
_Externs_GADURequestInterstitial_m7354DBBE6F0E4C60EFEE0EC733AAEC22D91E2B0C in Bulk_GoogleMobileAds.iOS_0.o
(maybe you meant: _Externs_GADURequestInterstitial_m7354DBBE6F0E4C60EFEE0EC733AAEC22D91E2B0C)
ld: symbol(s) not found for architecture armv7
same problem
unity 2020.2.6f1 xcode 12.5
@blue7un
Okay, I'm going to try adding GADU*
-files from source/plugin/Assets/Plugins/iOS to Assets/Plugins/iOS/
.
Same problem. Any fix?
I'm going to try adding
GADU*
-files from source/plugin/Assets/Plugins/iOS toAssets/Plugins/iOS/
This results in a lot of duplicate symbol errors. Perhaps I should only add header h-files, not implementation m-files to avoid clash with unity-plugin-library.a
.
@JillSong
What is GADURequestInterstitial()
? It is not referenced anywhere.
[DllImport("__Internal")]
internal static extern void GADURequestInterstitial(IntPtr interstitial, IntPtr request);
— source/plugin/Assets/GoogleMobileAds/Platforms/iOS/Externs.cs#L271
It used to be implemented in source\plugin\Assets\Plugins\iOS\GADUInterface.m, but it's not there anymore. Seems like it was replaced with GADULoadInterstitialAd()
.
The following function is not implemented in unity-plugin-library.a. I checked it with IDA.
[DllImport("__Internal")]
internal static extern void GADURequestInterstitial(IntPtr interstitial, IntPtr request);
This function was not used anymore in admob 6.0. To fix this link error, you could remove any code that call it. Or just add a place holder function, as following:
void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }
Same problem. We're downgrading to 5.4 until this is fixed. Sounds like the sort of bug they'd have noticed if they'd just built it once for the latest Unity LTS (2020 LTS).
@jungletree Can I ask where to put the place holder function ?
Hi! The same problem. How to fix it?
The following function is not implemented in unity-plugin-library.a. I checked it with IDA.
[DllImport("__Internal")] internal static extern void GADURequestInterstitial(IntPtr interstitial, IntPtr request);
This function was not used anymore in admob 6.0. To fix this link error, you could remove any code that call it. Or just add a place holder function, as following:
void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }
Would like to ask where to put this function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }"
I'm going to try adding
GADU*
-files from source/plugin/Assets/Plugins/iOS toAssets/Plugins/iOS/
This results in a lot of duplicate symbol errors. Perhaps I should only add header h-files, not implementation m-files to avoid clash with
unity-plugin-library.a
.
May I ask if you've had some luck?
same problem Unity 2020.3.6f1 Xcode 12.5
I was able to get around this by commenting out line 7897
in Classes\Native\GoogleMobileAds.iOS.cpp
in XCode:
reinterpret_cast<PInvokeFunc>(GADURequestInterstitial)(___interstitial0, ___request1);
This looks like the casting / native invocation of the GADURequestInterstitial
function. Without this invocation, the compiler shouldn't look for it.
Note that this code looks auto-generated, so it may not appear consistently on line 7897
.
Also note that I don't use interstitials in my code, so I'm not sure if this disables interstitials entirely or not. It may be more correct to implement the function as indicated by @jungletree above.
I was able to get around this by making the following changes to
Classes\Native\GoogleMobileAds.iOS.cpp
in XCode:
- Comment out this on line
7891
:System.Void GoogleMobileAds.iOS.Externs::GADURequestInterstitial(System.IntPtr,System.IntPtr)
- Comment out this on line
7897
:reinterpret_cast<PInvokeFunc>(GADURequestInterstitial)(___interstitial0, ___request1);
Note that I don't use interstitials in my code, so I'm not sure if this disables interstitials entirely or not. It may be more correct to implement the function as indicated by @jungletree above.
Hi, may I ask where to put the function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }" ? Should I put it in a script in unity? Can you please guide me where I should? Or should I put it in xcode?
I was able to get around this by making the following changes to
Classes\Native\GoogleMobileAds.iOS.cpp
in XCode:
- Comment out this on line
7891
:System.Void GoogleMobileAds.iOS.Externs::GADURequestInterstitial(System.IntPtr,System.IntPtr)
- Comment out this on line
7897
:reinterpret_cast<PInvokeFunc>(GADURequestInterstitial)(___interstitial0, ___request1);
Note that I don't use interstitials in my code, so I'm not sure if this disables interstitials entirely or not. It may be more correct to implement the function as indicated by @jungletree above.
Hi, may I ask where to put the function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }" ?
To implement my solution, I did not put this function. I just commented out the reinterpret_cast<PInvokeFunc>
line.
Should I put it in a script in unity? Can you please guide me where I should? Or should I put it in xcode?
XCode.
@onom88
Would like to ask where to put this function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }"
I've created a file Assets/Plugins/iOS/Workaround.m with the following definitions:
#import <GoogleMobileAds/GoogleMobileAds.h>
#import "GADUTypes.h"
// Workaround for https://github.com/googleads/googleads-mobile-unity/issues/1616
void GADURequestInterstitial(GADUTypeInterstitialRef interstitial, GADUTypeRequestRef request) { }
void GADURequestRewardedAd(GADUTypeRewardedAdRef rewardedAd, GADUTypeRequestRef request) { }
I have also added file source/plugin/Assets/Plugins/iOS/GADUTypes.h and other headers nearby from this repository to Assets/Plugins/iOS/
@onom88
Would like to ask where to put this function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }"
I've created a file Assets/Plugins/iOS/Workaround.m with the following definitions:
#import <GoogleMobileAds/GoogleMobileAds.h> #import "GADUTypes.h" // Workaround for https://github.com/googleads/googleads-mobile-unity/issues/1616 void GADURequestInterstitial(GADUTypeInterstitialRef interstitial, GADUTypeRequestRef request) { } void GADURequestRewardedAd(GADUTypeRewardedAdRef rewardedAd, GADUTypeRequestRef request) { }
I have also added file source/plugin/Assets/Plugins/iOS/GADUTypes.h and other headers nearby from this repository to Assets/Plugins/iOS/
May I ask what are the other headers needed? i'm sorry im a super beginner in using xcode. In my game, im only using banner ads and interstitial ads. Should I also add all files with the word interstitial? from this link
Thank you so much for your help!
@lucianocheng, thanks. After commenting out this line: build succeded and ads working.
7897: reinterpret_cast
(GADURequestInterstitial)(interstitial0, request1);
@onom88
May I ask what are the other headers needed?
Looks like it's enough to add just only Assets/Plugins/iOS/GADUTypes.h, but I added all of the headers from this directory, just in case.
im a super beginner in using xcode.
I'm not an Xcode user either :) More over I'm sitting on Windows, and make iOS-packages with our build server.
All these manipulations don't require additional steps in Xcode — just drop Assets\Plugins\iOS\Workaround.m and Assets\Plugins\iOS\GADUTypes.h to your Unity-project.
@onom88 It would probably be sufficient to reduce Assets/Plugins/iOS/Workaround.m to just this, with no headers needed at all:
// Workaround for https://github.com/googleads/googleads-mobile-unity/issues/1616
typedef const void *GADUTypeInterstitialRef;
typedef const void *GADUTypeRewardedAdRef;
typedef const void *GADUTypeRequestRef;
void GADURequestInterstitial(GADUTypeInterstitialRef interstitial, GADUTypeRequestRef request) { }
void GADURequestRewardedAd(GADUTypeRewardedAdRef rewardedAd, GADUTypeRequestRef request) { }
@onom88 It would probably be sufficient to reduce Assets/Plugins/iOS/Workaround.m to just this, with no headers needed at all:
// Workaround for https://github.com/googleads/googleads-mobile-unity/issues/1616 typedef const void *GADUTypeInterstitialRef; typedef const void *GADUTypeRewardedAdRef; typedef const void *GADUTypeRequestRef; void GADURequestInterstitial(GADUTypeInterstitialRef interstitial, GADUTypeRequestRef request) { } void GADURequestRewardedAd(GADUTypeRewardedAdRef rewardedAd, GADUTypeRequestRef request) { }
Thank you so much! you're a life saver!
The following function is not implemented in unity-plugin-library.a. I checked it with IDA.
[DllImport("__Internal")] internal static extern void GADURequestInterstitial(IntPtr interstitial, IntPtr request);
This function was not used anymore in admob 6.0. To fix this link error, you could remove any code that call it. Or just add a place holder function, as following:
void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }
Would like to ask where to put this function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }"
Hi, you need to create .mm file in your xcode project, add the following code in this file:
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }
#ifdef __cplusplus
}
#endif
This will make the linker tool find symbol GADURequestInterstitial
.
The following function is not implemented in unity-plugin-library.a. I checked it with IDA.
[DllImport("__Internal")] internal static extern void GADURequestInterstitial(IntPtr interstitial, IntPtr request);
This function was not used anymore in admob 6.0. To fix this link error, you could remove any code that call it. Or just add a place holder function, as following:
void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }
Would like to ask where to put this function "void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { }"
Hi, you need to create .mm file in your xcode project, add the following code in this file:
#include <stdlib.h> #ifdef __cplusplus extern "C" { #endif void GADURequestInterstitial(intptr_t interstitial, intptr_t request) { } #ifdef __cplusplus } #endif
This will make the linker tool find symbol
GADURequestInterstitial
.
Hi, if you do a source code compare between Admob v5.4 and Admob 6.0, you will find that GADURequestInterstitial
was replaced by another function called GADULoadInterstitialAd
. But for admob 6.0, the dllImport for GADURequestInterstitial
still exists. So you could just comment it. Or add a place holder function to fake the missing symbol.
@jungletree Thanks for explaining the problem.
We changed how we package the plugin for v6.0, and the issue lies in the dll build, not in the source code. So please import our source code instead of the unity package for now. We will release the fix soon.
Hi, I am getting this same error, I am new to unity, So please let me know how can I import source code instead of the unity package? Thanks
Hi, I am getting this same error, I am new to unity, So please let me know how can I import source code instead of the unity package? Thanks
Hey Kamal, I faced this exact same issue yesterday. I fixed it doing the Workaround.m done by @onom88.
If you want to add the code directly (didn't try that myself), download de zip file, navigate it to source/plugin/Assets and you should add all that to your project.
cheers!
Hi, I am getting this same error, I am new to unity, So please let me know how can I import source code instead of the unity package? Thanks
Hey Kamal, I faced this exact same issue yesterday. I fixed it doing the Workaround.m done by @onom88.
If you want to add the code directly (didn't try that myself), download de zip file, navigate it to source/plugin/Assets and you should add all that to your project.
cheers!
Thank you for your help
@JillSong hi, I've the same issue, and I tried sourcecode too, but still can't build in xcode. following is the error message from xode. is there any update on the unity package?
Arm64 function not 4-byte aligned: _unwind_tester from /Users/kevin/Documents/workspace/piu_xcode/submit/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbol: _kGADAdLoaderAdTypeUnifiedNative
Undefined symbol: _OBJCCLASS$_DFPInterstitial
Undefined symbol: _OBJCCLASS$_DFPRequest
Undefined symbol: _OBJCCLASS$_DFPBannerView
Undefined symbol: _OBJCCLASS$_GADRewardBasedVideoAd
Undefined symbol: _OBJCCLASS$_GADRequestError
Undefined symbol: _OBJCCLASS$_GADUnifiedNativeAd
Undefined symbol: _OBJCCLASS$_GADInterstitial
Undefined symbol: _GADURequestInterstitial
@JillSong Hello, I think we need to have a full release version to fix this.
@onom88 It would probably be sufficient to reduce Assets/Plugins/iOS/Workaround.m to just this, with no headers needed at all:
// Workaround for https://github.com/googleads/googleads-mobile-unity/issues/1616 typedef const void *GADUTypeInterstitialRef; typedef const void *GADUTypeRewardedAdRef; typedef const void *GADUTypeRequestRef; void GADURequestInterstitial(GADUTypeInterstitialRef interstitial, GADUTypeRequestRef request) { } void GADURequestRewardedAd(GADUTypeRewardedAdRef rewardedAd, GADUTypeRequestRef request) { }
Same issue. Worked for me, thank you!
Closing the issue. The fix will be in the next release.
Still not fixed. Tested with Admob Unity Plugin v.6.0.1
Same problem here with
@mnplays Could you verify if you have deleted the entire old plugin and re-import 6.0.1?
Let us know if the problem persists, thanks!
Still not working :( We tried a bunch of things, but we are not getting results
We deleted all old files, and Plugins/iOS folder, reimported Admob 6.0.1 and we still have the same issue. I will try to give you more details:
Used versions XCode 12.5 Unity 2019.4.25f1 Admob 6.0.1 (20.1.0) Vungle 3.6.0 (6.9.1.1 Android, 6.9.2.0 iOS) AppLovin 5.0.0 (10.1.2.0 Android, 10.2.1.0) UnityAds 2.7.0 (3.7.1.0 Android & iOS) Facebook 3.3.0 (6.4.0.0 Android, 6.4.1.0 iOS) AdColony 2.0.3 (4.1.4.1 Android, 4.1.5.0 iOS)
Any idea?
I also tried 6.0.1 on now
seems it's not yet fixed,
you are using "GADRewardedAdDelegate" instead of GADFullScreenContentDelegate
Would you please update the ios plugin to support latest AdMob SDK
Still not working :( We tried a bunch of things, but we are not getting results
We deleted all old files, and Plugins/iOS folder, reimported Admob 6.0.1 and we still have the same issue. I will try to give you more details:
- We cleaned project from previous Admob version (we deleted everything under Plugins/iOS)
- We imported the new unitypackages (Admob 6.0.1 and ad networks, listed below)
- Failure to compile in xcode expects a reference in the VungleExtrasBuilder class (GADUAdNetworkExtras.h file not found)
- We copied the required file (GADUAdNetworkExtras.h) to Plugins/iOS folder, getting it from a previous Admob version (5.4.0)
- Compile again and get a new error
Used versions XCode 12.5 Unity 2019.4.25f1 Admob 6.0.1 (20.1.0) Vungle 3.6.0 (6.9.1.1 Android, 6.9.2.0 iOS) AppLovin 5.0.0 (10.1.2.0 Android, 10.2.1.0) UnityAds 2.7.0 (3.7.1.0 Android & iOS) Facebook 3.3.0 (6.4.0.0 Android, 6.4.1.0 iOS) AdColony 2.0.3 (4.1.4.1 Android, 4.1.5.0 iOS)
Any idea?
I had the same issue with 6.0.0 and 6.0.1 are you using AdColony mediation? I had to remove AdColony to be able to build the project, looks like it's not compatible with the newest version of this plugin. In the other hand, if I downgrade to 5.4.0, AdColony works but AppLovin stops working because the newest version of AppLovin plugin requires GoogleMobileAds 8.0+ and the pod server for the old versions is down.
I had the same issue 6.0.1 with AdColony mediation (2.0.3) with "GADUAdNetworkExtras" file not found And I had removed AdColony from my project
I had the same issue 6.0.1 with AdColony mediation (2.0.3) with "GADUAdNetworkExtras" file not found And I had removed AdColony from my project
Not the optimal solution since one less mediation network can affect ads income. But this was the only way I could build the game. Let's hope it gets fixed soon
To anyone having issues with AdColony Mediation.
GoogleMobileAdsSettings.asset
fileGoogleMobileAds
folderPlugins/iOS
and Plugins/Android folder
GoogleMobileAdsSettings.asset
fileGADUAdNetworkExtras.h
file from source/plugin/Assets/Plugins/iOS
and paste it into Plugins/iOS
To anyone having issues with AdColony Mediation.
- Make a backup of your
GoogleMobileAdsSettings.asset
file- Delete the
GoogleMobileAds
folder- Delete all google ads relate files in the
Plugins/iOS
andPlugins/Android folder
- Install 6.0.1
- Install all your Mediation network packages (AdColony included)
- In the editor, go to Assets -> External Dependency Manager -> iOS Resolver -> Settings
- Enable "Link frameworks statically"
- Restore your backed up
GoogleMobileAdsSettings.asset
file- IMPORTANT go to releases and download the 6.0.1 source code
- Grab the
GADUAdNetworkExtras.h
file fromsource/plugin/Assets/Plugins/iOS
and paste it intoPlugins/iOS
- Build should work now
Can confirm that this solution solved the issue with Vungle as well. Same issue that was presented with AdColony it seems ("GADUAdNetworkExtras" file not found).
However, although the build now succeeds, the game crashes after launch with this error:
Thread 53: “+[GADRequest sdkVersion]: unrecognized selector sent to class 0x10cdd1f00”
I'm using Xcode 12.4.0, Unity 2091.4.16f1 and AdMob 6.0.1 with latest compatible mediation adapters.
Hi , i had same problem. Before build, i deleted iOS and Android folders in Plugins folder in Unity. For me that was the problem, i undelete these two folders and problem gone. Hope helps.
Updating the new version GoogleMobileAds package in Unity resolved my issue.
Steps to reproduce:
=> Create empty Unity project => Copy sample HelloWorld to Assets folder => Update Admob
appId
=> Use original iOS Resolver Settings (enableuse_frameworks!
+ enableAlways add the main target
) => Build to Xcode => Build using XcodeChanging iOS Resolver Settings gives same result:
use_frameworks!
Always add the main target
)