Xcode 8.2.1,IOS 8模拟器与崩溃dyld:未找到符号:_ASCIIEncoding_GetByteCount_m1396020051

时间:2017-07-27 11:51:03

标签: ios objective-c unity5

我正在使用Unity为IOS构建游戏,但构建崩溃了。我正在使用统一版本5.5和Xcode 8.2.1

  

dyld:未找到符号:_ASCIIEncoding_GetByteCount_m1396020051   参考自:/ var / containers / Bundle / Application /   预计在:平面命名空间    在/ var / containers / Bundle / Application /

这是我的pod文件:

using namespace llvm;

namespace {

  struct FunctionRename : public ModulePass {
    static char ID; // Pass identification

    FunctionRename() : ModulePass(ID) {}

    bool runOnModule(Module &M) override {

      // Rename all globals and references to them
      for (auto it = M.global_begin(); it != M.global_end(); ++it)
      {...}

      // Rename all aliases and references to them
      for (auto it = M.alias_begin(); it != M.alias_end(); ++it)
      {...}

      // Rename all functions and references to them
      for (auto &F : M)
      {
        StringRef Name = F.getName();
        if (F.isDeclaration())
          continue;

        std::string demangled_name = demangle(Name.str());
        std::string new_name = rename(demangled_name);
        F.setName(mangle(new_name, &F));
        F.setLinkage(GlobalValue::WeakAnyLinkage);
      }
      return true;
    }

    std::string demangle(const std::string &Name)
    {
      int status;
      char* demangled_name = NULL;
      char* cstr_name = new char[Name.length() + 1];
      strcpy(cstr_name, Name.c_str());
      demangled_name = __cxxabiv1::__cxa_demangle(cstr_name, NULL, NULL, &status);
      if (status != 0)
      {
        errs() << "Demangling operation failed:\n";
        switch (status)
        {...}
        exit(-1);
      }
      std::string s(demangled_name);
      return s;
    }

    std::string rename(std::string &Name)
    {
      std::string search_str = std::string("(");
      std::string suffix_str = std::string("_renamed");
      size_t i = Name.find_first_of(search_str);
      if (i == std::string::npos)
        Name.append(suffix_str);
      else
        Name.insert(i, suffix_str);
      return Name;
    }

    /* PROBLEMATIC FUNCTION */
    std::string mangle(const std::string &Name, const GlobalValue *GV)
    {
      SmallString<256> MangledName(StringRef(Name));

      Mangler m;
      m.getNameWithPrefix((SmallVectorImpl<char>&) MangledName, GV, false, true);
      Twine T;
      StringRef S = T.toStringRef((SmallVectorImpl<char>&) MangledName);
      return S.str();
    }
  };
}

// Register Pass
char FunctionRename::ID = 0;
static RegisterPass<FunctionRename> X("functionrename", "Function Rename Pass");

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

问题是由于缺少框架。请添加或不添加检查基础框架。

Make sure you have Foundation framework to your project. (Remove and add it again to be sure).

同样清理深度清理代码并再次运行。

shift + cmd + K