Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
felixkrautschuk opened this issue Nov 24, 2022 · 5 comments · Fixed by #5705
Closed
3 tasks done

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

felixkrautschuk opened this issue Nov 24, 2022 · 5 comments · Fixed by #5705
Assignees

Comments

@felixkrautschuk
Copy link

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

@felixkrautschuk felixkrautschuk added the bug-pending-triage Reported bug, pending triage to confirm. label Nov 24, 2022
@NathanWalker NathanWalker self-assigned this Nov 24, 2022
@NathanWalker NathanWalker added in-progress and removed bug-pending-triage Reported bug, pending triage to confirm. labels Nov 24, 2022
@NathanWalker
Copy link
Contributor

NathanWalker commented Nov 24, 2022

@felixkrautschuk It builds and runs for me on M1 - I'm guessing they are missing some x86 slices as you mentioned you're on an Intel.

When the sample app runs here (thank you for included the sample!), I do see this crash though which appears normal:

*** Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions at https://googlemobileadssdk.page.link/admob-ios-update-plist to set a valid application ID. Google Ad Manager publishers, follow instructions at https://googlemobileadssdk.page.link/ad-manager-ios-update-plist.'

Just need proper configuration there. We can look on an Intel next to confirm anything else, but for sure on M1, all is operational here.

@felixkrautschuk
Copy link
Author

@NathanWalker thanks for your feedback. The native sample app is getting built on Xcode and even the NativeScript app is also getting built from Xcode on Intel. The problem seems to be somewhere in the NS CLI.

And yes, you can ignore the crash, because at this point the project is already built and the app is already installed.

@NathanWalker
Copy link
Contributor

NathanWalker commented Nov 29, 2022

@felixkrautschuk 8.4 release on wednesday will include the cli fix for you (from that linked pr) 👍

@rigor789
Copy link
Member

@felixkrautschuk should also be able to test via the next tag:

npm i -g nativescript@8.3.3-next-11-29-2022-3577806449

@felixkrautschuk
Copy link
Author

felixkrautschuk commented Dec 2, 2022

@NathanWalker @rigor789 thank you very much, now I am able to build the sample app correctly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants