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

ios build error with undefined symbols for armv7 #90

Closed
zszen opened this issue Jun 12, 2019 · 5 comments
Closed

ios build error with undefined symbols for armv7 #90

zszen opened this issue Jun 12, 2019 · 5 comments
Labels

Comments

@zszen
Copy link

zszen commented Jun 12, 2019

Godot version:
3.1.1
xcode 10.2.1
build error
I combined the three .a file with lipo command.

Issue description:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_GADRewardBasedVideoAd", referenced from:
      objc-class-ref in PyramidPoker.a(AdmobRewarded.iphone.opt.arm.o)
  "_OBJC_CLASS_$_GADBannerView", referenced from:
      objc-class-ref in PyramidPoker.a(AdmobBanner.iphone.opt.arm.o)
  "_OBJC_CLASS_$_GADRequest", referenced from:
      objc-class-ref in PyramidPoker.a(AdmobBanner.iphone.opt.arm.o)
      objc-class-ref in PyramidPoker.a(AdmobInterstitial.iphone.opt.arm.o)
      objc-class-ref in PyramidPoker.a(AdmobRewarded.iphone.opt.arm.o)
  "_OBJC_CLASS_$_GADInterstitial", referenced from:
      objc-class-ref in PyramidPoker.a(AdmobInterstitial.iphone.opt.arm.o)
  "_kGADAdSizeSmartBannerLandscape", referenced from:
      -[AdmobBanner loadBanner::] in PyramidPoker.a(AdmobBanner.iphone.opt.arm.o)
  "_kGADAdSizeSmartBannerPortrait", referenced from:
      -[AdmobBanner loadBanner::] in PyramidPoker.a(AdmobBanner.iphone.opt.arm.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@wombatwingdings
Copy link

I had this. It is a bug in xcode. Open up the project in xcode, go to "General" tab, remove "GoogleMobileAds.framework" from frameworks, then re-add it. Should build then. Also, make sure you have directory godot/modules/admob/ios/lib added to framework search path (“Build Settings”).

@Shin-NiL Shin-NiL added the iOS label Jun 13, 2019
@zszen zszen closed this as completed Jun 14, 2019
@wombatwingdings
Copy link

Maybe this should be mentioned in the readme?

@Shin-NiL
Copy link
Collaborator

@wombatwingdings I'll do that, thanks :)

@zszen
Copy link
Author

zszen commented Jun 14, 2019

@wombatwingdings @Shin-NiL
Thanks for reply. I try to re-added. But don't work.
I give the step of the build:

  1. download godot resource 3.1 from https://github.com/godotengine/godot
  2. download godot-admob resource from https://github.com/kloder-games/godot-admob
  3. copy the godot-admob/admob folder to godot /modules/admob
  4. add GoogleMobileAds.framework to godot /modules/admob/ios/lib
  5. modify the godot /modules/admob/config.py
env.Append(FRAMEWORKPATH=['/modules/admob/ios/lib'])

to

env.Append( CPPPATH=['full path of godot/opensource/core'] )
env.Append(FRAMEWORKPATH=['full path of godot/opensource/modules/admob/ios/lib'])
  1. build with code :
scons p=iphone tools=no target=release arch=arm
scons p=iphone tools=no target=release arch=arm64
scons p=iphone tools=no target=release arch=x86_64

I build those with three tabs at the same time.
then combin them

lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a bin/libgodot.iphone.opt.x86_64.a -output bin/godot.iphone.opt.a
  1. copy the godot.iphone.opt.a file to xcode project and overwrite the {gameName}.a file.

  2. add GoogleMobileAds.framework to xcode project. And then and the required framework

  3. check the framework search path

  4. build with error info:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_GADRewardBasedVideoAd", referenced from:
      objc-class-ref in godot.iphone.opt.a(AdmobRewarded.iphone.opt.arm.o)
  "_OBJC_CLASS_$_GADBannerView", referenced from:
      objc-class-ref in godot.iphone.opt.a(AdmobBanner.iphone.opt.arm.o)
  "_OBJC_CLASS_$_GADRequest", referenced from:
      objc-class-ref in godot.iphone.opt.a(AdmobBanner.iphone.opt.arm.o)
      objc-class-ref in godot.iphone.opt.a(AdmobInterstitial.iphone.opt.arm.o)
      objc-class-ref in godot.iphone.opt.a(AdmobRewarded.iphone.opt.arm.o)
  "_OBJC_CLASS_$_GADInterstitial", referenced from:
      objc-class-ref in godot.iphone.opt.a(AdmobInterstitial.iphone.opt.arm.o)
  "_kGADAdSizeSmartBannerLandscape", referenced from:
      -[AdmobBanner loadBanner::] in godot.iphone.opt.a(AdmobBanner.iphone.opt.arm.o)
  "_kGADAdSizeSmartBannerPortrait", referenced from:
      -[AdmobBanner loadBanner::] in godot.iphone.opt.a(AdmobBanner.iphone.opt.arm.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@zszen
Copy link
Author

zszen commented Jun 15, 2019

Now I can run on device with Set "Build Active Architecture Only" to YES.

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

No branches or pull requests

3 participants