Hi,
unfortunately our iOS build in Unity Cloud Build does fail compiling. Error message:
[xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
The build on local machine via Editor works perfect, I don’t modify the XCode project - just Build & run and it works. We are using the InApp Plugin by Prime31 and GameAnalytics, which put some stuff into the Plugin/iOS folder, but this should not be a / the problem?
Here the XCode build log provided by Unity Cloud build:
[xcode] /APPLICATION_PATH/Xcode6_0_1.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_dependencies.txt --output-partial-info-plist /opt/workspace/BVR_TEMP_DIR/d20150124-20299-xievo9/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_generated_info.plist --app-icon AppIcon --launch-image LaunchImage --platform iphoneos --minimum-deployment-target 4.3 --target-device iphone --target-device ipad --compress-pngs --compile EXPORT_PATH/frs3.app /opt/workspace/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: App Icons built with asset catalogs are unavailable on iOS releases prior to 5.0.
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: A 57x57@2x app icon is required for iPhone apps targeting releases of iOS prior to 7.0
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: A 60x60@2x app icon is required for iPhone apps targeting iOS 7.0 and later
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: A 72x72 app icon is required for iPad apps targeting releases of iOS prior to 7.0
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: A 72x72@2x app icon is required for iPad apps targeting releases of iOS prior to 7.0
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: A 76x76 app icon is required for iPad apps targeting iOS 7.0 and later
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Unity-iPhone/Images.xcassets:./AppIcon.appiconset: warning: A 76x76@2x app icon is required for iPad apps targeting iOS 7.0 and later
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Classes/UI/iAD.mm:372:83: warning: 'ADBannerContentSizeIdentifier320x50' is deprecated: first deprecated in iOS 4.2 [-Wdeprecated-declarations]
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Classes/UI/iAD.mm:374:84: warning: 'ADBannerContentSizeIdentifier480x32' is deprecated: first deprecated in iOS 4.2 [-Wdeprecated-declarations]
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Classes/UI/iAD.mm:382:95: warning: 'ADBannerContentSizeIdentifier320x50' is deprecated: first deprecated in iOS 4.2 [-Wdeprecated-declarations]
[xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150124-20299-xievo9/Classes/UI/iAD.mm:384:96: warning: 'ADBannerContentSizeIdentifier480x32' is deprecated: first deprecated in iOS 4.2 [-Wdeprecated-declarations]
[xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[xcode] ** BUILD FAILED **
! build of 'default-ios' failed. compile failed
Any hint what the error message could mean in our case? How to proceed?
Best regards,
Bennet
Please check your repository ignore file settings if library files like .a are blocked and ensure all library files which are necessary for Prime and GameAnalytics are checked in correctly. Check your extended log for detailed information.
Ah thanks for the hint regarding the “Full log”! Detected that there is also another dependency: Pushwoosh.
The error log says:
3247: [xcode] Undefined symbols for architecture armv7:
3248: [xcode] "_kSecValueData", referenced from:
3249: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3250: [xcode] "_SecItemCopyMatching", referenced from:
3251: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3252: [xcode] "_kSecClass", referenced from:
3253: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3254: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3255: [xcode] "_kSecReturnData", referenced from:
3256: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3257: [xcode] "_kSecMatchLimit", referenced from:
3258: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3259: [xcode] "_kSecClassGenericPassword", referenced from:
3260: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3261: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3262: [xcode] "_kSecAttrService", referenced from:
3263: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3264: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3265: [xcode] "_kSecMatchLimitOne", referenced from:
3266: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3267: [xcode] "_kSecAttrAccount", referenced from:
3268: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3269: [xcode] -[PushNotificationManager readDeviceId] in Pushwoosh.a(PushNotificationManager.o)
3270: [xcode] "_kSecAttrAccessible", referenced from:
3271: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3272: [xcode] "_kSecAttrAccessibleAlwaysThisDeviceOnly", referenced from:
3273: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3274: [xcode] "_SecItemAdd", referenced from:
3275: [xcode] -[PushNotificationManager writeDeviceID:] in Pushwoosh.a(PushNotificationManager.o)
3276: [xcode] ld: symbol(s) not found for architecture armv7
Quick googling revelead that the missing referenced things can be found in the Security.framework. Interesting is that this framework is not visible in the local XCode build?
However I added the framework with the XCode Manipulation API now.
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.IO;
public class PushwooshPostProcess : MonoBehaviour {
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
{
if (buildTarget == BuildTarget.iPhone) {
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));
string target = proj.TargetGuidByName("Unity-iPhone");
// Add custom system frameworks. Duplicate frameworks are ignored.
// needed by our native plugin in Assets/Plugins/iOS
proj.AddFrameworkToProject(target, "Security.framework", false /*not weak*/);
File.WriteAllText(projPath, proj.WriteToString());
}
}
}
Unfortunately the build is still not successfull:
2676: [xcode] 2015-01-24 09:03:53.887 xcodebuild[27550:1007] Unexpected character / at line 1
2677: [xcode] xcodebuild: error: Unable to read project 'Unity-iPhone.xcodeproj'.
2678: [xcode] Reason: Project /BUILD_PATH/BVR_TEMP_DIR/d20150124-26914-bbhrr5/Unity-iPhone.xcodeproj cannot be opened because the project file cannot be parsed.
Seems like the XCode project gets corrupted by the code above (which is mostly copy paste from the XCode Manipulation API Example).
Got it working now. The problem was, that I copied the iOS.Xcode.Extensions.dll from the example. This dll seems to be outdated(?).
Now i pulled the .cs files (https://bitbucket.org/Unity-Technologies/xcodeapi/src) and added them to “Editor/XCode Manipulation API”. The final script i am using (in order to avoid build errors on android), i am using the following script:
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif
using System.IO;
public class PushwooshPostProcess : MonoBehaviour {
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
{
#if UNITY_IOS
if (buildTarget == BuildTarget.iPhone) {
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));
string target = proj.TargetGuidByName("Unity-iPhone");
// Add custom system frameworks. Duplicate frameworks are ignored.
// needed by our native plugin in Assets/Plugins/iOS
proj.AddFrameworkToProject(target, "Security.framework", false /*not weak*/);
File.WriteAllText(projPath, proj.WriteToString());
//Debug.Log(proj.WriteToString());
}
#endif
}
}
Thread can be closed
1 Like
Thank you for the update! I was not aware this could cause a problem.