Rate us with your valuable rating. Your rating helps us in doing constant updates and support the product :)

New Apple review system is under development!

Unity 5.6 compile errors in Xcode

CliffCawley
Hi, I'm trying to submit my app to the store but having issues compiling in Xcode:

Implicit declaration of function 'ConvertToNSString' is invalid in C99 CPNPCloudServicesBinding.m.
Implicit delcation of function 'FromJson' is invalid in C99 CPNPCloudServicesBinding.m
Implicit delcation of function 'CStringcopy' is invalid in C99 CPNPCloudServicesBinding.m
Implicit delcation of function 'ToJsonCString' is invalid in C99 CPNPCloudServicesBinding.m
Implicit delcation of function 'NotifyEventListener' is invalid in C99 CPNPCloudServicesBinding.m

Please help!!

Comments

  • Vain
    edited April 1
    I got next in XCode
    Use of undeclared identifier 'kNativePluginsErrorDomain'
  • tedflb
    Did anyone manage to fix this? I need to push an update soon! Thanks.
  • mariobarreiro
    mariobarreiro
    Same issue here as said by CliffCawley
  • mariobarreiro
    mariobarreiro
    In our case with BillingBinding
  • ashwin
    edited April 4
    Sorry for the inconvenience caused.

    We will look into this issue and find a solution at the earliest possible.

    Thanks
    Ashwin
  • Goragoth
    I'm also getting failure to compile for iOS with Untity 5.6 (Android seems fine).

    Getting this error:
    NativePlugins-Common/Common/Source/Binding/Etcetera/EtceteraBinding.m:14:23: error: use of undeclared identifier 'Utility'
  • rself
    edited April 7
    Hey all,

    I had the same iOS build issues, undeclared identifier 'Utility', Implicit declaration of function 'CStringcopy' is invalid, etc. DISCLAIMER: I don't know what repercussions the following changes might have to your project, but the changes below allowed my project to build.

    It seems like for whatever reason, a lot of the ".m" files are missing imports (aka `#import`), specifically for importing "Utility.h" and "Defines.h". Some files need one, some the other, some both, but after I added the appropriate imports (like `#import "Utility.h"`) my project built fine.

    To figure out which import file was needed, I just looked in the [project]/unityiosbuild/Plugins/NativePlugins-Common/Common/Source/Misc/Utility/Utility.h file to see what methods/variables were listed in that file, and then if the error dealt with one of the methods/variables in that file, I added an import line for that file.

    Example:
    1) In 'EtceteraBinding.m', ERROR Implicit declaration of function 'CStringCopy' is invalid in C99
    2) Look in [project]/unityiosbuild/Plugins/NativePlugins-Common/Common/Source/Misc/Utility/Utility.h file
    3) Found method 'CStringCopy'
    4) Added `#import "Utility.h"` to top of 'EtceteraBinding.m' (NOTE: Make sure you edit the `EtceteraBinding.m` file in `[project]/Assets/Standard Assets/VoxelBusters/NativePlugins/Plugins/NativeIOSCode/...` and not the `.m` file XCode references, as that file will be overwritten with each build)
    5) Move on to the next error and repeat steps 1-4

    I realize this is definitely not ideal, and quite the work around as I believe each time I re-build in Unity it will undo what I added(EDIT: as long as you change the files in `[project]/Assets/Standard Assets/VoxelBusters/NativePlugins/Plugins/NativeIOSCode/...` you shouldn't have to re-edit after every build). But it is building for now, so I thought I'd pass it along to some folks who are stuck.
  • ashwin
    Hi guys,

    Sorry for taking time to get back to you.

    Good news is that we were able to replicate the issue and find a fix. For quick distribution, we have uploaded the solution in google drive and you can download it from this link. Once downloaded, go back to your project and replace the existing file with this new copy. Thats it. Now in order to test the solution, export iOS build and compile it.

    Let me know if it solved your problem.

    Thank you
    Ashwin
  • mariobarreiro
    mariobarreiro
    Thank you Ashwin, it works perfectly.

    Best
    Mario
  • ashwin
    Great! Thanks for the update :)
  • CliffCawley
    edited April 19
    I had to revert back to Unity 5.5 but as soon as I upgrade to 5.6 again, I will try again

    By the way, released my game! Medieval Miner :)
  • Vain
    ashwin, it worked for me too
  • ashwin
    Cool. Thanks @Vain
  • Hyungseok
    Thanks! It works!

    I added

    #import "Defines.h"

    instead of #import "Utility.h"

  • apollych
    apollych
    edited April 26
    The same errors in Unity 5.5.3p4
    undeclared identifier 'Utility', ConvertToNSString and so on.
    Tried to change PostProcessing file from the link, but this didnt help

    There are too many bugs in this plugin. Lost money for the Pro version!
    I have another two questions in this forum with no answers at all. Very bad support!
  • yoambulante
    Hi, I managed to get my iOS project compiled using Unity 5.6.0f3 (Xcode 8.3.2)... however it shows some error despite the app builds and runs on my iPhone, it says:

    CopyPNGFile ..../Library/Developer/Xcode/DerivedData/Unity-iPhone-bupsgrwamwshtqhhyxqdgwwvcxjz/Build/Products/ReleaseForRunning-iphoneos/.../tw__share_email_header.png Libraries/Plugins/Android/twitter_lib/res/drawable-xhdpi-v4/tw__share_email_header.png

    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/usr/bin/copypng -compress -strip-PNG-text /..../Libraries/Plugins/Android/twitter_lib/res/drawable-xhdpi-v4/tw__share_email_header.png
    /..../tw__share_email_header.png


    While reading ...../Libraries/Plugins/Android/twitter_lib/res/drawable-xhdpi-v4/tw__share_email_header.png pngcrush caught libpng error:
    \361\2468\240\361\246Z\\241\250E\374\277\343\\241\374\256\361\246\370\245\361\246\371

    Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure
  • CalvinJG
    same here : undeclared identifier 'Utility'
  • ashwin
    edited May 17
    @yoambulante for some reason your Android specific images are getting included in xcode project. Please ensure that those references are not added in exported project.

    You can do this by making sure the android library folders are not selected to "Any Platform" but only to "Android" platform in the inspector. This should be an issue related to unity while upgrading. That will solve your issue.

    @CalvinJG Did you try the solution provided above?
  • CalvinJG
    @ashwin the solution above is work fine for me. Thank you so much !
  • roman_i
    Not working here... Unity 5.6.1p1. Tried your PostProcessBuild file changes but still got
    undeclared identifier 'Utility'
    error
  • NavtekTest
    In IOS ,Previously we compiled it on 5.3.5 and everything worked fine, recently we upgraded to 5.6.2 and i am getting this error.
    - (void)onBuyProductFailed:(NSString *)errorMessage
    {
    NSError *error = [NSError errorWithDomain:kNativePluginsErrorDomain
    code:0
    userInfo:@{
    NSLocalizedDescriptionKey : errorMessage
    }];

    [self notifyUnityAboutTransactionEvent:kPurchaseTransactionFinishedEvent withTransactions:NULL error:error];
    }
    any help will be appreciated.

    image
  • ashwin
    Did you try the solution mentioned in this page?
  • zlip
    Check your Prefix.pch file. In my case I changed this:
    #ifdef __OBJC__	#import "Defines.h"

    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #endif
    with this:
    #ifdef __OBJC__
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import "Defines.h"
    #endif
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Twitter

Discussions

© Copyright 2016 - Voxel Busters Interactive LLP | Powered by Vanilla
All times are UTC