UAUnityPlugin.h looking for UAirship.h which no longer exists (Unity plugin 9.0.0)

Inside Unity plugin version 9.0.0, \Plugins\iOS\UAUnityPlugin.h, on line 4:

#if __has_include("UAirship.h")

The line is the same in version 8.1.0

However, the file UAirship.h no longer exists in the ios cocapod or ios library as of ios plugin version 16 (unity version 8 used ios plugin version 14, where UAirship.h existed)

As a result, the preprocessor falls in the #else clause:

@import AirshipKit

which fails if modules are disabled, which appears to be the case in our app.

 

What are the proper include files to check against, and to include?

Here's the content of UAUnityPlugin.h at the beginning as of 9.0.0 . I suppose some #import statements may have to be changed there as well?

Thanks in advance.

#if __has_include("UAirship.h")
#import "UAirship.h"
#import "UAMessageCenter.h"
#import "UAPush.h"
#import "UAInboxMessage.h"
#import "UAAnalytics.h"
#import "UAInboxMessageList.h"
#import "UAInAppAutomation.h"
#import "UADefaultMessageCenterUI.h"
#import "UAAssociatedIdentifiers.h"
#else
@import AirshipKit;
#endif

Didn't find what you were looking for?

New post

Comments

4 comments

  • Hello, I am a colleague of aboulianne, we still haven't resolved this issue.

    Do you have any updates for this issue?

    Thanks.

    Danny

    Comment actions Permalink
    0
  • Hello,

    This is Eric from Airship Group Technical Support. I've been trying to repro your issue but haven't had any luck. Can you let me know a bit more about your environment?

    • Are you on windows or mac? What version?
    • What version # of Unity are you using?
    • When building your project in Unity to you get any cocoapod errors?

    To me it sounds like you have mismatched SDKs, if you navigate to your iOS project while in the terminal and run pod update does this resolve your issue?

    Thank you,

    Eric L.
    Technical Support Engineer
    Airship Group | Apptimize | Portland

    Comment actions Permalink
    0
  • Hello Eric,

    In order to better diagnose the issue, I set up a basic Unity app to reproduce just that issue. I get the same behaviour with the following:

    On Mac (Big Sur, 11.6.1), using Unity 2020.3.13f1 and Xcode 13.0,

    I created an empty 3D project in Unity, switched to iOS, selected Development Build.

    Imported urbanairship-9.0.0.unitypackage into Assets,

    Dragged Scripts\UrbanAirshipBehaviour onto MainCamera (mostly to avoid airship being stripped, but that step might not be necessary).

    In Project Settings, Player, selected .NET runtime 4.x

    Build game.

    In the output folder, edited Podfile as follows:

    source 'https://github.com/CocoaPods/Specs.git'
    source 'https://github.com/CocoaPods/Specs'
    platform :ios, '11.0'

    target 'UnityFramework' do
    pod 'Airship/Automation', '16.1.1'
    pod 'Airship/Core', '16.1.1'
    pod 'Airship/ExtendedActions', '16.1.1'
    pod 'Airship/MessageCenter', '16.1.1'
    pod 'Airship/PreferenceCenter', '16.1.1'
    end
    target 'Unity-iPhone' do
    end
    use_frameworks!

    ran pod install

    opened the resulting .xcworkspace

    Built.

    At the end of the build process, several compile errors appear in airship files, notably this one:

    "use of '@import' when modules are disabled" at UAUnityPlugin.h : 15

    If needed, I can include the sample.

     

    As highlighted, the #if clause inside UAUnityPlugin.h has no chance of success ince the file UAirship.h no longer exists in the 16.1.1 pods.

    Comment actions Permalink
    0
  • Hello,

    Looks like you were not the only team to run across this issue. Our engineering team is looking into deploying a fix for the problem.

    If you would like to fix it with a workaround, you will need to modify the UAUnityPlugin.m file by renaming these methods: 

    • UAUnityPlugin_isEnabled(const char *features) rename it to UAUnityPlugin_isFeatureEnabled(const char *features)
    • UAUnityPlugin_isAnyEnabled() rename it to UAUnityPlugin_isAnyFeatureEnabled()

    Thank you

    Eric

    Comment actions Permalink
    1

Please sign in to leave a comment.