我创建了一个示例 QT 应用程序,在 QT Creator 中打开其
CMakeLists.txt
,选择 iOS Simulator
配置并运行 CMake。它在build/Qt_6_7_0_iOS_Release_Simulator/AdExample.xcodeproj/
生成了 XCode 项目。
之后,我在
Podfile
目录中创建了 build/Qt_6_7_0_iOS_Release_Simulator
,内容如下:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, :deployment_target => '14.0'
target 'AdExample' do
pod 'YandexMobileAdsMediation', '7.5.1'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
end
end
end
YandexMobileAdsMediation 是我尝试在 QT 应用程序中使用的广告框架,请参阅他们的文档。
然后我就跑
pod install
从命令行运行命令,在XCode中打开生成的
AdExample.xcworkspace
并尝试构建,但出现以下错误:
ld: library 'Pods-AdExample' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这是什么意思?我应该在哪里添加
-v
选项?
下面我提供了完整的 XCode 屏幕截图以防万一:
libPods-AdExample.a
有什么问题吗?
我成功构建的他们的示例也有类似的.a
:它与其他
.a
文件一起存在于项目构建文件夹中:
./Build/Products/Debug-iphonesimulator/VGSLNetworking/libVGSLNetworking.a
./Build/Products/Debug-iphonesimulator/AppMetricaHostState/libAppMetricaHostState.a
./Build/Products/Debug-iphonesimulator/AppMetricaStorageUtils/libAppMetricaStorageUtils.a
./Build/Products/Debug-iphonesimulator/VGSLFundamentals/libVGSLFundamentals.a
./Build/Products/Debug-iphonesimulator/DivKit/libDivKit.a
./Build/Products/Debug-iphonesimulator/DivKit_LayoutKitInterface/libDivKit_LayoutKitInterface.a
./Build/Products/Debug-iphonesimulator/AppMetricaProtobufUtils/libAppMetricaProtobufUtils.a
./Build/Products/Debug-iphonesimulator/AppMetricaCoreExtension/libAppMetricaCoreExtension.a
./Build/Products/Debug-iphonesimulator/AppMetricaProtobuf/libAppMetricaProtobuf.a
./Build/Products/Debug-iphonesimulator/Google-Mobile-Ads-SDK/libGoogle-Mobile-Ads-SDK.a
./Build/Products/Debug-iphonesimulator/AppMetricaEncodingUtils/libAppMetricaEncodingUtils.a
./Build/Products/Debug-iphonesimulator/AppMetricaFMDB/libAppMetricaFMDB.a
./Build/Products/Debug-iphonesimulator/KSCrash/libKSCrash.a
./Build/Products/Debug-iphonesimulator/VGSLUI/libVGSLUI.a
./Build/Products/Debug-iphonesimulator/AppMetricaCore/libAppMetricaCore.a
./Build/Products/Debug-iphonesimulator/libPods-YandexMobileAdsExample.a
./Build/Products/Debug-iphonesimulator/DivKit_LayoutKit/libDivKit_LayoutKit.a
./Build/Products/Debug-iphonesimulator/AppMetricaCrashes/libAppMetricaCrashes.a
./Build/Products/Debug-iphonesimulator/AppMetricaLog/libAppMetricaLog.a
./Build/Products/Debug-iphonesimulator/AppMetricaNetwork/libAppMetricaNetwork.a
./Build/Products/Debug-iphonesimulator/DivKitBinaryCompatibilityFacade/libDivKitBinaryCompatibilityFacade.a
./Build/Products/Debug-iphonesimulator/DivKit_Serialization/libDivKit_Serialization.a
./Build/Products/Debug-iphonesimulator/AppMetricaCoreUtils/libAppMetricaCoreUtils.a
./Build/Products/Debug-iphonesimulator/AppMetricaPlatform/libAppMetricaPlatform.a
./Build/Products/Debug-iphonesimulator/VGSL/libVGSL.a
此外 libPods-AdExample.a
与其他
.a
文件一起存在于 AdExample 构建目录中:
./VGSLNetworking/libVGSLNetworking.a
./AppMetricaHostState/libAppMetricaHostState.a
./AppMetricaStorageUtils/libAppMetricaStorageUtils.a
./VGSLFundamentals/libVGSLFundamentals.a
./DivKit/libDivKit.a
./DivKit_LayoutKitInterface/libDivKit_LayoutKitInterface.a
./AppMetricaProtobufUtils/libAppMetricaProtobufUtils.a
./AppMetricaCoreExtension/libAppMetricaCoreExtension.a
./AppMetricaProtobuf/libAppMetricaProtobuf.a
./Google-Mobile-Ads-SDK/libGoogle-Mobile-Ads-SDK.a
./AppMetricaEncodingUtils/libAppMetricaEncodingUtils.a
./AppMetricaFMDB/libAppMetricaFMDB.a
./KSCrash/libKSCrash.a
./VGSLUI/libVGSLUI.a
./AppMetricaCore/libAppMetricaCore.a
./DivKit_LayoutKit/libDivKit_LayoutKit.a
./AppMetricaCrashes/libAppMetricaCrashes.a
./AppMetricaLog/libAppMetricaLog.a
./AppMetricaNetwork/libAppMetricaNetwork.a
./DivKitBinaryCompatibilityFacade/libDivKitBinaryCompatibilityFacade.a
./libPods-AdExample.a
./DivKit_Serialization/libDivKit_Serialization.a
./AppMetricaCoreUtils/libAppMetricaCoreUtils.a
./AppMetricaPlatform/libAppMetricaPlatform.a
./VGSL/libVGSL.a
但不清楚为什么没有找到。 libPods-YandexMobileAdsExample
和
libPods-AdExample
在其
.pbxproj
文件的相同部分中指定。
pod install
命令输出:
Analyzing dependencies
Downloading dependencies
Installing AppLovinSDK (12.6.1)
Installing AppLovinYandexMobileAdsAdapters (12.6.1.2)
Installing AppMetricaCore (5.8.0)
Installing AppMetricaCoreExtension (5.8.0)
Installing AppMetricaCoreUtils (5.8.0)
Installing AppMetricaCrashes (5.8.0)
Installing AppMetricaEncodingUtils (5.8.0)
Installing AppMetricaFMDB (5.8.0)
Installing AppMetricaHostState (5.8.0)
Installing AppMetricaLog (5.8.0)
Installing AppMetricaNetwork (5.8.0)
Installing AppMetricaPlatform (5.8.0)
Installing AppMetricaProtobuf (5.8.0)
Installing AppMetricaProtobufUtils (5.8.0)
Installing AppMetricaStorageUtils (5.8.0)
Installing BigoADS (4.2.3)
Installing BigoADSYandexMobileAdsAdapters (4.2.3.9)
Installing ChartboostSDK (9.7.0)
Installing ChartboostYandexMobileAdsAdapters (9.7.0.12)
Installing DivKit (30.18.0)
Installing DivKitBinaryCompatibilityFacade (4.4.0)
Installing DivKit_LayoutKit (30.18.0)
Installing DivKit_LayoutKitInterface (30.18.0)
Installing DivKit_Serialization (30.18.0)
Installing Google-Mobile-Ads-SDK (11.7.0)
Installing GoogleUserMessagingPlatform (2.6.0)
Installing GoogleYandexMobileAdsAdapters (11.7.0.3)
Installing InMobiSDK (10.7.5)
Installing InMobiYandexMobileAdsAdapters (10.7.5.2)
Installing IronSourceSDK (8.3.0.0)
Installing IronSourceYandexMobileAdsAdapters (8.3.0.2)
Installing KSCrash (2.0.0-rc.2)
Installing MintegralAdSDK (7.6.9)
Installing MintegralYandexMobileAdsAdapters (7.6.9.3)
Installing MyTargetYandexMobileAdsAdapters (5.21.7.2)
Installing StartAppSDK (4.10.4)
Installing StartAppYandexMobileAdsAdapters (4.10.4.3)
Installing UnityAds (4.12.3)
Installing UnityAdsYandexMobileAdsAdapters (4.12.2.3)
Installing VGSL (6.5.0)
Installing VGSLFundamentals (6.5.0)
Installing VGSLNetworking (6.5.0)
Installing VGSLUI (6.5.0)
Installing VungleAds (7.4.1)
Installing VungleYandexMobileAdsAdapters (7.4.1.1)
Installing YandexMobileAds (7.5.1)
Installing YandexMobileAdsMediation (7.5.1)
Installing myTargetSDK (5.21.8)
Installing myTrackerSDK (3.2.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `AdExample.xcworkspace` for this project from now on.
Pod installation complete! There is 1 dependency from the Podfile and 49 total pods installed.
[!] [!] Xcodeproj doesn't know about the following attributes {"buildSettings"=>{}, "buildStyles"=>["46E0D197708B4914B8435B77", "4F86475E04594C3090266BEB", "4699D34445A045B588C7F609", "9F302499CF354E9F8FE01881"]} for the 'PBXProject' isa.
If this attribute was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new
[!] Unable to read the license file `LICENSE` for the spec `DivKitBinaryCompatibilityFacade (4.4.0)`
[!] Unable to read the license file `LICENSE` for the spec `DivKitBinaryCompatibilityFacade (4.4.0)
${PODS_CONFIGURATION_BUILD_DIR}
添加到
LIBRARY_SEARCH_PATHS
中的
AdExample.xcodeproj/project.pbxproj
来修复构建:
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaCore\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaCoreExtension\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaCoreUtils\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaCrashes\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaEncodingUtils\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaFMDB\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaHostState\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaLog\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaNetwork\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaPlatform\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaProtobuf\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaProtobufUtils\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/AppMetricaStorageUtils\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/DivKit\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/DivKitBinaryCompatibilityFacade\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/DivKit_LayoutKit\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/DivKit_LayoutKitInterface\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/DivKit_Serialization\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/Google-Mobile-Ads-SDK\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/KSCrash\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/VGSL\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/VGSLFundamentals\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/VGSLNetworking\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/VGSLUI\"",
"\"${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}\"",
/usr/lib/swift,
"\"${PODS_CONFIGURATION_BUILD_DIR}\"",
);
但不清楚为什么pod install
命令不添加此路径。