yasirkula / UnityIonicIntegration

A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
104 stars 32 forks source link

Semantic issues (UnityAppController.h) with latest version #35

Closed ShaliniShanmugam7 closed 5 years ago

ShaliniShanmugam7 commented 6 years ago

I am trying to integrate mapbox unity project with ionic ios project.I followed all the iOS steps and ended up with this lexical or preprocessor issue.

Unity version 2018.2.3f1 mapbox https://www.mapbox.com

yasirkula commented 6 years ago

First, try integrating an empty Unity project with Ionic. If it works, then try applying this solution to your original project (basically, we are trying to see if the issue is related to Mapbox): https://github.com/yasirkula/UnityIonicIntegration/issues/27

ShaliniShanmugam7 commented 6 years ago

i created new unity project and tried to integrate in ionic project using the steps. Now i am facing semantic issues, parse issues in UnityAppController.h, DisplayManager.h files

Attached the screenshot. please help to fix this. I am using all latest package version node v8.11.3, cordova cli version is 6.5.0, ionic version 4.0.6, mapbox package version 1.4.4, unity 2018.2.3f1, xCode 9.4.1

semantic issues
ShaliniShanmugam7 commented 6 years ago

Set the Base SDK to 11.4 - not cleared all issues

yakmyakmyakm commented 6 years ago

Set the Base SDK to 11.4 -cleared all the issues

Where did you set the Base SDK?

ShaliniShanmugam7 commented 6 years ago

Under the Build Settings in xCode. But still the issues are there. only once it cleared. I downgraded the unity 2018 to unity 2017. Still am getting plenty of semantic issues. Please help.

yasirkula commented 5 years ago

If Prefix.pch inside the Unity group doesn't have #import <UIKit/UIKit.h> and/or #import <Foundation/Foundation.h> in-between #ifdef __OBJC__ and #endif lines, try adding them.

ShaliniShanmugam7 commented 5 years ago

Its already present in Prefix.pch. still not able to clear the issues

yasirkula commented 5 years ago

Try adding #import <UIKit/UIKit.h> to UnityAppController.h manually.

ShaliniShanmugam7 commented 5 years ago

Thanks @yasirkula . After fixing this i am getting similar semantic issues in UnityAppController+UnityInterface file

error
ShaliniShanmugam7 commented 5 years ago

I fixed it by setting prefix header path in build settings[prefix header path was blank]. But i feel this is not a right fix? @yasirkula let me know your thoughts

Referred - https://github.com/yasirkula/UnityIonicIntegration/issues/12

yasirkula commented 5 years ago

This is the correct fix. I will add instructions for when the prefix header path is blank to the README: https://github.com/yasirkula/UnityIonicIntegration/issues/12#issuecomment-389437474

P.S. Done! https://github.com/yasirkula/UnityIonicIntegration/commit/83128ea436ae1f79ebce76d7d33568240b664ac4

ShaliniShanmugam7 commented 5 years ago

All the semantic issues are gone. Now am handling library file clang error.

clang: error: no such file or directory: 'lMapboxMobileEventsStatic'

yasirkula commented 5 years ago

Probably Mapbox requires some additional directories in Unity group in Xcode. You can try opening the Unity project alone in Xcode and compare its project hierarchy with the Unity group in Ionic integrated Xcode project.

ShaliniShanmugam7 commented 5 years ago

All looks same. but not able to clear this clang error

yasirkula commented 5 years ago

How about Header Search Paths and/or Library Search Paths in Build Settings? Are there any additional paths in Unity Xcode project?

ShaliniShanmugam7 commented 5 years ago

checked and added the additional paths like mapbox. now got this below error Undefined symbols for architecture arm64: somewhere its missing the linking.

apple error
ShaliniShanmugam7 commented 5 years ago

Solution to clear all the semantic issues - Add all required frameworks (i compared with unity ios project) under General - linked frameworks and libraries. Redo the integration ios steps. App is working.

add the key and value in Info.plist

Key : Privacy - Camera Usage Description
Value : $(PRODUCT_NAME) camera use

Key : Privacy - Location When In Use Usage Description Value : $(PRODUCT_NAME) location use