Closed rbanker closed 5 years ago
This is a known issue with the current Xcode 11 betas: the ObjC headers for PhotoUI are broken.
This has been filed with Apple (but it never hurts to file duplicate feedback).
@chamons I just upgraded to xCode Version 11.0 (11A420a) - stable and it still happening. I've VS for mac 8.2.6 What could be the work around?
i updated my visual studio for mac & installed xcode new command line tools (xcode 11.0 (11A420a)) and now im getting the same error
Seeing same thing, using VS (for Windows) Enterprise latest version, just updated XCode to version 11A420a on my connected mac and am getting error on build saying expected identifier or '{' - same project was building fine yesterday without any changes.
@chamons are we able to downgrade the version of XCode to get it working again? Is this even possible on a Mac (forgive the ignorance I am not a Mac user)?
Hitting the same issue after updating XCode
Same exact issue after updating. Supposed to go to the app store tomorrow. Now I have to walk into a meeting and tell a boardroom we can't go to the store and marketing will have to be put on hold. What a nightmare choice I advocated for.
I am not using Xamarin but I was having this issue also. I was able solve the issue by instead of importing the whole framework I individually import the framework files like this
Found the same error after updating XCode to version 11 on windows with following Environment:
Microsoft Visual Studio Enterprise 2017 Version 15.9.13
Microsoft .NET Framework Version 4.7.03056
Mono Debugging for Visual Studio 4.13.12-pre (9bc9548) Support for debugging Mono processes with Visual Studio.
Xamarin 4.12.3.83 (d15-9@23fa80172) Xamarin Designer 4.16.30 (e0af99a34) Xamarin Templates 1.1.128 (6f5ebb2) Xamarin.Android SDK 9.1.7.0 (HEAD/ba9da7a76) Xamarin.iOS and Xamarin.Mac SDK 12.4.0.64 (9c8d8e0)
Is there any work around for this ? After updating the Xcode couldn't compile the iOS project
this is error I see in the logs:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h:17:47: error: expected identifier or '{' typedef NS_ENUM(NSInteger, UIImageOrientation);
/Users/devteam/Library/Caches/Xamarin/mtbs/builds/StarRezHousing.iOS/48a6c01cf675903a515a245655ee573f/obj/iPhone/Debug/mtouch-cache/registrar.h:43:9: fatal error: 'WatchKit/WatchKit.h' file not found
Our current stable version of Xamarin.iOS is not compatible with Xcode 11.
We'll release a version of Xamarin.iOS that is compatible with Xcode 11 later today. A more immediate solution is to install our preview version of Xamarin.iOS with support for Xcode 11.
@rolfbjarne I tried installing the preview version but it still gives the same error. Just thought I let you know: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h(47,47): Error GEA45E82A: expected identifier or '{' (GEA45E82A)
Visual Studio Community 2019 for Mac (Preview) Version 8.3 Preview (8.3 build 1760) Installation UUID: 8a28987a-1e72-4b4e-ae4d-21612ffbdc71 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)
Package version: 604000194
Mono Framework MDK Runtime: Mono 6.4.0.194 (2019-06/7da9a041b3b) (64-bit) Package version: 604000194
NuGet Version: 5.3.0.6192
.NET Core SDK SDK: /usr/local/share/dotnet/sdk/3.0.100-rc1-014190/Sdks SDK Versions: 3.0.100-rc1-014190 2.2.402 2.1.701 2.1.700 2.1.505 2.1.504 2.1.302 2.1.4 2.0.0 1.0.4 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks
.NET Core Runtime Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 3.0.0-rc1-19456-20 2.2.7 2.1.12 2.1.11 2.1.9 2.1.8 2.1.2 2.0.5 2.0.0 1.1.2 1.0.5
Xamarin.Profiler Version: 1.6.12.26 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Updater Version: 11
Apple Developer Tools Xcode 11.0 (14936) Build 11A420a
Xamarin.Mac Version: 5.16.1.24 (Visual Studio Community) Hash: 08809f5b Branch: d16-3 Build date: 2019-09-06 08:42:41-0400
Xamarin.iOS Version: 12.16.1.24 (Visual Studio Community) Hash: 08809f5b Branch: d16-3 Build date: 2019-09-06 08:42:42-0400
Xamarin Designer Version: 16.3.0.180 Hash: 54a02e2c9 Branch: remotes/origin/d16-3 Build date: 2019-09-12 15:35:22 UTC
Xamarin.Android Version: 10.0.0.43 (Visual Studio Community) Commit: xamarin-android/d16-3/8af1ca8 Android SDK: /Users/developer/Library/Developer/Xamarin/android-sdk-mac_x86 Supported Android versions: 7.1 (API level 25) 8.0 (API level 26) 8.1 (API level 27)
SDK Tools Version: 26.1.1 SDK Platform Tools Version: 29.0.1 SDK Build Tools Version: 27.0.2
Build Information: Mono: mono/mono/2019-06@7af64d1ebe9 Java.Interop: xamarin/java.interop/d16-3@5836f58 LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94 LibZip: nih-at/libzip/rel-1-5-1@b95cf3f ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.27.1@8212a2d Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
Microsoft Mobile OpenJDK Java SDK: /Users/developer/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL
Android SDK Manager Version: 1.4.0.65 Hash: c33b107 Branch: remotes/origin/d16-3 Build date: 2019-09-13 13:06:32 UTC
Android Device Manager Version: 1.2.0.113 Hash: 2f86c05 Branch: remotes/origin/d16-3~1 Build date: 2019-09-13 13:06:52 UTC
Xamarin Inspector Version: 1.4.3 Hash: db27525 Branch: 1.4-release Build date: Mon, 09 Jul 2018 21:20:18 GMT Client compatibility: 1
Build Information Release ID: 803001760 Git revision: 02f4f2e58b5aebe14e078aeff0fbad1abc9c7ae7 Build date: 2019-09-17 11:52:55+00 Build branch: release-8.3 Xamarin extensions: 8f75f12867e7d20d8ca78ea5e136a6ed7dde5dd2
Operating System Mac OS X 10.14.6 Darwin 18.7.0 Darwin Kernel Version 18.7.0 Tue Aug 20 16:57:14 PDT 2019 root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
Enabled user installed extensions DeepClean 1.2.5 LiveXAML 1.3.51 FileNesting 0.1.2 XAML Styler 1.1.5
The preview from the Xcode11 Preview channel.... @jtorvald
https://devblogs.microsoft.com/xamarin/ios-13-xcode-11/
TLDR:
To get started:
* Download and install the Xcode 11 beta from the Apple Developer Portal.
* In Visual Studio for Mac, select Visual Studio > Check for Updates, select the Xcode 11 Previews channel, and install the available updates.
* In Visual Studio for Mac, select Visual Studio > Preferences > Projects > SDK Locations > Apple and select Xcode-beta.app.
* (Optional – Visual Studio 2019 only) Download and install the Xcode 11 preview support VSIX.
You obv don't neet the Xcode beta
part of the instructions anymore.
The preview from the Xcode11 Preview channel.... @jtorvald
@diegostamigni Yeah I tried that but there is no XCode available at the Apple Developer Portal under 'beta'. Only under release: 11A420a (20 sept) which I've installed.
@jtorvald That's why I said:
You obv don't neet the Xcode beta part of the instructions anymore.
Just switch to Xcode 11 Preview channel on VS for Mac on the update window and you are all set for now, as @rolfbjarne already mentioned.
@diegostamigni with that you mean to use the Preview channel in Visual Studio Update right? That is what I did after reading this thread and that's why I comment that it is still failing... See my device info above. Or am I missing something here?
@diegostamigni with that you mean to use the Preview channel in Visual Studio Update right? That is what I did after reading this thread and that's why I comment that it is still failing... See my device info above. Or am I missing something here?
@jtorvald from the Preview dropdown menu in the top left corner you should see Xcode 11 Preview...
@jtorvald from the Preview dropdown menu in the top left corner you should see Xcode 11 Preview...
@diegostamigni Where exactly do you mean? Can you make a screenshot? Here in Visual Studio Update behind "Update Channel"? I only have two options there: Stable and Preview
This is what I have there @jtorvald
@diegostamigni that is why I'm so confused. I don't have it :-) Any idea on how to get the iOS Preview channel? (including @rolfbjarne here) Seems like there are more people not having that one in the dropdown.
When is the Xcode fix expected to happen?
VS 8.2..6.73: https://download.visualstudio.microsoft.com/download/pr/efc93fa3-2343-47e6-b3df-94fd5765e3c0/65a2af5d44914d492d1abd561bff47d8/visualstudioformac-8.2.6.73.dmg Xamarin.iOS 13.0.0.19: https://download.visualstudio.microsoft.com/download/pr/2efa7250-657f-4200-b057-bc0b24ef6fe2/81f38419ac0259235b8d0be65358168e/xamarin.ios-13.0.0.19.pkg
I'm the dude that originally reported the issue... To get around it at the time, I patched the SDK. Admittedly, it didn't leave me with a good feeling, but at least I had a compiling and running build...
Get yourself down into the SDK:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers
PHImageManager.h Line 17 is the offender:
typedef NS_ENUM(NSInteger, UIImageOrientation);
I just changed it to:
typedef NS_ENUM(NSInteger, UIImageOrientation){};
Yeah, so it's an empty enum, but not much other choice when we don't know what the values are supposed to be.
Hello @rbanker can you post where you fixed the class and compiled it?
@joellegh he did post where the class was. You don't need to compile anything. Just need file change permissions.
@joellegh @UKDeveloper99 is right -- you don't need to recompile anything but your application and PHImageManager.h is the header file for the PHImageManager class. I didn't need to change any permissions, but that just might be my setup.
Thank you @rbanker and @UKDeveloper99 It worked!
@rbanker - hi, I am not able to edit file, it says
You don’t have permission to write to the folder that the file “PHImageManager.h” is in.
How to move forward?
@rohit-hike sudo vi /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/HeadersPHImageManager.h
You might try editing as super user at the command-line with sudo vi /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h
@rbanker thanks. That solution was 100x faster than finding the XCode preview channel ;-)
@jtorvald I’m a lazy, impatient man 😂
Switching to "Xcode 11 previews" channel did the trick for me. Thanks!
Getting "Error installing application" error when updating with "Xcode 11 previews" Got around the issue by manually installing XCode Command line https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11/Command_Line_Tools_for_Xcode_11.dmg
By all means, if there's an official route from Microsoft, go that route. My approach (https://github.com/xamarin/xamarin-macios/issues/6716#issuecomment-534034433) was a hack to get something to the QA folks. @rolfbjarne mentions on another thread (https://github.com/xamarin/xamarin-macios/issues/6471#issuecomment-533968244) that they're releasing a Xcode 11-compliant Xamarin.iOS later today. Go that route if you can.
Reported on 5th August, How did this slip through the net!
thanks @rbanker
This is bad. I also have to release apps now. I can not build it?! I have tried @rbanker genius trick which seemed to work. But there are other errors like the original. What to do? I have tried all channels. None of then are working for me. I guess I have to be patient....?
Downgrading to xcode 10.3 through app store fixed problem for now.
Downgrading xCode10.3 solved the problem as of now.
Hi. Ok. Downgrading is the the right thing to do for now. So by downgrade you mean uninstall it and log into app developer and get the version 10.3 ? right...?
You can have multiple Xcode's side by side, it just matters what one is selected in Visual Studio and xcode-select.
So you could rename Xcode.app to Xcode11.app and install 10.3 in Xcode.app for example.
The fix came out very fast I would say. Updating the VS and switching back to XCode11 also reverting the fix from @rbanker made it work. The XCode10.3 xcode-select did also work. Great work ! 👍
last night I was having the same issue but after updating visual studio to the latest version (8.3 visual studio for mac). finally, I can build. thanks
Updating VS 2019 (windows) does fix the issue with Xcode. Thanks
First Update the VS 2019 (windows) installer if you are updating with the old one that you have in your local then Update the VS by that only the issue with Xcode will be fixed. if the updater is not updated you won't be able to see this update.
Ok this pretty much killed me. But best way on Xcode is to just delete the whole line.
typedef NS_ENUM(NSInteger, UIImageOrientation);
Use terminal to edit:
sudo nano /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h
UIImageOrientation is originally defined in UIKit/UIImage.h. Not sure how it ended up in PHImageManager.h....
Best way to fix this: 1) import UIKit/UIImage.h 2) comment out this line: typedef NS_ENUM(NSInteger, UIImageOrientation);
The edit needs to be done in the terminal with: sudo nano /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h
I had the same problem and the solution proposed by @rbanker worked. But I'm also receiving another error when trying to build my Xamarin app in Visual Studio 2019:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(804,3): error GB12A9FDE: "Photos requires C++11 or later".
Could these problems be related? Is anyone receiving the same problem?
I am on Visual Studio 2017 and it seems that the issue is not fixed here. VS2017 still points to an older version of mono and xamarin annoyingly. Does this mean VS2017 is no longer supported?
Yes - if you want to use the newest Xcode versions you need to upgrade to VS 2019.
Sorry for any confusion.
@mateuswolkmer Did you manage to solve the issue "Photos requires C++11 or later"?
Steps to Reproduce
Expected Behavior
Applications complete compilation as they do under released versions of Xcode and VS2019
Actual Behavior
Receive the following errors: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h(47,47): Error GEA45E82A: expected identifier or '{' (GEA45E82A) (VTrack.iOS.Framework)
/Users/jenk.svc/macos-build-beta-vm/workspace/iOS Betas/vTrackNG iOS Beta/VTrack/VTrack.iOS/MTOUCH: Error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new (MT4109) (VTrack.iOS.Framework)
Environment
Build Logs
Build Log
Example Project (If Possible)