Azure-Samples / active-directory-b2c-ios-swift-native-msal

An iOS sample in Swift that authenticates Azure AD B2C users and calls an API using OAuth 2.0
https://aka.ms/aadb2c
MIT License
46 stars 22 forks source link

Build fails on XCode 9.3 #7

Closed jonnyleigh closed 4 years ago

jonnyleigh commented 6 years ago

Build is failing on my environment.

Jonnys-Mac:ADALSample jonny$ git clone https://github.com/Azure-Samples/active-directory-b2c-ios-swift-native-msal.git
Cloning into 'active-directory-b2c-ios-swift-native-msal'...
remote: Counting objects: 145, done.
remote: Total 145 (delta 0), reused 0 (delta 0), pack-reused 145
Receiving objects: 100% (145/145), 36.00 KiB | 341.00 KiB/s, done.
Resolving deltas: 100% (80/80), done.
Jonnys-Mac:ADALSample jonny$ ls
active-directory-b2c-ios-swift-native-msal
Jonnys-Mac:ADALSample jonny$ cd active-directory-b2c-ios-swift-native-msal/
Jonnys-Mac:active-directory-b2c-ios-swift-native-msal jonny$ ls
Cartfile        LICENSE         MSALiOSB2C.xcodeproj
Cartfile.resolved   MSALiOSB2C      README.md
Jonnys-Mac:active-directory-b2c-ios-swift-native-msal jonny$ carthage update
*** Fetching microsoft-authentication-library-for-objc
*** Checking out microsoft-authentication-library-for-objc at "5d8590cbf8edbddcb052433ffd57a46b56b3b398"
*** xcodebuild output can be found in /var/folders/_5/fz2d2r154c5b3ms1_gfmz06r0000gp/T/carthage-xcodebuild.vFCjs4.log
*** Building scheme "MSAL (Mac Framework)" in MSAL.xcworkspace
*** Building scheme "MSAL (iOS Framework)" in MSAL.xcworkspace
Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -workspace /Users/jonny/Documents/ADALSample/active-directory-b2c-ios-swift-native-msal/Carthage/Checkouts/microsoft-authentication-library-for-objc/MSAL.xcworkspace -scheme MSAL\ (iOS\ Framework) -configuration Release -derivedDataPath /Users/jonny/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/microsoft-authentication-library-for-objc/5d8590cbf8edbddcb052433ffd57a46b56b3b398 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/_5/fz2d2r154c5b3ms1_gfmz06r0000gp/T/microsoft-authentication-library-for-objc SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/jonny/Documents/ADALSample/active-directory-b2c-ios-swift-native-msal/Carthage/Checkouts/microsoft-authentication-library-for-objc)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/_5/fz2d2r154c5b3ms1_gfmz06r0000gp/T/carthage-xcodebuild.vFCjs4.log

In that log file I find this:

/Users/jonny/Documents/ADALSample/active-directory-b2c-ios-swift-native-msal/Carthage/Checkouts/microsoft-authentication-library-for-objc/MSAL/src/MSALErrorConverter.m:104:154: error: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Werror,-Wformat]
            MSID_LOG_ERROR(nil, @"MSALErrorConverter could not find the error code mapping entry for domain (%@) + error code (%ld).", msidError.domain, msidError.code);
[carthage-xcodebuild.vFCjs4.log]

Full log file: (https://github.com/Azure-Samples/active-directory-b2c-ios-swift-native-msal/files/1939494/carthage-xcodebuild.vFCjs4.log)

Thanks.

wstierhout commented 6 years ago

+1 I've got the exact same error

parakhj commented 6 years ago

Seems like an issue with the MSAL library. https://github.com/AzureAD/microsoft-authentication-library-for-objc/issues/269

jonnyleigh commented 6 years ago

Ok, I managed to get the MSAL library to build by editing the Cartfile to point to the master branch rather than the dev branch.

Contents of Cartfile: github "AzureAD/microsoft-authentication-library-for-objc" "master"

I'll leave this here in case it's useful for someone else and also as an open bug as the instructions for this sample say to use the Dev branch. Someone at Microsoft should confirm and update the instructions.

kishorekankata commented 5 years ago

Still facing the issue.

Please help me if anyone have solution. Carthage build going to be failed always. Xcode version is 9.4.1

Here is the Error in the log file:

The following build commands failed: CompileC /Users/kishorekankata/Library/Caches/org.carthage.CarthageKit/DerivedData/9.2_9C40b/microsoft-authentication-library-for-objc/7294d2a9865da914338456366b642c009e9695fc/Build/Intermediates.noindex/ArchiveIntermediates/MSAL\ (iOS\ Framework)/IntermediateBuildFilesPath/IdentityCore.build/Release-iphoneos/IdentityCore\ iOS.build/Objects-normal/armv7/MSIDAuthenticationSession.o src/webview/systemWebview/ios/MSIDAuthenticationSession.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

jennyf19 commented 4 years ago

@kishorekankata I think @Jitenderios found a solution for carthage.

Closing this issue as outdated, but feel free to reopen.