admob-plus / admob-plus

Trustable AdMob Plugin for Cordova, Capacitor, Ionic, React Native
https://admob-plus.github.io
MIT License
360 stars 150 forks source link

Can't build cordova ios with plugin admob-plus-cordova #613

Closed bonjourjoel closed 8 months ago

bonjourjoel commented 8 months ago

Hi,

Problem description

When i build on cordova/ios, i get the following compiler error. Does anyone know why? Am I missing a dependency?

I installed the plugin using cordova plugin add as explained in the help. It works on android and it compiles and shows test ads, but on ios i can't even compile. I have searched in the help and tried all the install details and fixes available, but i still get this error.

Undefined symbols for architecture arm64: "_SKAdNetworkCoarseConversionValueHigh", referenced from: -[APMMeasurement(SKAN) convertCoarseConversionValueFromProtoValue:] in GoogleAppMeasurement(APMMeasurement+SKAN.o) "_SKAdNetworkCoarseConversionValueLow", referenced from: -[APMMeasurement(SKAN) convertCoarseConversionValueFromProtoValue:] in GoogleAppMeasurement(APMMeasurement+SKAN.o) "_SKAdNetworkCoarseConversionValueMedium", referenced from: -[APMMeasurement(SKAN) convertCoarseConversionValueFromProtoValue:] in GoogleAppMeasurement(APMMeasurement+SKAN.o) "_SKStoreProductParameterAdNetworkSourceIdentifier", referenced from: l030 in GoogleMobileAds(GADInAppStoreMonitor.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

/Volumes/dev/player22/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GoogleUtilities' from project 'Pods') ARCHIVE FAILED

The following build commands failed: Ld /Users/joel/Library/Developer/Xcode/DerivedData/player22-evzhtkeezoazkeelkwcstskvxrdz/Build/Intermediates.noindex/ArchiveIntermediates/player22/InstallationBuildProductsLocation/Applications/player22.app/player22 normal (in target 'player22' from project 'player22') (1 failure) Command failed with exit code 65: xcodebuild -workspace player22.xcworkspace -scheme player22 -configuration Debug -destination generic/platform=iOS -archivePath player22.xcarchive -allowProvisioningUpdates archive EMBEDDED_CONTENT_CONTAINS_SWIFT = YES ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks" Error: Command failed with exit code 65: xcodebuild -workspace player22.xcworkspace -scheme player22 -configuration Debug -destination generic/platform=iOS -archivePath player22.xcarchive -allowProvisioningUpdates archive EMBEDDED_CONTENT_CONTAINS_SWIFT = YES ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks" at makeError (/Volumes/dev/player22/node_modules/cordova-ios/node_modules/execa/lib/error.js:60:11) at handlePromise (/Volumes/dev/player22/node_modules/cordova-ios/node_modules/execa/index.js:118:26) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

This is the full build log:

Command: cordova build ios --debug --device --buildConfig=app-build-config/cordova-build-config/build-config.json --verbose

Result: log.txt

Reproduce the error

$> cordova create test

$> cd test

$> cordova platform add ios

$> cordova plugin add admob-plus-cordova

$> pod repo update

$> cordova build ios

Then i get the error about missing symbols, but maybe it's just me? And why then?

Environment

AdMob Plus Environment Info: System: OS: macOS Monterey 12.6 CPU: (4) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz Memory: 155.22 MB / 4.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.14.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.8.1 - /usr/local/bin/npm Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod Utilities: Clang: 14.0.0 - /usr/bin/clang SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 IDEs: Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild npmPackages: admob-plus-cordova: ^2.0.0-alpha.13 => 2.0.0-alpha.13 admob-plus-cordova-native: ^1.0.0-alpha.14 => 1.0.0-alpha.14 cordova-android: ^12.0.1 => 12.0.1 cordova-ios: ^7.0.0 => 7.0.0 npmGlobalPackages: cordova: 12.0.0 Cordova: Version: 12.0.0 (cordova-lib@12.0.1) Plugins: admob-plus-cordova-native: ^1.0.0-alpha.14 admob-plus-cordova: ^2.0.0-alpha.13 Ionic: Version: - AndroidManifest.xml: Version: -

Cocoapods issue

Also there is something particular that could be the source of the problem and that i can't explain:

Cocoapods install log

This is what is installed by cocoapods. Does it seem ok?

joel@joels-MacBook-Pro ios % pod install Analyzing dependencies Downloading dependencies Installing Google-Mobile-Ads-SDK (10.6.0) Installing GoogleAppMeasurement (10.14.0) Installing GoogleUserMessagingPlatform (2.1.0) Installing GoogleUtilities (7.11.5) Installing PromisesObjC (2.3.1) Installing nanopb (2.30909.0) Generating Pods project Integrating client project Pod installation complete! There is 1 dependency from the Podfile and 6 total pods installed.

LD_RUNPATH_SEARCH_PATHS

When I add the plugin, i _sometimes_get this message:

joel@joels-MacBook-Pro cordovaadmobexample2 % cordova plugin add admob-plus-cordova Installing "admob-plus-cordova" for ios

[!] The HelloCordova [Debug] target overrides the LD_RUNPATH_SEARCH_PATHS build setting defined in `Pods/Target Support Files/Pods-HelloCordova/Pods-HelloCordova.debug.xcconfig'. This can lead to problems with the CocoaPods installation

[!] The HelloCordova [Release] target overrides the LD_RUNPATH_SEARCH_PATHS build setting defined in `Pods/Target Support Files/Pods-HelloCordova/Pods-HelloCordova.release.xcconfig'. This can lead to problems with the CocoaPods installation Adding admob-plus-cordova to package.json

bonjourjoel commented 8 months ago

Hi again,

So i was reading the issues forum here, and I found this message: https://github.com/admob-plus/admob-plus/issues/615#issue-1878622677

The user @danieldanielecki was explaining that the current version was unstable, and he reverted to version 1.28.0

So i tried the same and i found out that my reproducing script above ends up with BUILD SUCCEEDED if i install version 1.28.0 of the plugin.

So i "suppose" that compiling on ios with the current version does not work. But it's only a supposition.

Could someone try to run this script and tell me if it succeeds or fails to compile?

Because for me this script compiles correctly adding admob-plus-cordova@1.28.0 but fails by adding admob-plus-cordova.

bonjourjoel commented 8 months ago

Ok i realized i answered my own question: It's not building on ios with the current dev version. I will develop with 1.28.0 and wait for a fix. Case closed!