I'm having build issues with Mobile SDK 45.0

We have an app that has been working fine with Mobile SDK. Today I attempted to upgrade to Mobile SDK 45.0 and the application no longer runs.

Compile Time Errors

Runtime Errors

2022-06-01 09:17:57.902874-0700 SugarMobileEnhanced[83272:10530445] Apache Cordova native platform version 6.2.0 is starting.
2022-06-01 09:17:57.903036-0700 SugarMobileEnhanced[83272:10530445] Multi-tasking -> Device: YES, App: YES
2022-06-01 09:17:57.906566-0700 SugarMobileEnhanced[83272:10530445] Apache Cordova native platform version 6.2.0 is starting.
2022-06-01 09:17:57.906724-0700 SugarMobileEnhanced[83272:10530445] Multi-tasking -> Device: YES, App: YES
2022-06-01 09:17:58.053302-0700 SugarMobileEnhanced[83272:10530445] [ViewportSizing] maximumViewportInset cannot be larger than frame
2022-06-01 09:17:58.053465-0700 SugarMobileEnhanced[83272:10530445] [ViewportSizing] minimumViewportInset cannot be larger than frame
2022-06-01 09:17:58.445448-0700 SugarMobileEnhanced[83272:10530445] CDVWKWebViewEngine: trying to inject XHR polyfill
2022-06-01 09:17:58.445938-0700 SugarMobileEnhanced[83272:10530445] The preference key "AutoInjectCordova" is not defined and will default to "FALSE"
2022-06-01 09:17:58.446054-0700 SugarMobileEnhanced[83272:10530445] The preference key "AudioCanMix" is not defined and will default to "FALSE"
2022-06-01 09:17:58.447659-0700 SugarMobileEnhanced[83272:10530445] The preference key "MediaPlaybackAllowsAirPlay" is not defined and will default to "TRUE"
2022-06-01 09:17:58.450975-0700 SugarMobileEnhanced[83272:10530445] The preference key "KeyboardDisplayRequiresUserAction" is not defined and will default to "TRUE"
2022-06-01 09:17:58.451152-0700 SugarMobileEnhanced[83272:10530445] The preference key "AllowLinkPreview" is not defined and will default to "FALSE"
2022-06-01 09:17:58.451280-0700 SugarMobileEnhanced[83272:10530445] The preference key "ScrollEnabled" is not defined and will default to "FALSE"
2022-06-01 09:17:58.451403-0700 SugarMobileEnhanced[83272:10530445] The preference key "AllowBackForwardNavigationGestures" is not defined and will default to "FALSE"
2022-06-01 09:17:58.451511-0700 SugarMobileEnhanced[83272:10530445] CDVWKWebViewEngine will reload WKWebView if required on resume
2022-06-01 09:17:58.455075-0700 SugarMobileEnhanced[83272:10530445] Using Ionic WKWebView
2022-06-01 09:17:58.455534-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][console] 0.065923ms
2022-06-01 09:17:58.455729-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][handleopenurl] 0.054955ms
2022-06-01 09:17:58.456859-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][intentandnavigationfilter] 1.019955ms
2022-06-01 09:17:58.457066-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][gesturehandler] 0.059009ms
2022-06-01 09:17:58.458657-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][statusbar] 1.461029ms
2022-06-01 09:17:58.459861-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][file] 1.053929ms
2022-06-01 09:17:58.460157-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][keyboard] 0.164986ms
2022-06-01 09:17:58.460299-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][httpauthorization] 0.025988ms
2022-06-01 09:17:58.460505-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][pushnotification] 0.087023ms
2022-06-01 09:17:58.463228-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][splashscreen] 2.596974ms
2022-06-01 09:17:58.463384-0700 SugarMobileEnhanced[83272:10530445] [CDVTimer][TotalPluginStartup] 7.968068ms
2022-06-01 09:17:58.694411-0700 SugarMobileEnhanced[83272:10531357] [assertion] Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
2022-06-01 09:17:58.694607-0700 SugarMobileEnhanced[83272:10531357] [ProcessSuspension] 0x117004180 - ProcessAssertion: Failed to acquire RBS assertion 'ConnectionTerminationWatchdog' for process with PID=83329, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
2022-06-01 09:17:58.701693-0700 SugarMobileEnhanced[83272:10531357] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
2022-06-01 09:17:58.704078-0700 SugarMobileEnhanced[83272:10531357] [ProcessSuspension] 0x117004d80 - ProcessAssertion: Failed to acquire RBS assertion 'WebProcess Suspended Assertion' for process with PID=83329, error: Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}
2022-06-01 09:18:28.584073-0700 SugarMobileEnhanced[83272:10530445] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-06-01 09:18:44.698179-0700 SugarMobileEnhanced[83272:10530445] [HardwareKeyboard] -[UIApplication getKeyboardDevicePropertiesForSenderID:shouldUpdate:usingSyntheticEvent:], failed to fetch device property for senderID (778835616971358211) use primary keyboard info instead.
2022-06-01 09:18:44.699799-0700 SugarMobileEnhanced[83272:10530445] [HardwareKeyboard] -[UIApplication getKeyboardDevicePropertiesForSenderID:shouldUpdate:usingSyntheticEvent:], failed to fetch device property for senderID (778835616971358211) use primary keyboard info instead.

  • Could you try to run your custom app in debug mode in your desktop browser to see if you get any JavaScript errors there?

  • ; I'm using the simulator. I have been rebuilding the app with the different SDKs for a couple of years. Today is the 1st time that it won't open in the simulator. Can you provide instructions on how to run an iOS app in the browser?

  • My understanding is that you have some custom Javascript code that implements your custom functionality. In SDK 45 we've migrated from using outdated require/exports modules syntax to newer ES6 modules (import/export). Your old code is most likely now incompatible and needs to be updated to using newer import/export paradigm. The good news is that it is not difficult to do

    Information about how to run and debug in Chrome (and other useful stuff) can be found here:

    https://support.sugarcrm.com/Documentation/Mobile_Solutions/Mobile_SDK/Mobile_SDK_Developer_Guide/#Debugging

    Best regards, Eugene

  • There are warning as part of the

    ./install

    ./install 
    Command arguments:
    
    SUGAR_MOBILE_SDK_HOME = /usr/local/developer/mobile-sdk
    SDK_PATH = /Users/jeff.bickart/Downloads/sugar-mobile-sdk-45.0.657-1.4.2-2/sdk
    generate app-path = ''
    check-reqs-common started from "/Users/jeff.bickart/Downloads/sugar-mobile-sdk-45.0.657-1.4.2-2/sdk/sdk/check-reqs-common"
    
    nvm 0.39.1
    
    yarn: 1.22.19
    
    xcodebuild command found
    Xcode 13.4
    Build version 13F17a
    
    brew: Homebrew 3.4.11
    Homebrew/homebrew-core (git revision aeef3bb5a77; last commit 2022-06-02)
    
    check-reqs-common passed
    
    Preparing SDK...
    
    Copying /Users/jeff.bickart/Downloads/sugar-mobile-sdk-45.0.657-1.4.2-2/sdk into /usr/local/developer/mobile-sdk/45.0.657-1.4.2-2...
    
    Installing SDK node modules in /usr/local/developer/mobile-sdk/45.0.657-1.4.2-2 ...
    
    Found '/usr/local/developer/mobile-sdk/45.0.657-1.4.2-2/.nvmrc' with version <14.17.3>
    Downloading and installing node v14.17.3...
    Downloading https://nodejs.org/dist/v14.17.3/node-v14.17.3-darwin-x64.tar.xz...
    ############################################################################################################################################################################################################################################# 100.0%
    Computing checksum with shasum -a 256
    Checksums matched!
    Now using node v14.17.3 (npm v6.14.13)
    Creating default alias: default -> 14.17.3 (-> v14.17.3)
    yarn install v1.22.19
    [1/4] 🔍  Resolving packages...
    warning markdown-pdf > highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latest
    [2/4] 🚚  Fetching packages...
    [3/4] 🔗  Linking dependencies...
    warning " > file-loader@4.2.0" has incorrect peer dependency "webpack@^4.0.0".
    warning " > less-loader@5.0.0" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
    [4/4] 🔨  Building fresh packages...
    ✨  Done in 87.19s.
    \nInstalling native_template node modules
    yarn install v1.22.19
    warning package.json: No license field
    warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
    warning com.acme.crm: No license field
    [1/4] 🔍  Resolving packages...
    [2/4] 🚚  Fetching packages...
    [3/4] 🔗  Linking dependencies...
    [4/4] 🔨  Building fresh packages...
    ✨  Done in 2.70s.
    
    
    SDK PATH: /usr/local/developer/mobile-sdk/45.0.657-1.4.2-2
    

  • I started with a new project. There are more than 200 warnings from the SDK. I would expect that there are 0 warnings. There are a lot of deprecated functions that should be replaced. If we upgrade to Swift 5 the app breaks.

  • I'm following the instructions at https://support.sugarcrm.com/Documentation/Mobile_Solutions/Mobile_SDK/Mobile_SDK_Developer_Guide/#Custom_Actions,

    This results in appentries_custom_js.js:567 Uncaught (in promise) TypeError: customization.registerRecordAction is not a function

  • I think we are talking about these lines

    // custom/magic-action.js
    const customization = require('%app.core%/customization');
    const dialog = require('%app.core%/dialog');
    customization.registerRecordAction({


    As I've mentioned before in SDK 45 we've migrated from using outdated require/exports modules syntax to newer ES6 modules (import/export). Could you try using 'import customization from '%app.core%/customization'' instead of require and see if it works?

    It seems that example in documentation is outdated since SDK 45

  • Can you please fix the documentation? The only information we have is via the documentation.

  • - I filed a ticket with our documentation team to review this. Thanks!

    Alex Nassi
    SugarCRM | Sr. Community Manager