inventree/inventree-app

Build App

Closed this issue · 10 comments

Hello i waant to know if is any tutorial or documentation to build the android app

I have dsn.dart error and some other dart error because it dont find file it same after find_dart files

@RedWillDev you need a file called dsn.dart to be in the lib directory. Look at the dummy_dsn file as a starting point. You can simply copy that across

"bg": 468 untranslated message(s).
"bg_BG": 468 untranslated message(s).
"cs": 52 untranslated message(s).
"cs_CZ": 52 untranslated message(s).
"da": 468 untranslated message(s).
"da_DK": 468 untranslated message(s).
"de": 31 untranslated message(s).
"de_DE": 31 untranslated message(s).
"el": 456 untranslated message(s).
"el_GR": 456 untranslated message(s).
"es": 79 untranslated message(s).
"es_ES": 79 untranslated message(s).
"es_MX": 37 untranslated message(s).
"fa": 468 untranslated message(s).
"fa_IR": 468 untranslated message(s).
"fi": 261 untranslated message(s).
"fi_FI": 261 untranslated message(s).
"fr": 40 untranslated message(s).
"fr_FR": 40 untranslated message(s).
"he": 468 untranslated message(s).
"he_IL": 468 untranslated message(s).
"hi": 468 untranslated message(s).
"hi_IN": 468 untranslated message(s).
"hu": 37 untranslated message(s).
"hu_HU": 37 untranslated message(s).
"id": 461 untranslated message(s).
"id_ID": 461 untranslated message(s).
"it": 64 untranslated message(s).
"it_IT": 64 untranslated message(s).
"ja": 147 untranslated message(s).
"ja_JP": 147 untranslated message(s).
"ko": 426 untranslated message(s).
"ko_KR": 426 untranslated message(s).
"nl": 37 untranslated message(s).
"nl_NL": 37 untranslated message(s).
"no": 53 untranslated message(s).
"no_NO": 53 untranslated message(s).
"pl": 143 untranslated message(s).
"pl_PL": 143 untranslated message(s).
"pt": 37 untranslated message(s).
"pt_BR": 37 untranslated message(s).
"pt_PT": 382 untranslated message(s).
"ru": 37 untranslated message(s).
"ru_RU": 37 untranslated message(s).
"sl": 468 untranslated message(s).
"sl_SI": 468 untranslated message(s).
"sv": 392 untranslated message(s).
"sv_SE": 392 untranslated message(s).
"th": 468 untranslated message(s).
"th_TH": 468 untranslated message(s).
"tr": 55 untranslated message(s).
"tr_TR": 55 untranslated message(s).
"vi": 48 untranslated message(s).
"vi_VN": 48 untranslated message(s).
"zh": 25 untranslated message(s).
"zh_CN": 25 untranslated message(s).
"zh_TW": 389 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
:

This will generate a JSON format file containing all messages that
need to be translated.
Resolving dependencies...
adaptive_theme 3.3.0 (3.6.0 available)
archive 3.3.6 (3.4.10 available)
args 2.3.2 (2.4.2 available)
audioplayers 4.1.0 (5.2.1 available)
audioplayers_android 3.0.2 (4.0.3 available)
audioplayers_darwin 4.1.0 (5.0.2 available)
audioplayers_linux 2.1.0 (3.1.0 available)
audioplayers_platform_interface 5.0.1 (6.1.0 available)
audioplayers_web 3.1.0 (4.1.0 available)
audioplayers_windows 2.0.2 (3.1.0 available)
back_button_interceptor 6.0.2 (7.0.2 available)
camera 0.10.3 (0.10.5+9 available)
camera_android 0.10.4 (0.10.8+16 available)
camera_avfoundation 0.9.11 (0.9.14+1 available)
camera_platform_interface 2.4.0 (2.7.4 available)
camera_web 0.3.1+1 (0.3.2+4 available)
checked_yaml 2.0.2 (2.0.3 available)
cli_util 0.3.5 (0.4.1 available)
cross_file 0.3.3+4 (0.3.4+1 available)
crypto 3.0.2 (3.0.3 available)
cupertino_icons 1.0.5 (1.0.6 available)
currency_formatter 2.0.1 (2.2.0 available)
datetime_picker_formfield 2.0.1 (discontinued)
device_info_plus 8.2.2 (9.1.2 available)
ffi 2.0.1 (2.1.2 available)
file 6.1.4 (7.0.0 available)
file_picker 5.2.11 (6.2.0 available)
file_selector_linux 0.9.2 (0.9.2+1 available)
file_selector_macos 0.9.3+1 (0.9.3+3 available)
file_selector_platform_interface 2.6.0 (2.6.2 available)
file_selector_windows 0.9.3 (0.9.3+1 available)
flutter_launcher_icons 0.11.0 (0.13.1 available)
flutter_localized_locales 2.0.4 (2.0.5 available)
flutter_markdown 0.6.13+1 (0.6.21 available)
flutter_plugin_android_lifecycle 2.0.13 (2.0.17 available)
flutter_speed_dial 6.2.0 (7.0.0 available)
font_awesome_flutter 10.3.0 (10.7.0 available)
glob 2.1.1 (2.1.2 available)
http 0.13.5 (1.2.1 available)
image 3.3.0 (4.1.7 available)
image_picker 1.0.2 (1.0.7 available)
image_picker_android 0.8.7+4 (0.8.9+3 available)
image_picker_for_web 3.0.0 (3.0.2 available)
image_picker_ios 0.8.8 (0.8.9+1 available)
image_picker_linux 0.2.1 (0.2.1+1 available)
image_picker_macos 0.2.1 (0.2.1+1 available)
image_picker_platform_interface 2.9.0 (2.9.4 available)
image_picker_windows 0.2.1 (0.2.1+1 available)
intl 0.18.1 (0.19.0 available)
js 0.6.7 (0.7.1 available)
json_annotation 4.8.0 (4.8.1 available)
leak_tracker 10.0.0 (10.0.4 available)
leak_tracker_flutter_testing 2.0.1 (3.0.3 available)
leak_tracker_testing 2.0.1 (3.0.1 available)
lint 2.1.2 (2.3.0 available)
logging 1.1.1 (1.2.0 available)
markdown 6.0.1 (7.2.1 available)
meta 1.11.0 (1.12.0 available)
mime 1.0.4 (1.0.5 available)
node_preamble 2.0.1 (2.0.2 available)
one_context 2.1.0 (4.0.0 available)
open_filex 4.3.2 (4.4.0 available)
package_info_plus 3.1.2 (5.0.1 available)
path_provider 2.0.12 (2.1.2 available)
path_provider_android 2.0.22 (2.2.2 available)
path_provider_foundation 2.1.1 (2.3.2 available)
path_provider_linux 2.1.7 (2.2.1 available)
path_provider_platform_interface 2.0.5 (2.1.2 available)
path_provider_windows 2.1.6 (2.2.1 available)
petitparser 5.1.0 (6.0.2 available)
platform 3.1.0 (3.1.4 available)
plugin_platform_interface 2.1.4 (2.1.8 available)
pointycastle 3.6.2 (3.7.4 available)
process 4.2.4 (5.0.2 available)
sembast 3.4.6+1 (3.6.0 available)
sentry 7.9.0 (7.16.1 available)
sentry_flutter 7.9.0 (7.16.1 available)
shared_preferences 2.0.17 (2.2.2 available)
shared_preferences_android 2.0.15 (2.2.1 available)
shared_preferences_foundation 2.1.3 (2.3.5 available)
shared_preferences_linux 2.1.3 (2.3.2 available)
shared_preferences_platform_interface 2.1.0 (2.3.2 available)
shared_preferences_web 2.0.4 (2.3.0 available)
shared_preferences_windows 2.1.3 (2.3.2 available)
shelf 1.4.0 (1.4.1 available)
shelf_packages_handler 3.0.1 (3.0.2 available)
shelf_static 1.1.1 (1.1.2 available)
shelf_web_socket 1.0.3 (1.0.4 available)
source_maps 0.10.11 (0.10.12 available)
sqflite 2.2.4+1 (2.3.2 available)
sqflite_common 2.4.2+2 (2.5.3 available)
synchronized 3.0.1 (3.1.0+1 available)
test 1.24.9 (1.25.2 available)
test_api 0.6.1 (0.7.0 available)
test_core 0.5.9 (0.6.0 available)
typed_data 1.3.1 (1.3.2 available)
universal_io 2.2.0 (2.2.2 available)
url_launcher 6.1.10 (6.2.5 available)
url_launcher_android 6.0.23 (6.3.0 available)
url_launcher_ios 6.1.0 (6.2.5 available)
url_launcher_linux 3.0.2 (3.1.1 available)
url_launcher_macos 3.0.2 (3.1.0 available)
url_launcher_platform_interface 2.1.1 (2.3.2 available)
url_launcher_web 2.0.14 (2.3.0 available)
url_launcher_windows 3.0.3 (3.1.1 available)
uuid 3.0.7 (4.3.3 available)
vm_service 13.0.0 (14.1.0 available)
web_socket_channel 2.3.0 (2.4.4 available)
webkit_inspection_protocol 1.2.0 (1.2.1 available)
win32 4.1.3 (5.2.0 available)
xdg_directories 0.2.0+3 (1.0.4 available)
xml 6.2.2 (6.5.0 available)
yaml 3.1.1 (3.1.2 available)
Got dependencies!
1 package is discontinued.
112 packages have newer versions incompatible with dependency constraints.
Try flutter pub outdated for more information.

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

"bg": 468 untranslated message(s).
"bg_BG": 468 untranslated message(s).
"cs": 52 untranslated message(s).
"cs_CZ": 52 untranslated message(s).
"da": 468 untranslated message(s).
"da_DK": 468 untranslated message(s).
"de": 31 untranslated message(s).
"de_DE": 31 untranslated message(s).
"el": 456 untranslated message(s).
"el_GR": 456 untranslated message(s).
"es": 79 untranslated message(s).
"es_ES": 79 untranslated message(s).
"es_MX": 37 untranslated message(s).
"fa": 468 untranslated message(s).
"fa_IR": 468 untranslated message(s).
"fi": 261 untranslated message(s).
"fi_FI": 261 untranslated message(s).
"fr": 40 untranslated message(s).
"fr_FR": 40 untranslated message(s).
"he": 468 untranslated message(s).
"he_IL": 468 untranslated message(s).
"hi": 468 untranslated message(s).
"hi_IN": 468 untranslated message(s).
"hu": 37 untranslated message(s).
"hu_HU": 37 untranslated message(s).
"id": 461 untranslated message(s).
"id_ID": 461 untranslated message(s).
"it": 64 untranslated message(s).
"it_IT": 64 untranslated message(s).
"ja": 147 untranslated message(s).
"ja_JP": 147 untranslated message(s).
"ko": 426 untranslated message(s).
"ko_KR": 426 untranslated message(s).
"nl": 37 untranslated message(s).
"nl_NL": 37 untranslated message(s).
"no": 53 untranslated message(s).
"no_NO": 53 untranslated message(s).
"pl": 143 untranslated message(s).
"pl_PL": 143 untranslated message(s).
"pt": 37 untranslated message(s).
"pt_BR": 37 untranslated message(s).
"pt_PT": 382 untranslated message(s).
"ru": 37 untranslated message(s).
"ru_RU": 37 untranslated message(s).
"sl": 468 untranslated message(s).
"sl_SI": 468 untranslated message(s).
"sv": 392 untranslated message(s).
"sv_SE": 392 untranslated message(s).
"th": 468 untranslated message(s).
"th_TH": 468 untranslated message(s).
"tr": 55 untranslated message(s).
"tr_TR": 55 untranslated message(s).
"vi": 48 untranslated message(s).
"vi_VN": 48 untranslated message(s).
"zh": 25 untranslated message(s).
"zh_CN": 25 untranslated message(s).
"zh_TW": 389 untranslated message(s).
To see a detailed report, use the untranslated-messages-file
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
:

This will generate a JSON format file containing all messages that
need to be translated.
../../AppData/Local/Pub/Cache/hosted/pub.dev/one_context-2.1.0/lib/src/controllers/one_context.dart:92:5: Error: Expected 0 type arguments.
PersistentBottomSheetController Function({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/one_context-2.1.0/lib/src/components/one_context_widget.dart:112:3: Error: Expected 0 type arguments.
PersistentBottomSheetController _showBottomSheet({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/one_context-2.1.0/lib/src/controllers/dialog_controller.mixin.dart:70:3: Error: Expected 0 type arguments.
PersistentBottomSheetController Function({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/one_context-2.1.0/lib/src/controllers/dialog_controller.mixin.dart:189:10: Error: Expected 0 type arguments.
Future<PersistentBottomSheetController?> showBottomSheet({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/one_context-2.1.0/lib/src/controllers/dialog_controller.mixin.dart:245:7: Error: Expected 0 type arguments.
PersistentBottomSheetController Function({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/one_context-2.1.0/lib/src/components/one_context_widget.dart:122:12: Error: Expected 0 type arguments.
return showBottomSheet(
^
/C:/Flutter/flutter/packages/flutter/lib/src/material/bottom_sheet.dart:1327:33: Context: Found this candidate, but the arguments don't match.
PersistentBottomSheetController showBottomSheet({
^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Flutter\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1419

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildRelease'.

Process 'command 'C:\Flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • 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.

BUILD FAILED in 20s
Running Gradle task 'assembleRelease'... 20,7s
Gradle task assembleRelease failed with exit code 1

if you need an easy way to access the app it is on the app store; compiling apps can be difficult due to the numerous requirements to the build enviroment

@matmair thanks you, i know it but i dont want an easy way i want to build it, to possibly add things in the future

Re, I successfully build an debug apk now i try to build a release

Documenting missing information is highly appreciated too.

@RedWillDev I have made a PR to improve the build process around Sentry DSN value - #475

What other changes did you have to make to get it to compile? Any addition to the docs would be greatly appreciated. There have been very few contributors to the app, mostly just me compiling it!

First of all, thank you for your excellent work. I love the inventree project and the app.
I am a beginner in programming, maybe not all of the above is necessary but maybe the following will help others.
I had the same error message as RedWillDev with a fresh install of flutter.
The following commands helped me to get it working:

download inventree-app code

install flutter and android studio

Create a keystore.jks file according to https://docs.flutter.dev/deployment/android#create-an-upload-keystore
and set a matching key.properties file in C:...\inventree-app\android

pip install invoke
pip install coverage 5.3
pip install coverage
pip install coveralls

flutter pub get
flutter pub outdated
flutter pub upgrade
flutter pub upgrade --major-versions
call translate
call android
in "C:...\inventree-app\android\app\build.gradle" I changed compileSdkVersion 33 to compileSdkVersion 34 (column 34 directly under "android {")
...
android {
compileSdkVersion 34
...
flutter build apk --release --no-tree-shake-icons

Sorry for no reply 😢, if you need more information for building app tell me