由于链接器错误,Google Analytics游戏无法构建

时间:2015-08-12 11:42:22

标签: ios xcode unity3d google-analytics

我正在做一个统一项目,这是一个用移动设备玩的AR游戏。它使用vuforia作为AR部分。最近我添加了Google Analytics for Unity(来自开发者网站的googleanalyticsv3.unitypackage)。在那之后,当我尝试在iOS上构建时,我得到了很多" Apple Mach-O Linker"错误(Android仍然构建得很好)。我能够通过添加必要的框架来删除其中的一些,但我仍然有大约50个。我添加了libsqlite3.dylib,libz.dylib,SystemConfiguration.framework和CoreData.framework。然后我还添加了security.framework,它似乎也减少了构建错误。然后,在我添加了Analytics之前,我又对该项目进行了一些提交,并且在相同的Unity和Xcode版本上仍然可以正常构建。

下面粘贴的是我得到的错误:

Undefined symbols for architecture armv7:
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::imbue(std::__1::locale const&)", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::xsgetn(char*, int)", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::uflow()", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::mutex::~mutex()", referenced from:
      StateHolder::~StateHolder() in libQCARUnityPlayer.a(Tracker.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:
      construction vtable for std::__1::basic_istream<char, std::__1::char_traits<char> >-in-std::__1::basic_istringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(double&)", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::ios_base::clear(unsigned int)", referenced from:
      l12810 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18597 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:
      construction vtable for std::__1::basic_istream<char, std::__1::char_traits<char> >-in-std::__1::basic_istringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::cerr", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12905 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::tellg()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18597 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18636 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:
      l18629 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18636 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_istream<char, std::__1::char_traits<char> >&, bool)", referenced from:
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18597 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::showmanyc()", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18597 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::__next_prime(unsigned long)", referenced from:
      l18338 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18347 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18357 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::sync()", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(double)", referenced from:
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::ios_base::init(void*)", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12858 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(char const*) const", referenced from:
      l12804 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)", referenced from:
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(int&)", referenced from:
      l12806 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "non-virtual thunk to std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:
      construction vtable for std::__1::basic_istream<char, std::__1::char_traits<char> >-in-std::__1::basic_istringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::seekg(std::__1::fpos<__mbstate_t>)", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(float&)", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::ios_base::getloc() const", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
      l12805 in libVuforia.a(libVuforia.a-armv7-master.o)
      l17392 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18583 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18584 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18585 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18592 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18593 in libVuforia.a(libVuforia.a-armv7-master.o)
      ...
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "non-virtual thunk to std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:
      construction vtable for std::__1::basic_istream<char, std::__1::char_traits<char> >-in-std::__1::basic_istringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::~basic_streambuf()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12858 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18612 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18626 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18627 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18628 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18630 in libVuforia.a(libVuforia.a-armv7-master.o)
      ...
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12858 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18612 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18626 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18627 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18628 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, unsigned long, std::__1::allocator<char> const&)", referenced from:
      l12808 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::basic_streambuf()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12858 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::locale::~locale()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::cout", referenced from:
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned int&)", referenced from:
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ios<char, std::__1::char_traits<char> >::~basic_ios()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12858 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18612 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18626 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18627 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18628 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
      l12808 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12810 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12811 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12846 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12848 in libVuforia.a(libVuforia.a-armv7-master.o)
      ...
  "std::__1::ctype<char>::id", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18582 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18591 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18730 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::mutex::lock()", referenced from:
      StateHolder::QCAR_onUpdate(QCAR::State&) in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::setStateBufferSize(unsigned int) in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::updateCurrentState() in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::getCurrentState() in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::hasStateBeenSet() in libQCARUnityPlayer.a(StateHolder.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18594 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
      l18649 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::get()", referenced from:
      l12806 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12811 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      l18629 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(unsigned long)", referenced from:
      l12922 in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::setbuf(char*, int)", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::mutex::unlock()", referenced from:
      StateHolder::QCAR_onUpdate(QCAR::State&) in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::setStateBufferSize(unsigned int) in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::updateCurrentState() in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::getCurrentState() in libQCARUnityPlayer.a(StateHolder.o)
      StateHolder::hasStateBeenSet() in libQCARUnityPlayer.a(StateHolder.o)
  "std::__1::basic_streambuf<char, std::__1::char_traits<char> >::xsputn(char const*, int)", referenced from:
      vtable for std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libVuforia.a(libVuforia.a-armv7-master.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
      l12809 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12812 in libVuforia.a(libVuforia.a-armv7-master.o)
      l12858 in libVuforia.a(libVuforia.a-armv7-master.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我在网上已经看到了很多这个问题,但似乎主要是通过添加正确的框架来解决,但我应该把它们全部解决,至少我已经在网上看到了。我也试过AdSupport.framework,但它没有效果,所以我删除了,因为它显然可以使iOS审查失败(我不需要那种跟踪)。我还构建了同样的项目4次(干净利落,每次都在一个新文件夹中),添加框架,删除它们并再次添加它们。我还从项目中删除了Vuforia和Google Analytics并重新添加它们,然后构建了一个新版本但没有更改。如果有人可以帮我解决这个问题,我将非常感谢!

Here is picture of the frameworks and libraries.

Unity版本为4.6.7f1,Xcode为6.4。我下载了Analytics和Vuforia的最新版本。

1 个答案:

答案 0 :(得分:0)

好吧,我自己到那里了。在查看了git提交足够长的时间并尝试了足够的东西之后,我发现当我将它添加到项目中时,Google Analytics已经取代了PostProcessBuildPlayer(在Assets / Editor /中),这意味着Vuforia没有正确构建自己。我添加了Vuforia版本并重命名为Analytics版本PostProcessBuildPlayer_GA,并在构建时添加了正确的框架。之后它构建得很漂亮。