It seems that UCB assembly files aren't updated in the event of plugin removal, breaking builds

Disregard the “breaks build” part, looks like it’s, uh, a cosmetic error, see edits below. :slight_smile:

I have encountered this at least three times while working on a project where I evaluated a huge number of plugins. Not everything is updated for il2cpp/x64 iOS, so some plugins I try out turn out to be broken and are removed from the repository. I double check to remove every trace, including possible link.xml changes, Editor classes and Plugin folder files, but it looks like Cloud Build is persisting references in assembly files.

First build after every plugin removal commit I performed reliably throws errors. Here is a compact log example for the case where I removed prime31 iOS Social Networking plugin from the project, mentioning classes from that very plugin that should no longer be referenced anywhere.

1: [Unity] Initialize engine version: 4.6.4p1 (cced61583dd2)
2: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-firstpass.dll
3: [Unity] Compilation failed: 14 error(s), 0 warnings
4: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/Facebook.cs' could not be found
5: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookBatchRequest.cs' could not be found
6: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookDataTypes.cs' could not be found
7: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookEventListener.cs' could not be found
8: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookManager.cs' could not be found
9: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Twitter/TwitterEventListener.cs' could not be found
10: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Twitter/TwitterManager.cs' could not be found
11: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/FacebookBinding.cs' could not be found
12: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/SharingBinding.cs' could not be found
13: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/SharingManager.cs' could not be found
14: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/TwitterBinding.cs' could not be found
15: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/demoIOS/FacebookGUIManager.cs' could not be found
16: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/demoIOS/SharingGUIManager.cs' could not be found
17: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/demoIOS/TwitterGUIManager.cs' could not be found
18: [Unity] Internal compiler error. See the console log for more information. output was:error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/Facebook.cs' could not be found
19: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookBatchRequest.cs' could not be found
20: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookDataTypes.cs' could not be found
21: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookEventListener.cs' could not be found
22: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Facebook/FacebookManager.cs' could not be found
23: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Twitter/TwitterEventListener.cs' could not be found
24: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingCommon/Twitter/TwitterManager.cs' could not be found
25: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/FacebookBinding.cs' could not be found
26: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/SharingBinding.cs' could not be found
27: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/SharingManager.cs' could not be found
28: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/TwitterBinding.cs' could not be found
29: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/demoIOS/FacebookGUIManager.cs' could not be found
30: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/demoIOS/SharingGUIManager.cs' could not be found
31: [Unity] error CS2001: Source file `Assets/Plugins/SocialNetworkingIOS/demoIOS/TwitterGUIManager.cs' could not be found
32: [Unity] Initialize engine version: 4.6.4p1 (cced61583dd2)
33: [Unity] Finished exporting player successfully.
34: + Building with Xcode 6.0.1
35: [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/d20150404-6216-by6t35/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_dependencies.txt --output-partial-info-plist /UNITY_PATH/workspace/BVR_TEMP_DIR/d20150404-6216-by6t35/build/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_generated_info.plist --app-icon AppIcon --launch-image LaunchImage --platform iphoneos --minimum-deployment-target 7.1 --target-device iphone --target-device ipad --compress-pngs --compile EXPORT_PATH/Metro.app /opt/workspace/BVR_TEMP_DIR/d20150404-6216-by6t35/Unity-iPhone/Images.xcassets
36: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-6216-by6t35/Classes/UI/SplashScreen.mm:244:10: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
37: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-6216-by6t35/Classes/UI/UnityAppController+ViewHandling.mm:78:18: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
38: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-6216-by6t35/Classes/UI/iAD.mm:290:9: warning: 'presentFromViewController:' is deprecated: first deprecated in iOS 7.0 - Use -[UIViewController requestInterstitialAdPresentation] and related APIs documented in <iAd/UIViewControlleriAdAdditions.h>. [-Wdeprecated-declarations]
39: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-6216-by6t35/Classes/UI/SplashScreen.mm:244:10: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
40: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-6216-by6t35/Classes/UI/UnityAppController+ViewHandling.mm:78:18: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
41: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-6216-by6t35/Classes/UI/iAD.mm:290:9: warning: 'presentFromViewController:' is deprecated: first deprecated in iOS 7.0 - Use -[UIViewController requestInterstitialAdPresentation] and related APIs documented in <iAd/UIViewControlleriAdAdditions.h>. [-Wdeprecated-declarations]
42: [xcode] Showing first 200 warnings only
43: [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
44: [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
45: [xcode] ** BUILD FAILED **
46: ! build of 'default-ios' failed. compile failed
47: Finished: FAILURE
Status: FAILED

This suggests that UCB is not generating assembly files prior to the build attempt, reusing ones saved from previous build - at least, not all of them, Assembly-CSharp-firstpass in this particular case.

The next build attempt after that is usually successful.

Edit: I think the linker error in the end should be disregarded, that might be down to separate issue on my side, checking it with another build now, will report results in 30 minutes. Top portion of the log with assembly-related errors is still definitely down to plugin removal and happened a number of times before, but I guess it shouldn’t cause the build to fail, considering successful player export message after them :slight_smile:

Edit 2: Yeah, I’m getting a successful build now. And it looks like those errors are thrown for every non-plugin class too - here is an example of the latest build where I removed one.

1: [Unity] Initialize engine version: 4.6.4p1 (cced61583dd2)
2: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
3: [Unity] Compilation failed: 1 error(s), 0 warnings
4: [Unity] error CS2001: Source file `Assets/Code/Share/UnityNativeShareWrapper.cs' could not be found
5: [Unity] Internal compiler error. See the console log for more information. output was:error CS2001: Source file `Assets/Code/Share/UnityNativeShareWrapper.cs' could not be found
6: [Unity] Initialize engine version: 4.6.4p1 (cced61583dd2)
7: [Unity] Finished exporting player successfully.
8: + Building with Xcode 6.0.1
9: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Classes/UI/SplashScreen.mm:244:10: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
10: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Classes/UI/UnityAppController+ViewHandling.mm:78:18: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
11: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Classes/UI/iAD.mm:290:9: warning: 'presentFromViewController:' is deprecated: first deprecated in iOS 7.0 - Use -[UIViewController requestInterstitialAdPresentation] and related APIs documented in <iAd/UIViewControlleriAdAdditions.h>. [-Wdeprecated-declarations]
12: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Classes/UI/SplashScreen.mm:244:10: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
13: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Classes/UI/UnityAppController+ViewHandling.mm:78:18: warning: 'wantsFullScreenLayout' is deprecated: first deprecated in iOS 7.0 [-Wdeprecated-declarations]
14: [xcode] /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Classes/UI/iAD.mm:290:9: warning: 'presentFromViewController:' is deprecated: first deprecated in iOS 7.0 - Use -[UIViewController requestInterstitialAdPresentation] and related APIs documented in <iAd/UIViewControlleriAdAdditions.h>. [-Wdeprecated-declarations]
15: [xcode] Showing first 200 warnings only
16: [xcode] warning: (armv7) /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Libraries/libiPhone-lib.a(Profiler.o) object file doesn't contain DWARF debug information
17: [xcode] warning: (arm64) /BUILD_PATH/BVR_TEMP_DIR/d20150404-13877-tnn5k8/Libraries/libiPhone-lib.a(Profiler.o) object file doesn't contain DWARF debug information
18: WORKSPACESIZE | ARTIFACTSSIZE | CACHESIZE
19: 15.71 MiB | 194.94 MiB | 115.31...
20: publishing finished successfully.
Status: SUCCEEDED

As you can see Assembly-CSharp persisted UnityNativeShareWrapper which is a harmless monobehaviour that was not used in a single scene. The errors like that, it looks like, can’t break your builds, so it’s not exactly an issue that’s critical to fix as fast as possible.

But I guess it might be worth taking a look at it, if only to make your usage stats more reliable. You know, to avoid situations where someone in the Unity Cloud Build team is spammed by alerts about hundreds of logged errors only to find that it was this harmless issue cluttering the log. :slight_smile:

Thanks for the nice write up!

There are indeed some reworks in the pipeline to make this much more transparent and selectable. Does this particularly problem also exists when you trigger a Clean Build All?