shakebugs / shake-flutter

Bug reporting SDK for Flutter apps.
https://shakebugs.com
MIT License
15 stars 4 forks source link

Has Bitcode issue when publishing to app store #9

Open Albertbol opened 2 weeks ago

Albertbol commented 2 weeks ago

When publishing 17.0.1 version to appstore with xcode 16 (works with xcode 15) i get:

{"tool-version":"8.003.16003","tool-path":"\/Applications\/Xcode-16.0.app\/Contents\/SharedFrameworks\/ContentDeliveryServices.framework\/Versions\/A\/Frameworks\/AppStoreService.framework","os-version":"14.7.0","product-errors":[{"message":"Asset validation failed","userInfo":{"NSUnderlyingError":"Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Invalid Executable. The executable 'Runner.app\/Frameworks\/Shake.framework\/Shake' contains bitcode., id=109ed2d7-62e4-4811-8ddc-fa9b477c9da3, code=STATE_ERROR.VALIDATION_ERROR.90482, title=Asset validation failed, NSLocalizedFailureReason=Invalid Executable. The executable 'Runner.app\/Frameworks\/Shake.framework\/Shake' contains bitcode., NSLocalizedDescription=Asset validation failed}","NSLocalizedDescription":"Asset validation failed","iris-code":"STATE_ERROR.VALIDATION_ERROR.90482","NSLocalizedFailureReason":"Invalid Executable. The executable 'Runner.app\/Frameworks\/Shake.framework\/Shake' contains bitcode. (ID: 109ed2d7-62e4-4811-8ddc-fa9b477c9da3)"},"code":90482}]}

jaysignorello commented 1 week ago

Encountered the same issue.

jaysignorello commented 1 week ago

Either the framework has bitcode or has the bitcode marker flag enabled, as verified by running the following:

$ otool -l Pods/Shake/Sources/Shake.xcframework/ios-arm64/Shake.framework/Shake | grep __LLVM -1
  cmdsize 152
  segname __LLVM
   vmaddr 0x0000000000234000
--
  sectname __bundle
   segname __LLVM
      addr 0x0000000000234000

The output of this command should have been nothing if there is no bitcode.

jaysignorello commented 1 week ago

@Albertbol Here is a workaround if you need it:

Add the following to your Podfile

post_install do |installer|
  # Find bitcode_strip
  bitcode_strip_path = `xcrun -sdk iphoneos --find bitcode_strip`.chop!

  # Find path to Shake dependency
  path = Dir.pwd
  framework_path = "#{path}/Pods/Shake/Sources/Shake.xcframework/ios-arm64/Shake.framework/Shake"

  # Strip Bitcode sections from the framework
  strip_command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}" 
  puts "About to strip: #{strip_command}"
  system(strip_command)
end