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

Incomplete bit code when uploading to app store #61

Closed
superandrew213 opened this issue Sep 5, 2016 · 61 comments
Closed

Incomplete bit code when uploading to app store #61

superandrew213 opened this issue Sep 5, 2016 · 61 comments

Comments

@superandrew213
Copy link
Contributor

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.8.0
  • react-native v0.32.0

Steps to reproduce

  1. Archive and upload to app store

Attachments

screen shot 2016-09-05 at 6 51 09 pm

@superandrew213
Copy link
Contributor Author

Getting this now after cleaning, restarting, reinstalling, etc

screen shot 2016-09-05 at 7 05 05 pm

@ivpusic
Copy link
Owner

ivpusic commented Sep 5, 2016

you are getting this error because pre-built frameworks are built for simulator and device ARCHs. This is good for development because you don't have to worry about supported arch when building and running on different platforms.

Before uploading to appstore, you have to strip away simulator platforms, and then use stripped versions of frameworks instead of current ones.

You can also remove current pre-built libraries for embedded binaries, and add the ones from Libraries/imageCropPicker/Libraries/XXX/Product/XXX.framework which will be there after you build project for specific platform.

@Mentioum
Copy link

Mentioum commented Sep 5, 2016

@ivpusic could you give a step by step for this process as I'm having real trouble getting rid of this error. It's definitely due to a misunderstanding of mine of how xcode works?

@ivpusic
Copy link
Owner

ivpusic commented Sep 5, 2016

then probably latter will be easier for you.

go to project General tab, scroll down to Embedded binaries. You will see that there are two pre-built frameworks. You can remove them, build project for Device => this will produce Frameworks built for Device platform. Click + under Embedded binaries, and now you can add these two frameworks.

screen shot 2016-09-05 at 6 15 54 pm

Later probably you will want to switch back to pre-built frameworks because it is easier during development.

@superandrew213
Copy link
Contributor Author

@ivpusic I'm still getting the same error if I do that.

@superandrew213
Copy link
Contributor Author

This is what I did:

  1. Completely remove react-native-image-crop-picker
  2. Install and link react-native-image-crop-picker
  3. Build for "Generic iOS Device"
  4. Add the two frameworks from the libraries folder to "Embedded Binaries"
  5. Archive and upload

Before upload starts I get the same error in the first screenshot

@ivpusic
Copy link
Owner

ivpusic commented Sep 6, 2016

can you go to Project -> Build Settings -> Enable Bitcode. Is it yes or no?

@superandrew213
Copy link
Contributor Author

Yes, it's enabled.

@ivpusic
Copy link
Owner

ivpusic commented Sep 6, 2016

hm, then would be cool if you can investigate what is happening. Maybe try flags/options from this link http://stackoverflow.com/questions/34959767/whats-the-difference-between-fembed-bitcode-and-bitcode-generation-mode. Probably for some reason bitcode is not included in built frameworks, and as you said your app has it, which is causing this incompatibility.

You can experiment by editing build options of each framework, build it and then link it with your app. Please keep me posted about progress here.

@superandrew213
Copy link
Contributor Author

Have you been able to upload to itunesconnect yet?

@ivpusic
Copy link
Owner

ivpusic commented Sep 6, 2016

nope, my personal project is still in development, so I didnt try upload yet.

@superandrew213
Copy link
Contributor Author

Adding -fembed-bitcode flag to frameworks fixes it.

@ivpusic
Copy link
Owner

ivpusic commented Sep 6, 2016

great. will release new version with this fix.

@ivpusic ivpusic closed this as completed Sep 6, 2016
@ivpusic
Copy link
Owner

ivpusic commented Sep 6, 2016

@superandrew213
Copy link
Contributor Author

Great! thanks

@parkerdan
Copy link

@superandrew213, Have you released anything with this package? This package works great on the simulator, but I put something on TestFlight and memory usage explodes when selecting photos with this...

@ivpusic
Copy link
Owner

ivpusic commented Sep 7, 2016

@parkerdan what "memory usage explodes" means in your context? How much memory usage is increased? In my testings when running on device memory usage is ok. "Exploding" comes if I send base64 image data over the RN bridge, which is something you should generally avoid with react-native.

@parkerdan
Copy link

I love your work on being able to select multiple photos, and everything is great until the app is on the phone via TestFlight.

My app is 80mb according to iOS Settings->General->Storage->Manage Storage. My app got to 160mb after selecting a few photos with your package. When I changed to react-native-image-picker, and added the same photos to the app, the memory was at 85mb.

@parkerdan
Copy link

Yes, i"m including base64.

@parkerdan
Copy link

@ivpusic, but I also get base64 from the other package without the memory increase....

@ivpusic
Copy link
Owner

ivpusic commented Sep 7, 2016

sorry, I thought you were talking about RAM usage, but you are talking about disk usage? in that case reason why memory increases is because files are written to tmp location which is cleaned up automatically at some point. Maybe would be a good idea to export some cleanup function, so users can call it once they don't need file(s) anymore.

@parkerdan
Copy link

I would love a clean-up function. Any idea how to go about that?

@ivpusic
Copy link
Owner

ivpusic commented Sep 7, 2016

@parkerdan here you go https://github.com/ivpusic/react-native-image-crop-picker/releases/tag/v0.8.2

@superandrew213
Copy link
Contributor Author

@parkerdan I delete images in temp folder as soon as I am done with them. You can use react-native-fs for that RNFS.unlink(path).

@ivpusic it would be better to let react-native-fs handle that

@parkerdan
Copy link

@superandrew213, Thanks for the tip

@ivpusic
Copy link
Owner

ivpusic commented Sep 8, 2016

@superandrew213 let't keep this option as well, because many people doesn't use fs package

@playing
Copy link

playing commented Sep 13, 2016

@ivpusic when add framework into Embedded Binaries, you can use add other and add file in node_modules/react-native-crop-picker/ios/imageCropPickerSDK/xxx.framework, so you dont need to remove and add framework every time.

@roycclu
Copy link

roycclu commented Jan 13, 2018

hello,
I used cocoapods, and did according to the instruction. Remove pre-built from embedded binaries, and then added them in from Libraries/imageCropPicker/Libraries//Products/
But still get the following error:
" UserInfo={NSLocalizedDescription=Failed to verify bitcode in QBImagePicker.framework/QBImagePicker: error: Cannot extract bundle from /var/folders/wf/wxwbrgls6fg49tyhp_dx35cc0000gn/T/XcodeDistPipeline.HKc/Root/Payload/timecapsule.app/ImageCropPickerSDK/QBImagePicker.framework/QBImagePicker (x86_64)
Any idea how to solve this?

@roycclu
Copy link

roycclu commented Jan 13, 2018

@ShuBuShao

Also tried toggling the Enable Bitcode to Yes, and then to No.
Still getting this error:

Failed to verify bitcode in QBImagePicker.framework/QBImagePicker

Any other suggestions?

@bubuzzz
Copy link

bubuzzz commented Feb 19, 2018

I also have this issue with the latest version. Have no idea how to resolve it until I manually delete all the binary files, clean, clean build folder and archive project again. Finally it worked.

In general, if some one can make it work but some one cannot make it work, then first thing should come up is try to clean the project as much as we can. This is a good experience

@canastro
Copy link

canastro commented May 14, 2018

I already have everything working properly on my dev environment. Now I want to upload it to testflight. I have a circle ci that will be triggered on push to master that will build the ipa and push it to testflight.

In order to not have to change my project manually every time I want to push to master (and trigger circle ci), I need to be able to delete these files before I start to build the IPA.

If you are using pre-built frameworks from ios/ImageCropPickerSDK, then before deploying app to production you should strip off simulator ARCHs from these,

