gitn00b1337 / expo-widgets

Bringing widget functionality to expo!
148 stars 12 forks source link

xcode override options #26

Closed zheorekhy closed 2 months ago

zheorekhy commented 2 months ago

Where Can I specify this? https://github.com/gitn00b1337/expo-widgets?tab=readme-ov-file#overriding-xcode-options xcode: { configOverrides: { SWIFT_VERSION: '5.0', },
},

I've got such error:

Updating podfile ⠹ Running prebuildAdding entitlement group.com.app.glucosense.expowidgets to config ✔ Finished prebuild ⚠️ Something went wrong running pod install in the ios directory. Command pod install failed. └─ Cause: Unable to determine Swift version for the following pods:

pod install --repo-update --ansi exited with non-zero code: 1

gitn00b1337 commented 2 months ago

On my phone so this might format badly, I've copy and pasted my prod config from app config ts. This is within the plugins array

[ "@bittingz/expo-widgets", { ios: { src: "./src/widgets/ios", devTeamId: "xxxx", mode: IS_DEV ? "development" : 'production', useLiveActivities: false, frequentUpdates: false, moduleDependencies: [ 'UKBreakdown.swift' ], xcode: { configOverrides: { SWIFT_VERSION: '5.0', // required to avoid SwiftEmitModule normal arm64 Emitting\ module\ for\ UKZeroWidgetExtension (in target 'UKZeroWidgetExtension' from project 'UKZero') // IMPORTANT: must be enclosed in quotes as done below '"EXCLUDED_ARCHS[sdk=iphonesimulator*]"': "arm64", }, }, }, android: { src: "./src/widgets/android", widgets: [ { "name": "MyWidgetProvider", "resourceName": "@xml/breakdown_widget_info" } ], distPlaceholder: 'com.example.widget' } } ],

zheorekhy commented 2 months ago

I've used the config in same way

[
        "@bittingz/expo-widgets",
        {
          "ios": {
            "src": "./widget/ios",
            "devTeamId": "C9853PNBF7",
            "mode": "production",
            "moduleDependencies": [],
            "useLiveActivities": false,
            "frequentUpdates": false,
            "entitlements": {
              "any xcode entitlement the widget needs": "entitlement value"
            },
            "xcode": {
              "configOverrides": {
                "SWIFT_VERSION": "5.4"
              }
            }
          }
        }
      ]

But I get same error:

⚠️ Something went wrong running pod install in the ios directory. Command pod install failed. └─ Cause: Unable to determine Swift version for the following pods:

zheorekhy commented 2 months ago

It's strange. I've removed terra plugin and had success with prebuild command. I've restored terra and still has success with prebuild.

gitn00b1337 commented 2 months ago

Your main project is swift 5 and you're changing the widget project to 5.4, which causes that error. They have to be the same so I would advise changing the config to swift 5.0

gitn00b1337 commented 2 months ago

Also, prebuild after changing config or you won't get the updated iOS project. Use --clean to avoid problems

zheorekhy commented 2 months ago

Yes I have now such config:

      [
        "@bittingz/expo-widgets",
        {
          "ios": {
            "src": "./widget/ios",
            "devTeamId": "C9853PNBF7",
            "mode": "production",
            "moduleDependencies": [],
            "useLiveActivities": false,
            "frequentUpdates": false,
            "entitlements": {
              "any xcode entitlement the widget needs": "entitlement value"
            },
            "xcode": {
              "configOverrides": {
                "SWIFT_VERSION": "5.0"
              }
            }
          }
        }
      ]
  Thank you very much.