缺少必需的模块Firebase - Jenkins构建错误

时间:2022-06-01 20:34:22

I have configured jenkins for building my ios-swift application. i have used xcode version 8.1 and swift version 3. I am new to Jenkins and continues integration process. Based on my console output, i think build is successful. bacause console output print like this

我已经配置了jenkins来构建我的ios-swift应用程序。我使用过xcode版本8.1和swift版本3.我是Jenkins的新手并继续整合过程。基于我的控制台输出,我认为构建是成功的。因为控制台输出打印像这样

 Touch build/testinng.app
        cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
        /usr/bin/touch -c /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app

    CodeSign build/testinng.app
        cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test
        export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    Signing Identity:     "-"

        /usr/bin/codesign --force --sign - --timestamp=none /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app

    ** BUILD SUCCEEDED **

    2016-11-09 19:51:39.300 xcodebuild[2659:26623] [MT] IDETestOperationsObserverDebug: (E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F) Beginning test session testinngUITests-E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F at 2016-11-09 19:51:39.299 with Xcode 8B62 on target <DVTiPhoneSimulator: 0x7f9dce6bc690> {
            SimDevice: SimDevice : iPhone 7 (223F7310-19DF-4FA7-B147-73AB8B48454F) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-7 } runtime={ SimRuntime : 10.1 (14B72) - com.apple.CoreSimulator.SimRuntime.iOS-10-1 }
    } (10.1 (14B72))

But after this console output print failure message.

但是在此控制台输出打印失败消息之后。

failed to import required module: 'Firebase'.

I gofinal console output like this.

我这样的gofinal控制台输出。

 Touch build/testinng.app
        cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
        /usr/bin/touch -c /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app

    CodeSign build/testinng.app
        cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test
        export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    Signing Identity:     "-"

        /usr/bin/codesign --force --sign - --timestamp=none /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app

    ** BUILD SUCCEEDED **

    2016-11-09 19:51:39.300 xcodebuild[2659:26623] [MT] IDETestOperationsObserverDebug: (E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F) Beginning test session testinngUITests-E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F at 2016-11-09 19:51:39.299 with Xcode 8B62 on target <DVTiPhoneSimulator: 0x7f9dce6bc690> {
            SimDevice: SimDevice : iPhone 7 (223F7310-19DF-4FA7-B147-73AB8B48454F) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-7 } runtime={ SimRuntime : 10.1 (14B72) - com.apple.CoreSimulator.SimRuntime.iOS-10-1 }
    } (10.1 (14B72))


=== BUILD TARGET testinngTests OF PROJECT testinng WITH CONFIGURATION Debug ===

Check dependencies

Create product structure
/bin/mkdir -p /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app/PlugIns/testinngTests.xctest

ProcessInfoPlistFile build/testinng.app/PlugIns/testinngTests.xctest/Info.plist testinngTests/Info.plist
    cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/Info.plist -expandbuildsettings -format binary -platform iphonesimulator -o /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app/PlugIns/testinngTests.xctest/Info.plist

CompileSwift normal x86_64 /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift
    cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift -target x86_64-apple-ios10.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.1.sdk -I /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build -F /--akyiibisusqoudfyyfxubyhwzzgz/Build/Intermediates/testinng.build/Debug-iphonesimulator/testinngTests.build/Objects-normal/x86_64/testinngTests.swiftdeps -o /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Build/Intermediates/testinng.build/Debug-iphonesimulator/testinngTests.build/Objects-normal/x86_64/testinngTests.o
/Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift:10:18: error: missing required module 'Firebase'
@testable import testinng
                 ^

2016-11-09 19:51:48.418 xcodebuild[2659:26623] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngUITests-2016-11-09_195139-CXzaIj.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngUITests-2016-11-09_195139-CXzaIj.log}
2016-11-09 19:51:48.418 xcodebuild[2659:26623] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngTests-2016-11-09_195139-NdHjC1.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngTests-2016-11-09_195139-NdHjC1.log}
2016-11-09 19:51:48.419 xcodebuild[2659:27966] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7f9dceef3b20>
2016-11-09 19:51:48.419 xcodebuild[2659:26664] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7f9dcee7ded0>

Testing failed:
    Missing required module 'Firebase'
** TEST FAILED **


The following build commands failed:
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    CompileSwift normal x86_64 /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift
(2 failures)
Build step 'Xcode' marked build as failure

What is the issue related with this?

与此相关的问题是什么?

2 个解决方案

#1


14  

After an extensive research, I finally found a solution for this problem. The second modification I did in the Runpath Search Paths is I believe actually solved this problem. Below are the things I did/modified.

经过广泛的研究,我终于找到了解决这个问题的方法。我在Runpath搜索路径中做的第二个修改是我相信实际上解决了这个问题。以下是我做过/修改过的事情。

1.I moved pod 'Firebase' to my test target in the pod file as shown below.:

1.我将pod'Firebase'移动到pod文件中的测试目标,如下所示:

 target 'MyAppTests' do
    inherit! :search_paths
    pod 'Firebase'
end

2.configureRunpath Search Paths to point to $(FRAMEWORK_SEARCH_PATHS)

2.configureRunpath搜索路径指向$(FRAMEWORK_SEARCH_PATHS)

3.In addition to all the above, I uninstalled my old cocoapod(1.0.2) and installed latest version (1.1.1), removed Firebase, reinstalled it.. Then pod installed and pod updated in terminal.

3.除了上述所有内容之外,我还卸载了旧的cocoapod(1.0.2)并安装了最新版本(1.1.1),删除了Firebase,重新安装了它。然后在终端安装了pod并更新了pod。

#2


0  

Ok, so your unit test step is failing. It looks like there may be a networking issue. It's hard to tell exactly what's going on just from the console output. There's a lot of variance when it comes to the environment for Jenkins servers. It's always good to look at the logs that Jenkins points to when a problem occurs.

好的,所以你的单元测试步骤失败了。看起来可能存在网络问题。很难从控制台输出中确切地知道发生了什么。在Jenkins服务器的环境方面存在很多差异。查看Jenkins在出现问题时指出的日志总是很好。

Look at the lines below @testable import testinng. They point you to some logs.

看看@testable import testinng下面的行。他们指向你一些日志。

If you're looking to get your Jenkins job to work immediately, then you can always skip running the unit tests for now and come back to fixing that part in the future. There is risk associated with this, but if you are looking to fix your job ASAP, then this is probably the route to go if you can't debug the issue quickly enough.

如果您希望立即让Jenkins工作,那么您现在可以跳过运行单元测试,并在将来重新修复该部分。存在与此相关的风险,但是如果您希望尽快修复您的工作,那么如果您无法足够快地调试问题,这可能是要走的路。

It's hard to say EXACTLY how to fix your problem without looking at the logs or at least getting a little more context, but I would suggest not sharing your logs.

很难说如何在不查看日志或至少获得更多上下文的情况下如何解决问题,但我建议不要共享您的日志。

#1


14  

After an extensive research, I finally found a solution for this problem. The second modification I did in the Runpath Search Paths is I believe actually solved this problem. Below are the things I did/modified.

经过广泛的研究,我终于找到了解决这个问题的方法。我在Runpath搜索路径中做的第二个修改是我相信实际上解决了这个问题。以下是我做过/修改过的事情。

1.I moved pod 'Firebase' to my test target in the pod file as shown below.:

1.我将pod'Firebase'移动到pod文件中的测试目标,如下所示:

 target 'MyAppTests' do
    inherit! :search_paths
    pod 'Firebase'
end

2.configureRunpath Search Paths to point to $(FRAMEWORK_SEARCH_PATHS)

2.configureRunpath搜索路径指向$(FRAMEWORK_SEARCH_PATHS)

3.In addition to all the above, I uninstalled my old cocoapod(1.0.2) and installed latest version (1.1.1), removed Firebase, reinstalled it.. Then pod installed and pod updated in terminal.

3.除了上述所有内容之外,我还卸载了旧的cocoapod(1.0.2)并安装了最新版本(1.1.1),删除了Firebase,重新安装了它。然后在终端安装了pod并更新了pod。

#2


0  

Ok, so your unit test step is failing. It looks like there may be a networking issue. It's hard to tell exactly what's going on just from the console output. There's a lot of variance when it comes to the environment for Jenkins servers. It's always good to look at the logs that Jenkins points to when a problem occurs.

好的,所以你的单元测试步骤失败了。看起来可能存在网络问题。很难从控制台输出中确切地知道发生了什么。在Jenkins服务器的环境方面存在很多差异。查看Jenkins在出现问题时指出的日志总是很好。

Look at the lines below @testable import testinng. They point you to some logs.

看看@testable import testinng下面的行。他们指向你一些日志。

If you're looking to get your Jenkins job to work immediately, then you can always skip running the unit tests for now and come back to fixing that part in the future. There is risk associated with this, but if you are looking to fix your job ASAP, then this is probably the route to go if you can't debug the issue quickly enough.

如果您希望立即让Jenkins工作,那么您现在可以跳过运行单元测试,并在将来重新修复该部分。存在与此相关的风险,但是如果您希望尽快修复您的工作,那么如果您无法足够快地调试问题,这可能是要走的路。

It's hard to say EXACTLY how to fix your problem without looking at the logs or at least getting a little more context, but I would suggest not sharing your logs.

很难说如何在不查看日志或至少获得更多上下文的情况下如何解决问题,但我建议不要共享您的日志。