Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addResourceFileToGroup Is not being set for a target UUID that is different than the application native target #239

Open
jottenlips opened this issue Jun 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jottenlips
Copy link

Summary

I am trying to use IOSConfig.XcodeUtils.addResourceFileToGroup to add a font to my widget.
I expect the second checkbox to be selected after I run prebuild.

Screenshot 2024-06-20 at 10 49 51 AM

Code I am running:

    console.log(`Target UUID: ${targetUuid}`)

    for (const filePath of fontFiles) {
        console.log(`Adding resource file ${filePath}`)
        config.modResults = IOSConfig.XcodeUtils.addResourceFileToGroup({
            filepath: path.join('Fonts', filePath),
            groupName: 'Resources',
            project,
            isBuildFile: true,
            verbose: true,
            targetUuid, // I checked this UUID value and it is correct
        });
    }
    console.log('Resource files copied successfully.')

output of prebuild

✔ Updated package.json and added index.js entry point for iOS and Android
› Installing using npm
> npm install
Updating Info.plist files
plistFilePath: /Users/johnottenlips/vestaboard/expo-native-fonts/example/ios/exponativefontsexampleWidgetExtension/Info.plist
Copying files
SourceDir: /Users/johnottenlips/vestaboard/expo-native-fonts/example/fonts
TargetDir: /Users/johnottenlips/vestaboard/expo-native-fonts/example/ios/Fonts
Font files copied to ios/Fonts
Adding fonts to target exponativefontsexampleWidgetExtension
Font files:
[
  'Montserrat/Montserrat-Black.ttf',
  'Montserrat/Montserrat-BlackItalic.ttf',
  'Montserrat/Montserrat-Bold.ttf',
  'Montserrat/Montserrat-BoldItalic.ttf'
]
Searching for target exponativefontsexampleWidgetExtension
Target UUID: E8F07E52AAB34508AF54FEE8 "exponativefontsexampleWidgetExtension"
Adding resource file Montserrat/Montserrat-Black.ttf
Adding resource file Montserrat/Montserrat-BlackItalic.ttf
Adding resource file Montserrat/Montserrat-Bold.ttf
Adding resource file Montserrat/Montserrat-BoldItalic.ttf
Resource files copied successfully.

The script looks like it runs fine, however, the target exponativefontsexampleWidgetExtension is not selected when I open the workspace.

Thanks! I'm happy to provide more details if needed!###

Config Plugin

@config-plugins/apple-settings

What platform(s) does this occur on?

iOS

SDK Version

48, for this example, but I have also run into this on 50

Reproducible demo

Vestaboard/expo-native-fonts#1

 "@expo/config-plugins": "~7.2.2",
// I also tried the latest 8.0.5
npm i
npm plugin:build
cd example
npm i
npm run prebuild
open ios/exponativefontsexample.xcworkspace
Screenshot 2024-06-20 at 10 49 51 AM

exponativefontsexampleWidgetExtension should be selected when I open the workspace.

@jottenlips jottenlips added the bug Something isn't working label Jun 20, 2024
@jottenlips jottenlips changed the title addResourceFileToGroup Is not working for a target UUID that is different than the application native target addResourceFileToGroup Is not being set for a target UUID that is different than the application native target Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant