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

Installation always returns an error #144

Closed
ghost opened this issue Mar 16, 2021 · 11 comments
Closed

Installation always returns an error #144

ghost opened this issue Mar 16, 2021 · 11 comments

Comments

@ghost
Copy link

ghost commented Mar 16, 2021

Describe the bug
When I run flutter pub run flutter_native_splash:create i always get the following error after android finishes

[iOS] Updating LaunchScreen.storyboard with width, and height
Unhandled exception:
FileSystemException: Cannot copy file to 'ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png', path = 'assets/images/background.png' (OS Error: The system cannot find the path specified.
, errno = 3)
#0      _File.throwIfError (dart:io/file_impl.dart:635:7)
#1      _File.copySync (dart:io/file_impl.dart:340:5)
#2      _createBackground (package:flutter_native_splash/ios.dart:242:33)
#3      _createiOSSplash (package:flutter_native_splash/ios.dart:66:3)
#4      tryCreateSplashByConfig (package:flutter_native_splash/supported_platform.dart:65:5)
#5      tryCreateSplash (package:flutter_native_splash/supported_platform.dart:27:3)
#6      createSplash (package:flutter_native_splash/flutter_native_splash.dart:17:3)
#7      main (file:///C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_native_splash-1.1.1+1/bin/create.dart:5:3)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
pub finished with exit code 255

To Reproduce

Just add the image and required lines to pubspec.yaml and run the create command

Expected behavior
The Installation should work

Flutter doctor

flutter doctor -v
[√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.19041.867], locale en-US)
    • Flutter version 2.0.2 at C:\flutter
    • Framework revision 8962f6dc68 (5 days ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\USER\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.54.3)
    • VS Code at C:\Users\USER\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.20.0

[√] Connected device (3 available)
    • ONEPLUS A6003 (mobile) • 6b59630b • android-arm64  • Android 10 (API 29)
    • Chrome (web)           • chrome   • web-javascript • Google Chrome 89.0.4389.82
    • Edge (web)             • edge     • web-javascript • Microsoft Edge 89.0.774.54

• No issues found!
@jonbhanson
Copy link
Owner

@NicolasSimmonds
Do you have a assets/images/background.png file in place?
Can you post your flutter_native_splash config?

@ghost
Copy link
Author

ghost commented Mar 16, 2021

Yes i have the assets/images/background.png file in place. Here is the config

flutter_native_splash:
  background_image: assets/images/background.png

@jonbhanson
Copy link
Owner

jonbhanson commented Mar 16, 2021

I'm a little stumped at the moment. errno = 3 does not seem to have a common solution. The internet suggests it could be symlink related or partially synced onedrive. Could it be something like that? Can you copy the assets/images/background.png file mannually to ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png?

@AJAYK-01
Copy link

AJAYK-01 commented Mar 17, 2021

Hey, I too had this same issue for Android (errno 2) as well as iOS (errno 2), but the splash screen seems to work fine even if this error occurs.

@jonbhanson
Copy link
Owner

@AJAYK-01 that is good information. Can you post the exception?

@ghost
Copy link
Author

ghost commented Mar 17, 2021

I ended up copying the images into the corresponding folders and everything works fine! but could not manage to make the script work. Very strange

@AJAYK-01
Copy link

@AJAYK-01 that is good information. Can you post the exception?

For Android:

image

Now due to the error the script doesn't proceed further, BUT, the android splash screen has actually been added and is working fine.

For iOS:

Now to make ios splash screen, I have to explicitly give android: false, and re run the script, which skips the android generation part(and hence the error part) and successfully create ios splash screens and again throws similar error.

image

To Summarise

Both android and ios splash screens get generated succesfully, BUT during the generation of each, the scripts pops out an error.

And because of the error during android splash generation, the script exits without making ios splash screens, and hence giving android false and rerunning solves the issue and makes ios splash screens and pops out the same err 2.

@AJAYK-01
Copy link

By the way, this error only pops out for me when i try to create splash screens with the background_image property

@jonbhanson
Copy link
Owner

@NicolasSimmonds @AJAYK-01 thanks for your help trying to figure out the source of this bug. I pushed an update to the package that runs a check to make sure image files exist at the start. I know you have already verified that the image files exist, but the package should run this check anyway, so I figured it was a starting point. If you have the time to run it again and let me know what the output is, that would be helpful.

@AJAYK-01
Copy link

@NicolasSimmonds @AJAYK-01 thanks for your help trying to figure out the source of this bug. I pushed an update to the package that runs a check to make sure image files exist at the start. I know you have already verified that the image files exist, but the package should run this check anyway, so I figured it was a starting point. If you have the time to run it again and let me know what the output is, that would be helpful.

I updated the package to 1.1.2 and re ran the script, but the current output also errors out and it seems to be the exact same error as I mentioned before the update 🙁

@jonbhanson
Copy link
Owner

I found the source of the problem; will push an update.

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

2 participants