Alpaca Tech Blog

ゲーム作る系 草食動物の備忘録

【Unity】ローカルビルドは通るのにCloubBuildで失敗した対応

 

経緯

Unity2017(細かいバージョン忘れた)作ったものを
Unity2018.3.0f2 にアップグレードしました。

ローカルでのビルドは成功するのですが、
CloudBuildで失敗しました。

CloudBuildは、ローカルと違って利用していないシーンやシェーダー見るのかな。よくわかりません。

 

以下がエラーです

f:id:alpacatech:20181222172235p:plain

Unity(10477,0x7fff8f4e0380) malloc: *** error for object 0x11613c970: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[Unity] WARNING: RGB Compressed PVRTC 4BPP UNorm format is not supported, decompressing texture
[Unity] WARNING: RGBA Compressed PVRTC 4BPP UNorm format is not supported, decompressing texture
[Unity] WARNING: RGBA Compressed PVRTC 4BPP UNorm format is not supported, decompressing texture
[Unity] WARNING: RGBA Compressed PVRTC 4BPP UNorm format is not supported, decompressing texture
[Unity] ERROR: 0:17: 'varying' : syntax error: syntax error
[Unity] ERROR: 0:17: 'varying' : syntax error: syntax error
error: attach failed: unable to attach
a fatal error in the mono runtime or one of the native libraries

 

malloc: *** error for object 0x11613c970~ を調べてもUnityCloud関係なく
xcode等のエラーでした。

 

よくわからないので、
[Unity] ERROR: 0:17: 'varying' : syntax error: syntax error
https://stackoverflow.com/questions/23456739/syntaxerror-varying-in-glslを調べたら

stackoverflow.com

Why am I not allowed to use varying variables?

Because they have been replaced by the more generic in/out variable concept since GLSL 1.30.

 

varying 使えないみたいです。

 

今回の対応

シェーダーコードでvaryingを利用している所を削除。
varying mediump vec2 uv;

mediump vec2 uv;


まとめ

テストプロジェクト作ったりと数日かかりました

(CloudBuild1回試すのに時間がかかる)

エラー内容の最初の行から解決するのでなく、全体を見るべきでした。