This is not very clear for me. Which are the files I need to delete?


EDIT:

@ivpusic Is it something like this: https://github.com/oney/react-native-webrtc/blob/master/Documentation/iOSInstallation.md#appendix-b---apple-store-submission ? Could we benefit to a script similar to the one in react-native-webrtc?

Based on that script I created this: https://gist.github.com/canastro/e8cf409f9a241cfb1d0763cdb66f3dc8 and now I run:

  • node scripts/ios_arch.js --extract && node scripts/ios_arch.js --device && node scripts/ios_arch.js --clear

And then:

  • bundle exec fastlane ios build match_type:appstore export_method:app-store ipa_name:xxxx.ipa

Now the error I have is:

ERROR ITMS-90685: "CFBundleIdentifier Collision. 
There is more than one bundle with the CFBundleIdentifier value 'com.ruslanskorb.RSKImageCropper' under the iOS application 'xxxx.app'."

ERROR ITMS-90685: "CFBundleIdentifier Collision. 
There is more than one bundle with the CFBundleIdentifier value 'jp.questbeat.QBImagePicker' under the iOS application 'xxxx.app'."

Any tips on what I might be missing?

@codetay
Copy link

codetay commented Sep 4, 2018

My problem was solved after i deleted the folder installed by the Post-install steps 2

@mayankbaiswar-CSE
Copy link

@canastro did you happen to solve "CFBundleIdentifier Collision"? I'm getting that too!

@mdio
Copy link
Contributor

mdio commented Sep 11, 2018

@mayankbaiswar-CSE I tried what @codetay suggested (removing the manually added reference to ImageCropPickerSDK in Xcode) and this solved the collision problem for me.

Also I took the script from https://github.com/oney/react-native-webrtc/blob/master/tools/ios_arch.js that @canastro mentioned and converted it into helper functions for fastlane.

DEPENDENCIES_TO_STRIP = ['RSKImageCropper', 'QBImagePicker']

def strip_simulator_archs()
  archs_to_keep = ['armv7', 'armv7s', 'arm64']

  DEPENDENCIES_TO_STRIP.each { |dependency|
    Dir.chdir("../node_modules/react-native-image-crop-picker/ios/ImageCropPickerSDK/#{dependency}.framework") do
      sh("cp #{dependency} /tmp/#{dependency}")

      archs_to_keep.each { |arch|
        sh("lipo -extract #{arch} #{dependency} -o #{dependency}-#{arch}")
      }
      createParameters = archs_to_keep.reduce('') { |total, arch| "#{total} #{dependency}-#{arch}" }
      sh("lipo -o #{dependency} -create#{createParameters}")
      sh("rm #{dependency}-*")
    end
  }
end

def restore_simulator_archs()
  DEPENDENCIES_TO_STRIP.each { |dependency|
    Dir.chdir("../node_modules/react-native-image-crop-picker/ios/ImageCropPickerSDK/#{dependency}.framework") do
      sh("mv /tmp/#{dependency} #{dependency}")
    end
  }
end

In our release lane, strip_simulator_archs is called before and restore_simulator_archs after gym.
That way you don't have to fiddle around to have both a working simulator build and one for TestFlight.

@umut885
Copy link

umut885 commented Sep 15, 2018

Adding -fembed-bitcode flag to frameworks fixes it.

excuse me, where exactly i do have to put this flag? Could provide a detailed instruction?

armaanahluwalia added a commit to armaanahluwalia/zulip-mobile that referenced this issue Oct 19, 2018
This commit replaces react-native-image-picker in favor of
react-native-image-crop-picker.

It solves a few key issues like being able to -
1) Select multiple images
2) Being able to downsample image quality.  See issue zulip#2749
3) Being able to scale down images.
4) Being faster at processing images.

The removal of react-native-image-picker was done by:
1) Removing dependency from yarn
2) Running react-native unlink react-native-image-picker
3) Checking the initial commit and removing any code that may
not be covered by unlink. For reference the initial commit that
introduced changes was 515436a.

