xcodebuild error: action 'archive' is not implemented - ios

xcodebuild archive -archivePath ${archive_path} -workspace ${workspace_path} -scheme ${scheme} -configuration ${configuration} -sdk iphoneos
warning: unhandled ProductType key IsUnitTest
warning: unhandled ProductType key IsUITest
warning: unhandled ProductType key IsUnitTest
warning: unhandled ProductType key IsUnitTest
warning: unhandled ProductType key IsUITest
warning: unhandled ProductType key IsUnitTest
error: cannot find base BuildSystem specification 'embedded-shared:com.apple.buildsettings.standard'
error: cannot find base ProductType specification 'embedded-shared:com.apple.product-type.framework'
error: cannot find base ProductType specification 'embedded-shared:com.apple.product-type.xpc-service'
error: cannot find base ProductType specification 'embedded:com.apple.product-type.pluginkit-plugin'
error: cannot find base BuildSystem specification 'embedded:com.apple.build-system.core'
error: cannot find base BuildSystem specification 'embedded:com.apple.build-system.native'
error: cannot find base Linker specification 'embedded:com.apple.pbx.linkers.ld'
error: cannot find base ProductType specification 'embedded-simulator:com.apple.product-type.pluginkit-plugin'
error: action 'archive' is not implemented
warning: export archive not implemented
E, [2017-04-12T17:52:04.100088 #11625] ERROR -- : File does not exist

Related

React Native Firebase Cloud Messaging throwing errors on build for RN 0.63.4

I followed the instructions for iOS from here but the compilation is showing these errors. I'm guessing it's some sort of version incompatibility, but I believe I'm on the latest version of react-native-firebase. When I build the app, these errors show up:
❌ /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m:91:51: expected a type
- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage {
^
❌ /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m:99:28: expected a type
didReceiveMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage {
^
❌ /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m:278:50: expected a type
- (NSDictionary*)parseFIRMessagingRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
^
❌ /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m:44:30: property 'shouldEstablishDirectChannel' not found on object of type 'FIRMessaging *'
[FIRMessaging messaging].shouldEstablishDirectChannel = YES;
^
❌ /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m:223:31: no visible #interface for 'FIRMessaging' declares the selector 'sendMessage:to:withMessageID:timeToLive:'
[[FIRMessaging messaging] sendMessage:data to:to withMessageID:messageId timeToLive:[ttl intValue]];
^
❌ /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m:279:43: property 'appData' not found on object of type '__strong id'
NSDictionary *appData = remoteMessage.appData;
~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And the build failed:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening trustline.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace myapp.xcworkspace -configuration Debug -scheme myapp -destination id=2811E5D0-88A1-490E-AB1C-2F192015AFB2
...
** BUILD FAILED **
The following build commands failed:
CompileC /Users/matt/Library/Developer/Xcode/DerivedData/myapp-gpcpfeonrmwlebbsoklspvmumvzd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseFirestore.o /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/firestore/RNFirebaseFirestore.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/matt/Library/Developer/Xcode/DerivedData/myapp-gpcpfeonrmwlebbsoklspvmumvzd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/x86_64/RNFirebaseMessaging.o /Users/matt/Desktop/myapp/node_modules/react-native-firebase/ios/RNFirebase/messaging/RNFirebaseMessaging.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
In my package.json:
...
"react-native-firebase": "^5.6.0",
"#react-native-firebase/app": "^10.8.1",
"#react-native-firebase/firestore": "^10.8.1",
"#react-native-firebase/messaging": "^10.8.1",
...
How can I fix it?
This seems to be the problem.
From https://www.npmjs.com/package/react-native-firebase
⚠ The Hermes VM availble with react-native 0.60.3 and higher is not currectly supported. Some initial testing has been done and it appears that valid code in this library does not function correctly with Hermes.
I removed this package and it worked, as it seems to be separate from #react-native-firebase/ scoped packages.

xcodebuild: error: Failed to build workspace on CI

I got the error on CI:
Error: Command failed: cd ./ios && RCT_NO_LAUNCH_PACKAGER=true xcodebuild build build-for-testing
-scheme "MyReactModule-Unit-MyReactModuleTests"
-workspace MyReactModule.xcworkspace
-sdk iphonesimulator
-configuration Debug
-derivedDataPath ./DerivedData/MyReactModule
-quiet
-UseModernBuildSystem=NO ONLY_ACTIVE_ARCH=YES
Additional logs:
xcodebuild: error: Failed to build workspace MyReactModule with scheme MyReactModule-Unit-MyReactModuleTests.
Reason: The scheme 'MyReactModule-Unit-MyReactModuleTests (MyReactModule Workspace)' is not configured for Running.
How to fix it?

CompileSwift normal arm64 when using `xcodebuild` to archive

Issue: getting the following error in terminal when archiving
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
Steps to reproduce:
xcodebuild -workspace playmule.xcworkspace -scheme playmule -sdk iphoneos -archivePath ~/Desktop/playmule.xcarchive -configuration playmule archive
The following are a bunch of lines before ** ARCHIVE FAILED ** : (see below)
/Users/ss/Desktop/playmule-ios/playmule/Utility/NetworkManager.swift:174:25: error: type 'Constants.Api' has no member 'BaseUrl'; did you mean 'resetUrl'?
let urlString = Constants.Api.BaseUrl + Constants.Api.currentVersion + Constants.Api.resendSMSEndpoint
^~~~~~~~~~~~~ ~~~~~~~
resetUrl
This same error is repeated for the same static variable.
The variable is confirmed to be present in the struct as below:
struct Constants {
struct Api {
static let BaseUrl = "https://some-valid-url.com/dev/"
}
}
EDIT: I am able to run this project on a device and a simulator. So the issue is unrelated to code semantics
I made a small tweak to my xcodebuild command with -parallelizeTargets to resolve build errors for projects with frameworks/linked dependency targets:
xcodebuild -workspace playmule.xcworkspace -scheme playmule -sdk iphoneos -archivePath ~/Desktop/playmule.xcarchive -parallelizeTargets archive
Note that the above flag also helps compile other actions with xcodebuild such as build or docbuild.

Errors adding dependencies with Carthage: "Unsupported architecture"

I am pretty new using Carthage. I am using as dependency manager for my iOS app. I am trying to add RXSwift and SwiftEventBus. So this is my Cartfile:
github "cesarferreira/SwiftEventBus" == 1.1.0
github "ReactiveX/RxSwift" ~> 2.0
Running the update command, I got these errors and I don't really understand where is the problem.
*** Cloning RxSwift
*** Cloning SwiftEventBus
*** Checking out RxSwift at "2.2.0"
*** Checking out SwiftEventBus at "1.1.0"
*** xcodebuild output can be found in /var/folders/7n/94jxf5bj7zx9qblwljn64s080000gn/T/carthage-xcodebuild.dIWeah.log
*** Building scheme "RxTests-OSX" in Rx.xcworkspace
*** Building scheme "RxBlocking-tvOS" in Rx.xcworkspace
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
ld: warning: linking against dylib not safe for use in application extensions: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
ld: warning: linking against dylib not safe for use in application extensions: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftXCTest.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/cdefs.h:707:2: error: Unsupported architecture
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'; did you mean 'uint64_t'?
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types/_intptr_t.h:30:9: error: unknown type name '__darwin_intptr_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/_types.h:42:9: error: unknown type name '__uint32_t'
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/usr/include/sys/_types/_size_t.h:30:9: error: unknown type name '__darwin_size_t'; did you mean '__darwin_ino_t'?
<unknown>:0: error: too many errors emitted, stopping now
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11:10: error: could not build module 'Darwin'
<unknown>:0: error: could not build Objective-C module 'CoreFoundation'
A shell task failed with exit code 65:
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)

unable to compile ffmpeg for iOS

I'm trying to compile FFmpeg for iOS (for iPhone5, in order to do some RSTP streaming stuff) following the tutorial here but I get stuck with this error :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
In my config.log file I have this :
BEGIN /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.D3a73otQ.c
1 int main(void){ return 0; }
END /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.D3a73otQ.c
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -arch armv7 -mfpu=neon -miphoneos-version-min=6.0 -mcpu=cortex-a9 -c -o /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.Wv4eZtHX.o /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.D3a73otQ.c
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -miphoneos-version-min=6.0 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -o /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.y84bbrJt /var/folders/9g/zv_vdz7x16g1hgx9pqj57zz80000gn/T//ffconf.Wv4eZtHX.o
ld: library not found for -lcrt1.3.1.o
collect2: ld returned 1 exit status
C compiler test failed.
I have other errors with other scripts found on stackoverflow or with google
Any idea ?
Ok (i'm kinda new on mac environment), I managed to pass the configure step by fixing the sdk target to the last sdk I have (6.1), removing Other Linker Flags but then the "make" command is full of errors (either with gcc or arm-apple-darwin10-gcc-4.2) :
In file included from ./libavutil/internal.h:113,
from ./libavutil/common.h:385,
from ./libavutil/avutil.h:238,
from libavdevice/version.h:28,
from libavdevice/avdevice.h:22,
from libavdevice/alldevices.c:22:
./libavutil/libm.h:53: error: static declaration of ‘cbrt’ follows non-static declaration
./libavutil/libm.h:60: error: static declaration of ‘cbrtf’ follows non-static declaration
./libavutil/libm.h:86: error: expected identifier or ‘(’ before ‘sizeof’
./libavutil/libm.h:96: error: expected identifier or ‘(’ before ‘sizeof’
./libavutil/libm.h:142: error: static declaration of ‘rint’ follows non-static declaration
./libavutil/libm.h:149: error: static declaration of ‘lrint’ follows non-static declaration
./libavutil/libm.h:156: error: static declaration of ‘lrintf’ follows non-static declaration
./libavutil/libm.h:163: error: static declaration of ‘round’ follows non-static declaration
./libavutil/libm.h:170: error: static declaration of ‘roundf’ follows non-static declaration
./libavutil/libm.h:177: error: static declaration of ‘trunc’ follows non-static declaration
./libavutil/libm.h:184: error: static declaration of ‘truncf’ follows non-static declaration
make: *** [libavdevice/alldevices.o] Error 1
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='/usr/local/bin/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm
You also have to care about paths like "--as=/usr/local/bin/gas-preprocessor.pl" or ".../SDKs/iPhoneOS6.1.sdk" and adapt them to your own paths/SDK

Resources