customerio / customerio-expo-plugin

MIT License
11 stars 9 forks source link

no rule to process file of type 'net.daringfireball.markdown' for architecture 'arm64' #130

Closed darnfish closed 8 months ago

darnfish commented 9 months ago

I'm getting the following error building the latest versions of customerio-reactnative and customerio-expo-plugin in Expo Application Services:

no rule to process file '/Users/expo/workingdir/build/ios/Pods/CustomerIOMessagingPush/Sources/MessagingPush/UserNotificationsFramework/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'CustomerIOMessagingPush' from project 'Pods')

package.json

    "expo": "~50.0.7",
    "customerio-expo-plugin": "1.0.0-beta.15",
    "customerio-reactnative": "^3.5.1",
Shahroz16 commented 9 months ago

Hey @darnfish, thanks for reaching out. hmm, this looks like a config issue more than anything else. Do you have explicit steps to reproduce it? Also, could you try out this SO recommended solution and see if this fixes it for you?

keeganpoppen commented 9 months ago

i am in this exact same hell and i cannot get out. and changing the ios project isn't helpful because it doesn't even use those settings anyway. i have literally spent the better part of a day and a half fucking around with this. the closest i've gotten was to make a build plugin that looks roughly like this:

SCRIPT = (
`
pre_install do |installer|
  Dir.glob('**/*.md').each do |path|
    puts path.to_s
    File.delete(path.to_s)
  end
end
`.trim()
)

module.exports = function deleteStupidMarkdownBullshit(config) {
  return withDangerousMod( config, [
    'ios',
    async ( config ) => {
      const file = path.join( config.modRequest.platformProjectRoot, 'Podfile' )

      const podfile = [await fs.promises.readFile(file, 'utf8'), SCRIPT].join('\n')
      console.log("\n\n\nPODFILE\n", podfile)
      await fs.promises.writeFile(file, podfile)
      return config
    }
  ])
}
keeganpoppen commented 9 months ago

i am in this exact same hell and i cannot get out. and changing the ios project isn't helpful because it doesn't even use those settings anyway. i have literally spent the better part of a day and a half fucking around with this. the closest i've gotten was to make a build plugin that looks roughly like this:

SCRIPT = (
`
pre_install do |installer|
  Dir.glob('**/*.md').each do |path|
    puts path.to_s
    File.delete(path.to_s)
  end
end
`.trim()
)

module.exports = function deleteStupidMarkdownBullshit(config) {
  return withDangerousMod( config, [
    'ios',
    async ( config ) => {
      const file = path.join( config.modRequest.platformProjectRoot, 'Podfile' )

      const podfile = [await fs.promises.readFile(file, 'utf8'), SCRIPT].join('\n')
      console.log("\n\n\nPODFILE\n", podfile)
      await fs.promises.writeFile(file, podfile)
      return config
    }
  ])
}

but this doesn't work because then it complains about not having hashes for some of the files. so then i also tried injecting an xcode build rule in there for markdown files:

SCRIPT = (
`
def add_build_rule(target_name, project)
  new_rule = project.new(Xcodeproj::Project::Object::PBXBuildRule)

  project.targets.each do |target|
    if target.name == target_name
      if target.build_rules.count != 0
        puts "#{target.name} already has a build rule."
        return
      end
      puts "Updating #{target.name} rules"

      new_rule.name = 'My Custom Rule'
      new_rule.compiler_spec = 'com.apple.compilers.proxy.script'
      new_rule.file_patterns = '*.md README.md'
      new_rule.file_type = 'net.daringfireball.markdown'
      new_rule.is_editable = '1'
      new_rule.output_files = []
      new_rule.input_files = []
      new_rule.output_files_compiler_flags = []
      new_rule.script = "echo helloheahighl;asgilahes"
      target.build_rules.append(new_rule)
    end
  end

  project.objects_by_uuid[new_rule.uuid] = new_rule
  project.save()
end
`
)
SCRIPT2=(
`
add_build_rule("MyTarget", installer.pods_project)
`
)

but i can't get it to take, for whatever reason.

the internet seems to think this is some sort of arm64 support problem somewhere b/w terminal, xcode, node, etc. ... the "proper solution" is definitely to not copy the README.md over in the resources, because that actually fixes the problem and the README files are definitely not needed in the Pods project. as for why, though... i still don't know, and it makes me want to jump off a bridge.

keeganpoppen commented 9 months ago

the funny thing is that i actually got it to work fine in a project that i did on my own, but i can't get it to work in this other project that had more stuff in it before i brought in customerio...

keeganpoppen commented 9 months ago

so i looked into this some more, and the crux of it comes down to this setting here-- Compile Sources As / GCC_INPUT_FILETYPE: image

because one of the "sources" is a markdown file, clang vomits... but only for arm64, for whatever reason. i have no idea how it decides what to do for different architectures, and the only argument i see that you can pass in to clang itself is -x<language>, --language <arg>, --language=<arg> Treat subsequent input files as having type <language>, which seems unfathomably useless, since i don't see how we'd really get direct control over what args get passed in front of what files...

i also tried to subvert clang's "interpolating database" for the last hour or so to try and trick os x and or clang into thinking that cat is a compiler, but no dice... xD

Shahroz16 commented 9 months ago

Hey @keeganpoppen thank you for sharing your insights and struggles 😓 ! This is an odd one indeed, we are looking into it as well but the problem is we aren't able to reproduce it so we aren't sure if our attempts are going to resolve this issue.

I see that you don't face this issue in a sample project, otherwise we would have asked for it and tried to debug it further.

Shahroz16 commented 9 months ago

I found another similar issue, maybe try updating xcode and react native version?

darnfish commented 8 months ago

Unfortunately I can't update Xcode from Expo Application Services Build environment :~(

ptheofan commented 8 months ago

Same issue here with x86_64 architecture

no rule to process file 'xxx/xxx/ios/Pods/CustomerIOMessagingPush/Sources/MessagingPush/UserNotificationsFramework/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'CustomerIOMessagingPush' from project 'Pods')

Any solutions?

levibostian commented 8 months ago

Thank you everyone for raising this issue.

Cause of the issue

Recently, we created a new .md file in our source code for internal documentation purposes. This new file was packaged in recent SDK releases which caused this issue. We thank you all for bringing this issue to our attention.

Plan to fix this issue

We are releasing a fix for the iOS SDK as we speak with updates for React Native and Expo coming shortly after. I will send a message in this issue when the fix has been released.

darnfish commented 8 months ago

😄

Artboard

levibostian commented 8 months ago

The Customer.io React Native version 3.5.3 has been released to npm which includes this fix.

Update your package.json to install customerio-reactnative 3.5.3, then make sure to also run pod update --project-directory=ios, if needed, to install the latest native iOS SDK update in your app.

Thanks again for reporting this to us! I'll close this issue now that the fix is out. Comment back if you are still experiencing issues and we'll re-open it.