The addition of react-native-image-crop-picker is done by following the installation
instructions at
https://github.com/ivpusic/react-native-image-crop-picker/blob/07d321e3bc279b0ad218817245264cda6a7c77cb/README.md

This involved:
1) Adding the dependency via yarn
2) Running react-native link react-native-image-crop-picker
3) Adding the frameworks under embedded binaries as described by this comment
   ivpusic/react-native-image-crop-picker#61 (comment)
   and also under the "Manual" section of the PostInstall steps.

Note: We are ignoring a few of the PostInstall steps described in the Readme namely:

1) Changing the deployment target to 8.0 - We already have a higher target set.
2) The steps described in "To localizate the camera / gallery text buttons" -
   I dont believe this is required and the instructions seem vague.
3) Adding "useSupportLibrary" as described in a previous commit -
   This is required for cropping images and we don't have that feature enabled currently.
   When we enable that feature we will want to add this as well.

Note: We want to test this commit is working by archiving the project and uploading to
TestFlight.
armaanahluwalia added a commit to armaanahluwalia/zulip-mobile that referenced this issue Dec 8, 2018
This commit replaces react-native-image-picker in favor of
react-native-image-crop-picker.

It solves a few key issues like being able to -
1) Select multiple images
2) Being able to downsample image quality.  See issue zulip#2749
3) Being able to scale down images.
4) Being faster at processing images.

The removal of react-native-image-picker was done by:
1) Removing dependency from yarn
2) Running react-native unlink react-native-image-picker
3) Checking the initial commit and removing any code that may
not be covered by unlink. For reference the initial commit that
introduced changes was 515436a.

The addition of react-native-image-crop-picker is done by following the installation
instructions at
https://github.com/ivpusic/react-native-image-crop-picker/blob/07d321e3bc279b0ad218817245264cda6a7c77cb/README.md

This involved:
1) Adding the dependency via yarn
2) Running react-native link react-native-image-crop-picker
3) Adding the frameworks under embedded binaries as described by this comment
   ivpusic/react-native-image-crop-picker#61 (comment)
   and also under the "Manual" section of the PostInstall steps.

Note: We are ignoring a few of the PostInstall steps described in the Readme namely:

1) Changing the deployment target to 8.0 - We already have a higher target set.
2) The steps described in "To localizate the camera / gallery text buttons" -
   I dont believe this is required and the instructions seem vague.
3) Adding "useSupportLibrary" as described in a previous commit -
   This is required for cropping images and we don't have that feature enabled currently.
   When we enable that feature we will want to add this as well.

Note: We want to test this commit is working by archiving the project and uploading to
TestFlight.
@prasad456
Copy link

can you go to Project -> Build Settings -> Enable Bitcode. Is it yes or no?

YES

@mieszko4
Copy link
Contributor

I am a bit confused about Production build step for non-pod installation.

I followed all steps for non-pod including post-install (adding RSKImageCropper.framework and QBImagePicker.framework manually) and I run it in simulator - all worked well.
Then I archived the apk and sent it to testflight, installed it from testflight - that also all worked well.

I am using xcode 10, RN 0.57, deployment target 9.0, iOS 12.1.2 and no pods.
I use [email protected] to take a picture and to select from library then I send its base64 to my server.

Is striping away simulator platforms still a required step?

@douglasjunior
Copy link

douglasjunior commented Jan 22, 2019

I also can't use cocoapods, so here is the setup process that worked for me in dev and prod.

  1. Install the react-native-image-crop-picker
  2. react-native link react-native-image-crop-picker
  3. Select Generic iOS Device as a target
  4. Menu Product -> Clean and then Product -> Build.
  5. Go to the folder /Users/<user>/Library/Developer/Xcode/DerivedData/<app-name>/Build/Products/Debug-iphoneos.
  6. Copy the QBImagePicker.framework and RSKImageCropper.framework to your <project>/ios folder, and then drag and drop both from <project>/ios to Embedded binaries.
  7. Archive and Upload 🎉

