transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
656 stars 277 forks source link

[IOS] Cannot archive application due to build errors in xcode #1416

Closed dackyD closed 8 months ago

dackyD commented 8 months ago

Your Environment

Expected Behavior

Should archive ios build without errors when running cordova build ios or building in xcode

Actual Behavior

Cannot archive ios build when running cordova build ios or buidling in xcode. The project builds and archives without errors in the command line by running cordova build ios or building in xcode when cordova-background-geolocation-lt is removed.

Debug logs

Logs ``` ======> Logs when building from xcode: Undefined symbols for architecture arm64: "_OBJC_CLASS_$_DDASLLogger", referenced from: objc-class-ref in TSLocationManager(TSLog.o) "_OBJC_CLASS_$_DDAbstractDatabaseLogger", referenced from: _OBJC_CLASS_$_TSDBLogger in TSLocationManager(TSDBLogger.o) "_OBJC_CLASS_$_DDLog", referenced from: objc-class-ref in TSLocationManager(TSGeofenceManager.o) objc-class-ref in TSLocationManager(TSGeofenceEvent.o) objc-class-ref in TSLocationManager(TSScheduler.o) objc-class-ref in TSLocationManager(TSLocation.o) objc-class-ref in TSLocationManager(SOMotionDetector.o) objc-class-ref in TSLocationManager(TSLog.o) objc-class-ref in TSLocationManager(TSSchedule.o) ... "_OBJC_CLASS_$_DDOSLogger", referenced from: objc-class-ref in TSLocationManager(TSLog.o) "_OBJC_CLASS_$_DDTTYLogger", referenced from: objc-class-ref in TSLocationManager(TSLog.o) "_OBJC_IVAR_$_DDAbstractDatabaseLogger._maxAge", referenced from: -[TSDBLogger getLog:] in TSLocationManager(TSDBLogger.o) -[TSDBLogger db_delete] in TSLocationManager(TSDBLogger.o) "_OBJC_IVAR_$_DDAbstractDatabaseLogger._saveThreshold", referenced from: -[TSDBLogger initWithLogDirectory:] in TSLocationManager(TSDBLogger.o) "_OBJC_IVAR_$_DDAbstractLogger._logFormatter", referenced from: -[TSDBLogger db_log:] in TSLocationManager(TSDBLogger.o) "_OBJC_IVAR_$_DDLogMessage._context", referenced from: -[TSDBLogEntry initWithLogMessage:] in TSLocationManager(TSDBLogger.o) "_OBJC_IVAR_$_DDLogMessage._flag", referenced from: -[TSDBLogEntry initWithLogMessage:] in TSLocationManager(TSDBLogger.o) "_OBJC_IVAR_$_DDLogMessage._message", referenced from: -[TSDBLogEntry initWithLogMessage:] in TSLocationManager(TSDBLogger.o) "_OBJC_IVAR_$_DDLogMessage._timestamp", referenced from: -[TSDBLogEntry initWithLogMessage:] in TSLocationManager(TSDBLogger.o) "_OBJC_METACLASS_$_DDAbstractDatabaseLogger", referenced from: _OBJC_METACLASS_$_TSDBLogger in TSLocationManager(TSDBLogger.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ======> Logs from command line when running cordova build ios: Prepare packages Computing target dependency graph and provisioning inputs Create build description Build description signature: 43498f2cc4f4129a300eafc0eaf07888 Build description path: /Users/hdd/Library/Developer/Xcode/DerivedData/Effera_Insight-hbzvppfxfzglvrdxxdkszwpohxyk/Build/Intermediates.noindex/ArchiveIntermediates/Effera Insight/IntermediateBuildFilesPath/XCBuildData/43498f2cc4f4129a300eafc0eaf07888.xcbuilddata note: Building targets in dependency order /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'FirebaseCore' from project 'Pods') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'FirebaseCoreInternal' from project 'Pods') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/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.4.99. (in target 'GoogleUtilities' from project 'Pods') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/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.4.99. (in target 'PromisesObjC' from project 'Pods') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/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.4.99. (in target 'nanopb' from project 'Pods') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.4.99. (in target 'FirebaseInstallations' from project 'Pods') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/platforms/ios/Effera Insight.xcodeproj: error: Signing for "Effera Insight" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'Effera Insight' from project 'Effera Insight') /Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/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.4.99. (in target 'GoogleDataTransport' from project 'Pods') ** ARCHIVE FAILED ** Command failed with exit code 65: xcodebuild -workspace Effera Insight.xcworkspace -scheme Effera Insight -configuration Debug -destination generic/platform=iOS -archivePath Effera Insight.xcarchive archive Error: Command failed with exit code 65: xcodebuild -workspace Effera Insight.xcworkspace -scheme Effera Insight -configuration Debug -destination generic/platform=iOS -archivePath Effera Insight.xcarchive archive at makeError (/Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/node_modules/execa/lib/error.js:60:11) at handlePromise (/Users/hdd/Dev/Effera/EfferaNx.Beta/src/Clients/Effera.Platform.ClientApp/apps/client-app/node_modules/execa/index.js:118:26) at processTicksAndRejections (node:internal/process/task_queues:96:5) [ERROR] An error occurred while running subprocess cordova. ```
christocracy commented 8 months ago
$ cordova plugins
christocracy commented 8 months ago

