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

iOS build issue which image_picker_web in pubspec.yaml #16

Closed
wterrill opened this issue Jun 10, 2020 · 7 comments
Closed

iOS build issue which image_picker_web in pubspec.yaml #16

wterrill opened this issue Jun 10, 2020 · 7 comments

Comments

@wterrill
Copy link

wterrill commented Jun 10, 2020

First, thanks so much for the plugin. This will become more popular as flutter web becomes more common.

Currently I have:
image_picker_web: ^1.0.9 in my pubspec.yaml file.

When building for iOS, I get the following error:

[ios/.symlinks/plugins/image_picker_web/example] flutter pub get
Running "flutter pub get" in example...                         
Cannot open file, path = '/Users/username/.pub-cache/global_packages/image_picker_web_example/pubspec.lock' (OS Error: No such file or directory, errno = 2)
pub get failed (66; Cannot open file, path = '/Users/username/.pub-cache/global_packages/image_picker_web_example/pubspec.lock' (OS Error: No such file or directory, errno = 2))
exit code 66

Since iOS isn't supported by this plugin, I took out all references in my code to the image_picker_web package, but I still get the error. The only way to avoid it is to comment out image_picker_web: ^1.0.9 in my pubspec.yaml and run 'flutter pub get'

I was hoping to use the kIsWeb boolean to decide whether or not to use image_picker or image_picker_web package... but it looks like when image_picker_web is in the pubspec.yaml file, the project can't be built for iOS.

Just to be clear, I'm not looking for any functionality for ios... I'm just hoping to be able to build with the package in the pubspec file. (and then, avoid that code with the kIsWeb boolean.

Any help would be appreciated.

@dimitristaufer
Copy link

I just spent several hours trying to solve the same problem.

@wterrill Have you had any success meanwhile?

@Ahmadre I'd appreciate any ideas.

Thanks for this plugin!

@wterrill
Copy link
Author

wterrill commented Jul 3, 2020

I have not. I had to abandon trying to make them both work. I imagine this will become more of a problem when flutter web comes out of beta

@vinnytwice
Copy link

Hi, @Ahmadre commented here #11 that web is now supported by official picker_image plugin, but it doesn't look it's the case at all, so yes, for now the only way to pic an image on web is this plugin, but when running it on iOs comment it out in pubspec.yaml.
It's a shame.

@secreal
Copy link

secreal commented Jul 22, 2020

i create helper to move all image picker web import in one place
and call this method on all my dart file using
Uint8List imageByte = await imagePickerWeb();

ImagePickerWeb.dart

import 'dart:typed_data';
  /* comment this line for android/ios build */
 import 'package:image_picker_web/image_picker_web.dart';

Future<Uint8List> imagePickerWeb() async {
  var result = new Uint8List(0);
 /* comment this line for android/ios build */
  result = await ImagePickerWeb.getImage(outputType: ImageType.bytes);
  return result;
}

then, when I want to build android / ios, I comment pubspec.yaml and the method here
hope that help

@github-actions
Copy link

github-actions bot commented Apr 7, 2021

Stale issue message

@github-actions
Copy link

github-actions bot commented May 8, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label May 8, 2021
@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

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

No branches or pull requests

4 participants