@paolospag
Copy link

paolospag commented Jan 29, 2019

@douglasjunior @mieszko4 @ivpusic
So, having followed the installation step without Cocapoads (manual installation), can I avoid the production step?

With QBImagePicker.framework and RSKImageCropper.framework in Embedded Binaries and with Debug scheme my app works well, but I'm uploading it on TestFlight and I would like to understand if I have to do production step or not.

@douglasjunior
Copy link

Following my steps you are ready for development and production.

@paolospag
Copy link

@douglasjunior I do not understand what you do exactly between point 5 and point 6

@douglasjunior
Copy link

douglasjunior commented Jan 29, 2019

After step 4 the compiled frameworks are generated on step 5 folder. You need to copy them to your <project>/ios folder, and then link both as Embedded binaries. What you do not understand?

@mieszko4
Copy link
Contributor

That's the point - I did not embed binaries from derived folder (i.e. I did not do steps 5 and 6).
I just followed the initial instructions on README.md and it worked for me both on simulator and testflight and I am just confused why. I will recheck this.

@mieszko4
Copy link
Contributor

Please mind I am not an expert in iOS stuff.
I rechecked this and I did:

  • rm -fr /Users/mieszko4/Library/Developer/Xcode/DerivedData
  • rm -fr ./node_modules
  • npm ci
  • I opened the project (I have no cocoapod) in xcode, I set target as Generic iOS Device
  • I cleaned the project
  • I went to General tab and under Embeded Binaries I pressed + and I chose RSKImageCropper.framework and QBImagePicker.framework (they were automatically expanded and located under Libraries/imageCropPicker/Libraries/_framework_name_.xcodeproj/Products/_framework_name_.framework)

After adding them I've noticed that their paths are taken from DerivedData folder, i.e. /Users/mieszko4/Library/Developer/Xcode/DerivedData/NAMEOFPROJECT-gyhgygejsxewwjakamghtszkqurn/Build/Products/Debug-iphoneos/QBImagePicker.framework. This path points to no file though.

I archived the app and sent to the store - no problem.
I installed the app on Testflight and it is all good.

After that I changed target to iPhone XR, I built it and run on simulator - again it is all good.

This is why I am confused why there is additional step for production only as it seems that the post-install ios Step 2 automatically does what needs to be done for production.

@paolospag
Copy link

@mieszko4 oh sure, I'm little bit confused.
I probably didn't do all your steps, but having installed everything manually (without Cocoapods), I fully followed all the steps explained in the section Post-install steps (https://github.com/ivpusic/react-native-image-crop-picker#post-install-steps) for iOS and it works fine, both debug and release. I also tried with TestFlight.

I also find RSKImageCropper.framework and QBImagePicker.framework under Libraries/imageCropPicker/Libraries/_framework_name_.xcodeproj/Products/_framework_name_.framework (automatically located here).

I have this situation in Xcode:
imagecroppicker-xcode

So, why does it work anyway?
Is Production build (https://github.com/ivpusic/react-native-image-crop-picker#production-build) still necessary? @ivpusic

@douglasjunior
Copy link

@paolospag you need to copy and paste the compiled frameworks to your <project>/ios, and then link the frameworks from <project>/ios to Embbeded binaries.

@liuyunzyj
Copy link

@douglasjunior Why is mine still not working? Is there any missing steps?
image
image
image

@liuyunzyj
Copy link

@danilobuerger
image

image

@sivasankarchimata
Copy link

Can i use react-native-image-crop-picker with expo ,

@balwinder4264
Copy link

img is file
const { stream, filename } = await img;

stream is undefined but showing filename.
Anybody know how to get stream from image

FrontEnd :ReactNative
Backend :Nodejs Apollo Boost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests