Skip to content

Instantly share code, notes, and snippets.

@murapong
Last active January 3, 2017 07:47
Show Gist options
  • Save murapong/e0f4658ea3521717e05c3af49b1c0396 to your computer and use it in GitHub Desktop.
Save murapong/e0f4658ea3521717e05c3af49b1c0396 to your computer and use it in GitHub Desktop.
AdMobを入れたUnityプロジェクトがUnity Cloud Build上でビルドエラーになるときの対処法 ref: http://qiita.com/murapong/items/98977331e6db4bd6a03f
#elif UNITY_IOS
// Type iosResolver = Google.VersionHandler.FindClass(
// "Google.IOSResolver", "Google.IOSResolver");
// if (iosResolver == null) {
// return;
// }
// Google.VersionHandler.InvokeStaticMethod(
// iosResolver, "AddPod",
// new object[] { "Google-Mobile-Ads-SDK" },
// namedArgs: new Dictionary<string, object>() {
// { "version", "7.13+" }
// });
#endif // UNITY_IOS
2479: [Unity] 'pod' command not found; unable to generate a usable Xcode project. You can install cocoapods with the Ruby gem package manager:
2480: [Unity] > sudo gem install -n /usr/local/bin cocoapods
2481: [Unity] > pod setup
2491: [Unity] Error running cocoapods. Please ensure you have at least version 1.0.0. You can install cocoapods with the Ruby gem package manager:
2492: [Unity] > sudo gem install -n /usr/local/bin cocoapods
2493: [Unity] > pod setup
2494: [Unity] 'pod --version' returned status: 1
2495: [Unity] output:
2479: [Unity] 'pod' command not found; unable to generate a usable Xcode project. You can install cocoapods with the Ruby gem package manager:
2480: [Unity] > sudo gem install -n /usr/local/bin cocoapods
2481: [Unity] > pod setup
2491: [Unity] Error running cocoapods. Please ensure you have at least version 1.0.0. You can install cocoapods with the Ruby gem package manager:
2492: [Unity] > sudo gem install -n /usr/local/bin cocoapods
2493: [Unity] > pod setup
2494: [Unity] 'pod --version' returned status: 1
2495: [Unity] output:
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public static class XcodePostProcessBuild
{
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget target, string path)
{
if (target != BuildTarget.iOS)
{
return;
}
var project = new PBXProject();
project.ReadFromFile(PBXProject.GetPBXProjectPath(path));
var projectGuid = project.TargetGuidByName(PBXProject.GetUnityTargetName());
// Enable Modules (C and Objective-C)をYESに設定する
project.SetBuildProperty(projectGuid, "CLANG_ENABLE_MODULES", "YES");
project.WriteToFile(PBXProject.GetPBXProjectPath(path));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment