rubiconba / fastlane-plugin-flutter-version-manager

Fastlane plugin that is used to manage app versioning of Flutter project
MIT License
35 stars 11 forks source link

No such file or directory @ rb_sysopen #1

Closed mikeRozen closed 3 years ago

mikeRozen commented 3 years ago

Hi, I have the following issue: bundle exec fastlane ios_beta_app fails at the end I tried different paths for the version.yml the lane directory is: _/Users/myuser/AndroidStudioProjects/any_drivestudent/ios/fastlane while the version.yml and pubspec.yaml are in the root

[17:51:01]: No such file or directory @ rb_sysopen - ../../version.yml

+------+---------------------------+-------------+
|                fastlane summary                |
+------+---------------------------+-------------+
| Step | Action                    | Time (in s) |
+------+---------------------------+-------------+
| 1    | default_platform          | 0           |
| 2    | pwd                       | 0           |
| 3    | build_app                 | 135         |
| 4    | firebase_app_distribution | 40          |
| 💥   | flutter_version_manager   | 0           |
+------+---------------------------+-------------+

[17:51:01]: fastlane finished with errors

[17:51:01]: Error accessing file, this might be due to fastlane's directory handling
[17:51:01]: Check out https://docs.fastlane.tools/advanced/#directory-behavior for more details

bundler: failed to load command: fastlane (/Users/myuser/.gems/bin/fastlane)

Fastfile:

default_platform(:ios)

platform :ios do
  desc "New iOS build for Counter Demo app"
    lane :ios_beta_app do
        sh "pwd"
        build_app(
            scheme: "Runner",
            archive_path: "./build/Runner.xcarchive",
            export_method: "development",
            output_directory: "./build/Runner"
        )
        firebase_app_distribution(
            app: "XXX",
            testers: "",
            release_notes: "Initial test version of the app",
            firebase_cli_path: "/usr/local/bin/firebase",
            ipa_path: "./build/Runner/AnyDrive-Student.ipa"
        )
        flutter_version_manager(
            arguments: "-patch",
            yml: "../../version.yml",
            pubspec: "../../pubspec.yaml")
    end
end

Please suggest what can be done? Thanks a lot

davormaricdev commented 3 years ago

Hello, it looks like the plugin was unable to find the path to your version.yml Can you show me your folder structure?

mikeRozen commented 3 years ago

Agree so I tried different paths, and had the same result. (../../version.yml , /../../version.yml, ./version.yml)

Screen Shot 2020-11-14 at 8 11 07
davormaricdev commented 3 years ago

Setting your path to be one level up should work if you run fastlane [command] from ios folder:

flutter_version_manager(
            arguments: "-patch",
            yml: "../version.yml",
            pubspec: "../pubspec.yaml")

You can read more about how fastlane handles directories here.

However, I strongly recommend that you move fastlane one level up so you can use it to build and deploy both android and iOS applications from one place. In order to do so, please follow these steps:

Note: If you experience the .git: [!] path does not exist (ArgumentError) error, you should add optional git_repo argument which should point out to the folder containing a .git folder.

mikeRozen commented 3 years ago

Hi, So indeed according to docs every plugin runs in the root directory (which I believe in my case it's IOS or Android folder ), by changing to what you suggested and adding the _gitrepo the plugin finished successfully BUT it doesn't get uploaded to firebase for some reason I tried to change the minor, patch number but still, I don't see it in Firebase, any suggestions?

davormaricdev commented 3 years ago

I haven't worked with firebase deployment that much, but I'd be best if you called flutter_version_manager followed by flutter build ios before build_app to ensure that the build number and version name is applied correctly