ethereal-developers / OpenScan

A privacy-friendly Document Scanner app
BSD 3-Clause "New" or "Revised" License
1.5k stars 88 forks source link

dev_v3 branch build failing #101

Closed flowolf closed 8 months ago

flowolf commented 1 year ago

Tried to build the project, but got errors. I'm new to flutter and don't know where to start...

I tried to build from branch dev_v3.

this is what I did:

$ brew install --cask flutter
...
$ flutter build apk
"el": 1 untranslated message(s).
"hu": 1 untranslated message(s).
"pl": 2 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
<other option>: <other selection>

This will generate a JSON format file containing all messages that
need to be translated.
Resolving dependencies... (3.5s)
Note: intl is pinned to version 0.18.1 by flutter_localizations from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.

Because flutter_localizations 0.0.0 from sdk depends on intl 0.18.1 and no versions of flutter_localizations from sdk match >0.0.0 <0.1.0, flutter_localizations ^0.0.0 from sdk requires intl 0.18.1.
So, because openscan depends on both flutter_localizations ^0.0.0 from sdk and intl ^0.17.0, version solving failed.

You can try the following suggestion to make the pubspec resolve:
* Try upgrading your constraint on intl: flutter pub add intl:^0.18.1

$ flutter pub add intl:^0.18.1
...
Changed 11 dependencies!

$ flutter build apk
...
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 4596 bytes (99.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > SigningConfig "release" is missing required property "storeFile".

* 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 2m 50s
Running Gradle task 'assembleRelease'...                          170.8s
Gradle task assembleRelease failed with exit code 1

I did not start the project in Android Studio. is this needed?

thanks for help

thardev commented 8 months ago

Hey @flowolf

I've been able to do the build successfully. I had the same problem as you have and mainly what you need to do is these two steps:

Run the following command to create a valid key to be able to generate the release build. keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload-keystore

Then, inside the project, in the android folder, create a file named key.properties and put this inside but please replace the placeholder values with your actual values:

storePassword=<password-from-previous-step>
keyPassword=<password-from-previous-step>
keyAlias=upload-keystore
storeFile=<keystore-file-location>

Then run again flutter build apk and you should be good to go 🙂

For further information, you can check this page: https://docs.flutter.dev/deployment/android#create-an-upload-keystore

flowolf commented 8 months ago

@thardev thank you! that worked!

I set:

storePassword=<password-from-previous-step>
keyPassword=<password-from-previous-step>
keyAlias=upload-keystore
storeFile=/Users/myuser/path/to/upload-keystore.jks
flowolf commented 8 months ago

resolved