blockbasti / just_another_workout_timer

A simple timer for your workouts, built with Flutter!
MIT License
130 stars 23 forks source link

Can't build from source. #72

Closed sleroq closed 3 years ago

sleroq commented 3 years ago

Describe the bug Error when building from source.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/blockbasti/just_another_workout_timer.git
  2. cd just_another_workout_timer/
  3. sudo flutter pub get
  4. ./scripts/generate_code.sh
  5. sudo flutter pub run intl_utils:generate
  6. sudo flutter build apk

Expected behavior Build apk file.

Smartphone (please complete the following information):

Additional context


  just_another_workout_timer   git:(main) sudo flutter build apk

   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎

💪 Building with sound null safety 💪

Running Gradle task 'assembleRelease'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file '/home/slok/just_another_workout_timer/android/settings.gradle' (/root/.gradle/caches/6.7/scripts/f0emg6u6oecmxqzgk5g9nn4ui).

> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 586ms
Running Gradle task 'assembleRelease'...                         1,080ms
Gradle task assembleRelease failed with exit code 1
blockbasti commented 3 years ago

Why are you using sudo to build? You shouldn't need to. If you are getting permission errors otherwise, you shoud fix these instead and not rely on sudo.

sleroq commented 3 years ago

The problem was in the incorrectly installed flutter. After I re-installed it using an official guide I was able to build without problems