OneSignal / OneSignal-Cordova-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Other
251 stars 199 forks source link

[IOS] bitcode is imbalanced error after upgrading from v2 -> v3 | Fastlane #802

Closed taniket15 closed 2 years ago

taniket15 commented 2 years ago

Description:

While upgrading our cordova app to support android SDK-31 we also upgraded onesignal-cordova-plugin from 2.11.4 to 3.0.4 and made code changes as per the new API mentioned here - https://documentation.onesignal.com/docs/step-by-step-cordova-2x-to-300-upgrade-guide

android-minSdkVersion 24 android-targetSdkVersion 31 IOS Deployment Target 14

We are using fastlane CI setup to create and upload build for IOS.

On IOS we started seeing error regarding exportOptionsPlist error for key "uploadBitcode": cannot upload bitcode because bitcode is imbalanced

[18:12:26]: Generated plist file with the following values:
[18:12:26]: ▸ -----------------------------------------
[18:12:26]: ▸ {
[18:12:26]: ▸   "signingStyle": "manual",
[18:12:26]: ▸   "manageAppVersionAndBuildNumber": false,
[18:12:26]: ▸   "provisioningProfiles": {
[18:12:26]: ▸     "com.dev": "dev appstore profile"
[18:12:26]: ▸   },
[18:12:26]: ▸   "method": "app-store",
[18:12:26]: ▸   "uploadSymbols": true,
[18:12:26]: ▸   "uploadBitcode": true
[18:12:26]: ▸ }
[18:12:26]: ▸ -----------------------------------------
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/gy/cx4nsxdd6vdcnt28cz7m39r00000gn/T/gym_config20220718-21905-sfllzc.plist -archivePath '/Users/Library/Developer/Xcode/Archives/2022-07-18/Dev 2022-07-18 18.11.47.xcarchive' -exportPath /var/folders/gy/cx4nsxdd6vdcnt28cz7m39r00000gn/T/gym_output20220718-21905-1w73f6u BUNDLE_IDENTIFIER=com.dev 'PROVISIONING_PROFILE_SPECIFIER=dev appstore profile'
2022-07-18 18:12:27.644 xcodebuild[24440:188743] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-07-18 18:12:27.645 xcodebuild[24440:188743] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-07-18 18:12:27.968 xcodebuild[24440:188743] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/gy/cx4nsxdd6vdcnt28cz7m39r00000gn/T - Dev_2022-07-18_18-12-27.967.xcdistributionlogs".
error: exportArchive: exportOptionsPlist error for key "uploadBitcode": cannot upload bitcode because bitcode is imbalanced

Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key "uploadBitcode": cannot upload bitcode because bitcode is imbalanced" UserInfo={NSLocalizedDescription=exportOptionsPlist error for key "uploadBitcode": cannot upload bitcode because bitcode is imbalanced}

** EXPORT FAILED **
[18:12:37]: Exit status: 70

+---------------+-------------------------+
|            Build environment            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.207.0                 |
| export_method | app-store               |
| sdk           | iPhoneOS15.5.sdk        |
+---------------+-------------------------+
[18:12:37]: Error packaging up the application

+------+------------------------+-------------+
|              fastlane summary               |
+------+------------------------+-------------+
| Step | Action                 | Time (in s) |
+------+------------------------+-------------+
| 1    | default_platform       | 0           |
| 2    | automatic_code_signing | 0           |
| 3    | match                  | 5           |
| 4    | update_project_team    | 0           |
| 💥   | build_app              | 55          |
+------+------------------------+-------------+

[18:12:37]: fastlane finished with errors

[!] Error packaging up the application

Environment

Cordova - v9 Cordova IOS - v6.2.0 Cordova Androdi - v10.1.2 Xcode - v13.3.1

Cordova Plugin List -

code-push 3.0.1 "CodePushAcquisition"
com.lampa.startapp 6.1.6 "startApp"
com.telerik.plugins.healthkit 0.5.5 "HealthKit"
cordova-open-native-settings 1.5.5 "Native settings"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-advanced-http 3.3.1 "Advanced HTTP plugin"
cordova-plugin-android-fingerprint-auth 1.5.0 "FingerprintAuth"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-appcenter-analytics 0.5.1 "App Center Analytics for Cordova"
cordova-plugin-appcenter-shared 0.5.1 "App Center shared code for Cordova"
cordova-plugin-apprate 1.7.2 "AppRate"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-calendar 5.1.6 "Calendar"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-code-push 2.0.0 "CodePush"
cordova-plugin-customurlscheme 5.0.2 "Custom URL scheme"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-file 7.0.0 "File"
cordova-plugin-firebasex 14.0.0-cli "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.2 "Geolocation"
cordova-plugin-image-picker 1.1.1 "ImagePicker"
cordova-plugin-inappbrowser 4.0.1-dev "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-printer 0.8.0 "Printer"
cordova-plugin-safariviewcontroller 1.6.0 "SafariViewController"
cordova-plugin-secure-storage-echo 5.0.0 "SecureStorage"
cordova-plugin-settings-hook 0.2.7 "Cordova Settings Hooks"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-touch-id 3.3.1 "Touch ID"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
onesignal-cordova-plugin 3.0.4 "OneSignal Push Notifications"
uk.co.workingedge.phonegap.plugin.launchnavigator 5.0.6 "Launch Navigator"

Fastlane Config -

build_app(
        workspace: workspacepath,
        scheme: ENV["PROJECT_NAME"],
        xcargs: settings_to_override,
        export_method: "app-store",
        export_options: {
          signingStyle: "manual",
          manageAppVersionAndBuildNumber: false
        },
        include_symbols: true,
        include_bitcode: true,
        codesigning_identity: ENV["SIGNING_IDENTITY"]
      )

Anything else:

jkasten2 commented 2 years ago

@taniket15 "cannot upload bitcode because bitcode is imbalanced" means there is a mixture of the bitcode setting, some places it is disabled and others it is enabled. See this stackoverflow post for more details: https://stackoverflow.com/a/37612626/1244574

OneSignal has bitcode enabled, and it looks like build process does as I see include_bitcode: true. So possibly that setting isn't working, anther framework doesn't have bitcode, or something in your cocoapods file is not enabling bitcode.

taniket15 commented 2 years ago

Thanks, @jkasten2 for the help.

I tried building the app with -

        include_symbols: false,
        include_bitcode: false,

and it was successfully deployed with notifications working for both IOS/Android.

jkasten2 commented 2 years ago

@taniket15 Thanks for letting us know, good to hear you got it working.