blog

プログラミングとひとりごと。

UnityでビルドしてXcodeで開くと警告が出ている(対応途中まで)

Unity2017からiOS用にビルドしてXcode9.2(9C40b)で開くと

(黄色い)警告が12個出ていた。

 

 

Value Conversion Issue

unsigned transmitted = [_outputStream write: bytes maxLength: dataSize];

Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'unsigned int'

(暗黙の変換は整数精度を失います。 'NSInteger'(別名 'long')から 'unsigned int')

 

unsigned transmitted = CFWriteStreamWrite(writeStream, (UInt8*)bytes, dataSize);

Implicit conversion loses integer precision: 'CFIndex' (aka 'long') to 'unsigned int'

(暗黙の変換は整数精度を失います。 'CFIndex'(別名 'long')から 'unsigned int')

 

▼Semantic Issue

float safeAreaInsetLeft = [UnityGetGLView() safeAreaInsets].left;

'safeAreaInsets' is only available on iOS 11.0 or newer

Enclose 'safeAreaInsets' in an @available check to silence this warning 「FIX」

('safeAreaInsets'はiOS 11.0以降でのみ使用できます)

 

float safeAreaInsetRight = [UnityGetGLView() safeAreaInsets].right;

'safeAreaInsets' is only available on iOS 11.0 or newer

Enclose 'safeAreaInsets' in an @available check to silence this warning  「FIX」

 

「FIX」を押すとこうなる

if (@available(iOS 11.0, *)) {

        float safeAreaInsetLeft = [UnityGetGLView() safeAreaInsets].left;

        if (@available(iOS 11.0, *)) {

            float safeAreaInsetRight = [UnityGetGLView() safeAreaInsets].right;

 

 

 

 

@property (nonatomic,readonly) UIEdgeInsets safeAreaInsets API_AVAILABLE(ios(11.0),tvos(11.0));

1. 'safeAreaInsets' has been explicitly marked partial here

(1. 'safeAreaInsets'は明示的にここに部分的にマークされています)

 

float safeAreaInsetLeft = [UnityGetGLView() safeAreaInsets].left;

float safeAreaInsetRight = [UnityGetGLView() safeAreaInsets].right;

'safeAreaInsets' is only available on iOS 11.0 or newer

2. Enclose 'safeAreaInsets' in an @available check to silence this warning

(2.この警告を消すために「safeAreaInsets」を@availableチェックに入れてください)

 

float safeAreaInsetLeft = [UnityGetGLView() safeAreaInsets].left;

float safeAreaInsetRight = [UnityGetGLView() safeAreaInsets].right;

'safeAreaInsets' is only available on iOS 11.0 or newer

'safeAreaInsets' is only available on iOS 11.0 or newer

 

@property (nonatomic,readonly) UIEdgeInsets safeAreaInsets API_AVAILABLE(ios(11.0),tvos(11.0));

1. 'safeAreaInsets' has been explicitly marked partial here

(1. 'safeAreaInsets'は明示的にここに部分的にマークされています)

 

float safeAreaInsetLeft = [UnityGetGLView() safeAreaInsets].left;

'safeAreaInsets' is only available on iOS 11.0 or newer

 

float safeAreaInsetRight = [UnityGetGLView() safeAreaInsets].right;

'safeAreaInsets' is only available on iOS 11.0 or newer

2. Enclose 'safeAreaInsets' in an @available check to silence this warning

(2.この警告を消すために「safeAreaInsets」を@availableチェックに入れてください)

 

extern const int32_t* g_FieldOffsetTable[1887] =

'extern' variable has an initializer

('extern'変数に初期化子があります)

 

extern const Il2CppTypeDefinitionSizes* g_Il2CppTypeDefinitionSizesTable[1887]

'extern' variable has an initializer

 

 

extern Il2CppInteropData g_Il2CppInteropData[130] =

'extern' variable has an initializer

 

 

switch (adPosition)

Enumeration value 'kGADAdPositionCustom' not handled in switch

(列挙値 'kGADAdPositionCustom'がスイッチで処理されない)

1. Add missing switch cases

(1.不足しているスイッチケースを追加する)

 

DepreCations

[self.nativeCustomTemplateAd performClickOnAssetWithKey:key customClickHandler:clickHandler];

'performClickOnAssetWithKey:customClickHandler:' is deprecated: Use performClickOnAssetWithKey:.

('performClickOnAssetWithKey:customClickHandler:'は非推奨です:

performClickOnAssetWithKey:を使用してください。)

 

GAD_DEPRECATED_MSG_ATTRIBUTE("Use performClickOnAssetWithKey:.");

1. 'performClickOnAssetWithKey:customClickHandler:' has been explicitly marked deprecated here

(1. 'performClickOnAssetWithKey:customClickHandler:'はここでは非推奨と明示的にマークされています)

 

NSString *base64String = [imageData base64Encoding];

'base64Encoding' is deprecated: first deprecated in iOS 7.0 - Use base64EncodedStringWithOptions instead

('base64Encoding'は廃止されました:iOS 7.0では最初に非推奨です - 代わりにbase64EncodedStringWithOptionsを使用してください)

 

- (NSString *)base64Encoding API_DEPRECATED("Use base64EncodedStringWithOptions instead", macos(10.6,10.9), ios(4.0,7.0), watchos(2.0,2.0), tvos(9.0,9.0));

1. 'base64Encoding' has been explicitly marked deprecated here

(1. 'base64Encoding'はここでは非推奨と明示的にマークされています)

 

▼Code Sign Warining

Warning: unable to build chain to self-signed root for signer "iPhone Developer: ・・・・・・ (U・・・・・)"

 

▼Unity-iPhone project 1 issue

   Validate Project Settings

       Update to recommended settings

          Unity-iPhone.xcodeproj

クリックするとダイアログが表示されたので

f:id:marimoko3:20180419194033p:plain

「Perform Changes」をクリック。