Skip to content

could not find module for target 'arm64-apple-ios-simulator' #5702

Closed
@felixkrautschuk

Description

@felixkrautschuk

Issue Description

When I try to add the PrebidMobileAdMobAdapters pod to our NativeScript project and run tns run ios from cli, the build fails with the following error:

could not find module 'PrebidMobile' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator

Podfile:

platform :ios, '13.0'
use_frameworks!

pod 'PrebidMobile', '2.0.4'
pod 'PrebidMobileAdMobAdapters', '2.0.4'
pod 'Google-Mobile-Ads-SDK'

build.xcconfig:

ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;

When opening the project from platforms/ios in xcode after that unsuccessful cli build, I am able to build and run the app there, on a physical device and even in Simulator.

When building the app using tns build ios --for-device, the build works as expected.

When creating a native iOS project directly and add the pods there, there are no build errors, so the issue seems to be caused by NativeScript at some point.
See discussion in Prebid Mobile iOS repo: prebid/prebid-mobile-ios#723

I am working on Macbook Pro 2019 (Intel).

Reproduction

Newly created NativeScript app with the Podfile from description:
ns-ios-prebid.zip

  • ns run ios -> will fail
  • open project from platforms/ios in Xcode, build and run in Simulator from there -> will succeed
  • clear platforms/ios and run ns build ios --for-device -> will succeed

Native iOS project:
PrebidTest.zip

Relevant log output (if applicable)

felixkrautschuk@Felixs-MacBook-Pro ns-ios-prebid % tns build ios
Copying template files...
Platform ios successfully added. v8.3.3
Preparing project...
asset vendor.js 6.46 MiB [emitted] (name: vendor) (id hint: defaultVendor)
asset bundle.js 12.5 KiB [emitted] (name: bundle)
asset runtime.js 11.6 KiB [emitted] (name: runtime)
asset tns_modules/inspector_modules.js 1.23 KiB [emitted] (name: tns_modules/inspector_modules)
Entrypoint bundle 6.49 MiB = runtime.js 11.6 KiB vendor.js 6.46 MiB bundle.js 12.5 KiB
Entrypoint tns_modules/inspector_modules 6.47 MiB = runtime.js 11.6 KiB vendor.js 6.46 MiB tns_modules/inspector_modules.js 1.23 KiB
runtime modules 2.46 KiB 7 modules
orphan modules 356 bytes [orphan] 6 modules
modules by path ./node_modules/@nativescript/ 1.52 MiB 190 modules
modules by path ./node_modules/css-tree/ 317 KiB 113 modules
modules by path ./app/ 2.45 KiB 7 modules
modules by path ./node_modules/source-map/lib/*.js 36.3 KiB 6 modules
modules by path ./node_modules/reduce-css-calc/dist/ 131 KiB 5 modules
modules by path ./node_modules/postcss-value-parser/lib/*.js 12.5 KiB
  ./node_modules/postcss-value-parser/lib/index.js 607 bytes [built] [code generated]
  + 4 modules
modules by path ./node_modules/mdn-data/css/*.json 242 KiB
  ./node_modules/mdn-data/css/at-rules.json 11.6 KiB [built] [code generated]
  + 2 modules
+ 4 modules
webpack 5.75.0 compiled successfully in 2105 ms
Webpack compilation complete.
Installing pods...
Ignoring digest-3.0.0 because its extensions are not built. Try: gem pristine digest --version 3.0.0
Ignoring etc-1.2.0 because its extensions are not built. Try: gem pristine etc --version 1.2.0
Ignoring fiddle-1.0.9 because its extensions are not built. Try: gem pristine fiddle --version 1.0.9
Ignoring io-console-0.5.9 because its extensions are not built. Try: gem pristine io-console --version 0.5.9
Ignoring openssl-2.2.0 because its extensions are not built. Try: gem pristine openssl --version 2.2.0
Ignoring psych-4.0.1 because its extensions are not built. Try: gem pristine psych --version 4.0.1
Ignoring racc-1.5.2 because its extensions are not built. Try: gem pristine racc --version 1.5.2
Ignoring readline-ext-0.1.2 because its extensions are not built. Try: gem pristine readline-ext --version 0.1.2
Ignoring stringio-3.0.0 because its extensions are not built. Try: gem pristine stringio --version 3.0.0
Ignoring strscan-3.0.0 because its extensions are not built. Try: gem pristine strscan --version 3.0.0
Analyzing dependencies
Downloading dependencies
Installing Google-Mobile-Ads-SDK (9.13.0)
Installing GoogleAppMeasurement (10.2.0)
Installing GoogleUserMessagingPlatform (2.0.1)
Installing GoogleUtilities (7.10.0)
Installing PrebidMobile (2.0.4)
Installing PrebidMobileAdMobAdapters (2.0.4)
Installing PromisesObjC (2.1.1)
Installing nanopb (2.30909.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `nsiosprebid.xcworkspace` for this project from now on.
Pod installation complete! There are 3 dependencies from the Podfile and 8 total pods installed.
Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Building project...
Xcode build...
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/PrebidMobileAdMobAdapters/EventHandlers/PrebidMobileAdMobAdapters/Sources/AdMobMediationBannerUtils.swift:17:8: error: could not find module 'PrebidMobile' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, at: /Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/build/Debug-iphonesimulator/PrebidMobile/PrebidMobile.framework/Modules/PrebidMobile.swiftmodule
import PrebidMobile
       ^
<module-includes>:103:9: note: in file included from <module-includes>:103:
#import "Headers/PrebidMobile-Swift.h"
        ^
note: Using codesigning identity override: 
note: Building targets in dependency order
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'nanopb' from project 'Pods')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'PromisesObjC' from project 'Pods')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'PrebidMobileAdMobAdapters' from project 'Pods')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'PrebidMobile' from project 'Pods')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'GoogleUtilities' from project 'Pods')
note: Run script build phase 'NativeScript PreLink' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'nsiosprebid' from project 'nsiosprebid')
note: Run script build phase 'NativeScript PostBuild' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'nsiosprebid' from project 'nsiosprebid')
note: Run script build phase 'NativeScript PreBuild' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'nsiosprebid' from project 'nsiosprebid')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'GoogleUserMessagingPlatform' from project 'Pods')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'GoogleAppMeasurement' from project 'Pods')
/Users/felixkrautschuk/Downloads/ns-ios-prebid/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'Google-Mobile-Ads-SDK' from project 'Pods')
** BUILD FAILED **

Command xcodebuild failed with exit code 65

Environment

OS: macOS 13.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: /bin/zsh
node: 16.17.0
npm: 8.15.0
nativescript: 8.3.3

# android
java: 11.0.11
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 14.1/14B47b
cocoapods: 1.11.3
python: 2.7.18
python3: 3.10.8
ruby: 2.7.6
platforms: 
  - DriverKit 22.1
  - iOS 16.1
  - macOS 13.0
  - tvOS 16.1
  - watchOS 9.1

Dependencies

"dependencies": {
  "@nativescript/core": "^8.3.6"
},
"devDependencies": {
  "@nativescript/ios": "^8.3.3",
  "@nativescript/webpack": "^5.0.10"
}

Please accept these terms

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions