thaliproject / Thali_CordovaPlugin

Thali p2p plugin
MIT License
226 stars 44 forks source link

Not able to build ThaliTestApp for iOS #1709

Open czyzm opened 7 years ago

czyzm commented 7 years ago

With the latest iOS branch of Thali_CordovaPlugin I am not able to build iOS app. I am trying to build ThaliTestApp. Executing command cordova build ios --device results in following error:

/Users/mczyz/thali/test/dummy/ThaliTestApp/platforms/ios/ThaliTestApp/Plugins/org.thaliproject.p2p/AppContextTests.swift:11:8: error: cannot load underlying module for 'XCTest'
import XCTest
       ^

** ARCHIVE FAILED **

The following build commands failed:
        CompileSwift normal arm64 /Users/mczyz/thali/test/dummy/ThaliTestApp/platforms/ios/ThaliTestApp/Plugins/org.thaliproject.p2p/AppContext.swift
        CompileSwift normal arm64 /Users/mczyz/thali/test/dummy/ThaliTestApp/platforms/ios/ThaliTestApp/Plugins/org.thaliproject.p2p/AppContextTests.swift
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(3 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/mczyz/thali/test/dummy/ThaliTestApp/platforms/ios/cordova/build-debug.xcconfig,-workspace,ThaliTestApp.xcworkspace,-scheme,ThaliTestApp,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,ThaliTestApp.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/mczyz/thali/test/dummy/ThaliTestApp/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/mczyz/thali/test/dummy/ThaliTestApp/platforms/ios/build/sharedpch
larryonoff commented 7 years ago

Link PR thaliproject/Thali_CordovaPlugin#1711

larryonoff commented 7 years ago

@czyzm please print output of the following commands:

Please also check that you have Xcode command line tools installed by executing command xcode-select --install.

larryonoff commented 7 years ago

The reason of build failure is that we didn't test properly release build, we worked with testing builds.

larryonoff commented 7 years ago

PR thaliproject/Thali_CordovaPlugin#1722 should fix the real issues that we have. But I'm not sure that it will fix the issue completely.

I've already seen an issue with cordova build ios --device when the command just hang and then reported error, but nothing wrong in our code or setup. So I had to do build directly via xcodebuild and not via cordova build.

See the xcodebuild command https://github.com/thaliproject/Thali_CordovaPlugin/blob/iOS_swift3_migration/thali/install/setUpTests.sh#L191.