The SampleApp archives successfully.

I think you have a clash with the plugin's logging dependency CocoaLumberjack.

dackyD commented 8 months ago

Hi chris,

Here are my plugins. How can I check if there are conflicts with CocoaLumberjack?

Plugins ``` @havesource/cordova-plugin-push 4.0.0-dev.0 "Cordova Push Plugin" @theankur/cordova-plugin-file-opener2 1.0.1 "File Opener2" cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release" cordova-background-geolocation-lt 4.14.2 "BackgroundGeolocation" cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter" cordova-plugin-background-fetch 7.2.1 "CDVBackgroundFetch" cordova-plugin-battery-status 2.0.3 "Battery" cordova-plugin-ble-central 1.7.0 "BLE" cordova-plugin-brightness 0.1.5 "Brightness" cordova-plugin-camera 6.0.0 "Camera" cordova-plugin-cocoapod-supportx 1.7.3 "Cordova CocoaPods Dependency Support" cordova-plugin-device 2.1.0 "Device" cordova-plugin-dialogs 2.0.2 "Notification" cordova-plugin-enable-multidex 0.2.0 "Enable Multidex" cordova-plugin-file 8.0.0 "File" cordova-plugin-hce 1.0.0 "HCE" cordova-plugin-inappbrowser 5.0.0 "InAppBrowser" cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview" cordova-plugin-network-information 3.0.0 "Network Information" cordova-plugin-screen-orientation 3.0.3 "Screen Orientation" cordova-plugin-statusbar 3.0.0 "StatusBar" cordova-plugin-vibration 3.1.1 "Vibration" cordova-sqlite-storage 6.1.0 "Cordova SQLite storage plugin - cordova-sqlite-storage plugin version" cordova.plugins.diagnostic 7.1.2 "Diagnostic" es6-promise-plugin 4.1.0 "Promise" phonegap-plugin-barcodescanner 8.1.0 "BarcodeScanner" wifiwizard2 3.1.1 "WifiWizard2" ```

Another thing, In the sample app under cordova in package.json. Are these values still relevant?

"cordova": {
  "cordova-background-geolocation-lt": {
        "GOOGLE_API_VERSION": "20.+",
        "HMS_LOCATION_VERSION": "6.11.0.301",
        "OKHTTP_VERSION": "3.12.+",
        "EVENTBUS_VERSION": "3.3.1",
      }
}

Thanks for the quick response. Looking forward to fix this issue

christocracy commented 8 months ago

(use triple backticks to syntax highlight multiline code-blocks. Not one.)

Show me also the following file: platforms/ios/Podfile

dackyD commented 8 months ago

PodFIle

# DO NOT MODIFY -- auto-generated by Apache Cordova

platform :ios, '11.0'
use_frameworks!
target 'Insight' do
    project 'Insight.xcodeproj'
    pod 'Firebase/Messaging', '~> 8.1.1'
    pod 'CocoaLumberjack', '~> 3.7.2'
end
christocracy commented 8 months ago

I suggest you first cordova platform remove ios / cordova plugin add ios and try again.

Then AUDIT YOUR PLUGINS.

dackyD commented 8 months ago

Hi Chris,

I can't really answer why I am using those plugins because I inherited this project. You are entirely correct, as I started to remove those plugins you mentioned, the compile error from xcode went away.

I really appreciate the support. I am closing this ticket since this is not related to cordova-background-geolocation-lt.

Thanks again for the support.