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

Packages used in the app are not working #703

Open
Mrityunjayyshukla opened this issue Dec 17, 2024 · 8 comments
Open

Packages used in the app are not working #703

Mrityunjayyshukla opened this issue Dec 17, 2024 · 8 comments

Comments

@Mrityunjayyshukla
Copy link

The Flutter packages that are being used in the app are not working.
For each package, it is generating the error:

Target of URI doesn't exist: 'package:json_annotation/json_annotation.dart'.
Try creating the file referenced by the URI, or try using a URI for a file that does exist.dart

On running the flutter pub get command, following error is being returned.

Synthetic package output (package:flutter_gen) is deprecated: https://flutter.dev/to/flutter-gen-deprecation. In a future release, synthetic-package will
default to 'false' and will later be removed entirely.
Generating synthetic localizations package failed with 1 error:
Error: The placeholder, nr, has its "type" resource attribute set to the "null" type in locale "ar", but it is "Object" in the template placeholder. For
compatibility with template placeholder, change the "type" attribute to "Object".

@rolandgeider
Copy link
Member

good catch with the gen deprecation, we should definitely change that (but there isn't even a timeline for that, so no hurries yet!)

As for the localization error, I'm guessing this is from setNr? But both app_ar.arb and app_en.arb look fine here. Also the CI runs fine https://github.com/wger-project/flutter/actions/runs/12303960480/job/34340307609 Which flutter version are you using?

@Mrityunjayyshukla
Copy link
Author

I'm using Flutter 3.28.0-1.0.pre.158. Is the issue because of the Flutter version I'm using?
flutter pub get is not working because of that error so I'm not able to run the program

@rolandgeider
Copy link
Member

I don't really know, but it might very well be, we're using 3.27 here and everything seems to be fine

@Mrityunjayyshukla
Copy link
Author

Let me check with Flutter 3.27 then

@Mrityunjayyshukla
Copy link
Author

@rolandgeider I tried to run the code in Flutter 3.27 but the
Error: The placeholder, nr, has its "type" resource attribute set to the "null" type in locale "ar", but it is "Object" in the template placeholder. For compatibility with template placeholder, change the "type" attribute to "Object".
is still there.
There is no null value for nr in app_ar.arb but the error is still there.
I forked the repository and then run git clone command

@rolandgeider
Copy link
Member

ok that's weird, this is from master:

roland@MacBook-Air-von-Roland flutter % flutter --version
Flutter 3.27.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8495dee1fd (vor 7 Tagen) • 2024-12-10 14:23:39 -0800
Engine • revision 83bacfc525
Tools • Dart 3.6.0 • DevTools 2.40.2
roland@MacBook-Air-von-Roland flutter % flutter run
"am": 249 untranslated message(s).
"ar": 37 untranslated message(s).
"ca": 10 untranslated message(s).
"cs": 10 untranslated message(s).
"de": 6 untranslated message(s).
"el": 181 untranslated message(s).
"es": 28 untranslated message(s).
"fr": 10 untranslated message(s).
"he": 123 untranslated message(s).
"hi": 111 untranslated message(s).
"hr": 10 untranslated message(s).
"hu": 272 untranslated message(s).
"id": 98 untranslated message(s).
"it": 28 untranslated message(s).
"ja": 96 untranslated message(s).
"nb": 191 untranslated message(s).
"pl": 10 untranslated message(s).
"pt": 28 untranslated message(s).
"pt_BR": 68 untranslated message(s).
"ro": 174 untranslated message(s).
"ru": 13 untranslated message(s).
"tr": 6 untranslated message(s).
"zh_Hant": 13 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.
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Warning: Overriding compileSdk version in Flutter plugin: flutter_barcode_scanner from 30 to 31 (to work around
 https://issuetracker.google.com/issues/199180389).
If there is not a new version of flutter_barcode_scanner, consider filing an issue against flutter_barcode_scanner
to increase their compileSdk to the latest (otherwise try updating to the latest version).
Warning: project flutter_barcode_scanner has no namespace set, this will prevent compilation,  setting one 
now to com.amolg.flutterbarcodescanner
If there is not a new version of flutter_barcode_scanner, consider filing an issue against flutter_barcode_scanner
"am": 249 untranslated message(s).
"ar": 37 untranslated message(s).
"ca": 10 untranslated message(s).
"cs": 10 untranslated message(s).
"de": 6 untranslated message(s).
"el": 181 untranslated message(s).
"es": 28 untranslated message(s).
"fr": 10 untranslated message(s).
"he": 123 untranslated message(s).
"hi": 111 untranslated message(s).
"hr": 10 untranslated message(s).
"hu": 272 untranslated message(s).
"id": 98 untranslated message(s).
"it": 28 untranslated message(s).
"ja": 96 untranslated message(s).
"nb": 191 untranslated message(s).
"pl": 10 untranslated message(s).
"pt": 28 untranslated message(s).
"pt_BR": 68 untranslated message(s).
"ro": 174 untranslated message(s).
"ru": 13 untranslated message(s).
"tr": 6 untranslated message(s).
"zh_Hant": 13 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.
Running Gradle task 'assembleDebug'...                             27,8s
✓ Built build/app/outputs/flutter-apk/app-debug.apk
Installing build/app/outputs/flutter-apk/app-debug.apk...          953ms
Syncing files to device sdk gphone64 arm64...                      244ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on sdk gphone64 arm64 is available at: http://127.0.0.1:62991/tb9hnxi4YIA=/
The Flutter DevTools debugger and profiler on sdk gphone64 arm64 is available at: 
http://127.0.0.1:9101?uri=http://127.0.0.1:62991/tb9hnxi4YIA=/
D/EGL_emulation( 5372): app_time_stats: avg=162.54ms min=7.90ms max=769.85ms count=8
D/ProfileInstaller( 5372): Installing profile for de.wger.flutter.debug

you're getting the error directly during compilation right? You can't even start the app

@Mrityunjayyshukla
Copy link
Author

No. There are some errors with the packages, when cloned master branch of the repository. So I use flutter clean and then flutter pub get to fix the errors with packages. And at flutter pub get this error is being generated.
I even tried running flutter pub get without running flutter clean before but the error is still there

@rolandgeider
Copy link
Member

Sorry, I have no explanation why that happens, I was about to suggest flutter clean, but you already tried that. Even if the error message doesn't make much sense, the only workaround I can think of is just deleting the app_ar.arb file and try without it

logs for flutter pub get
roland@MacBook-Air-von-Roland flutter % flutter pub get
Resolving dependencies... 
Downloading packages... 
  _fe_analyzer_shared 76.0.0 (78.0.0 available)
  analyzer 6.11.0 (7.1.0 available)
  analyzer_plugin 0.11.3 (0.12.0 available)
  async 2.11.0 (2.12.0 available)
  boolean_selector 2.1.1 (2.1.2 available)
  build 2.4.1 (2.4.2 available)
  build_config 1.1.1 (1.1.2 available)
  build_daemon 4.0.2 (4.0.3 available)
  build_resolvers 2.4.2 (2.4.3 available)
  build_runner 2.4.13 (2.4.14 available)
  build_runner_core 7.3.2 (8.0.0 available)
  camera_android_camerax 0.6.10 (0.6.10+1 available)
  characters 1.3.0 (1.4.0 available)
  clock 1.1.1 (1.1.2 available)
  collection 1.19.0 (1.19.1 available)
  csslib 0.17.3 (1.0.2 available)
  dart_style 2.3.7 (3.0.0 available)
  fake_async 1.3.1 (1.3.2 available)
  file 7.0.0 (7.0.1 available)
  get_it 8.0.2 (8.0.3 available)
  golden_toolkit 0.15.0 (discontinued)
  html 0.15.4 (0.15.5 available)
  image 4.4.0 (4.5.0 available)
! intl 0.19.0 (overridden) (0.20.1 available)
  leak_tracker 10.0.7 (10.0.8 available)
  leak_tracker_flutter_testing 3.0.8 (3.0.9 available)
  matcher 0.12.16+1 (0.12.17 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  meta 1.15.0 (1.16.0 available)
  path 1.9.0 (1.9.1 available)
  platform 3.1.5 (3.1.6 available)
  process 5.0.2 (5.0.3 available)
  shared_preferences_android 2.3.4 (2.4.0 available)
  shared_preferences_foundation 2.5.3 (2.5.4 available)
  source_span 1.10.0 (1.10.1 available)
  stream_transform 2.1.0 (2.1.1 available)
  string_scanner 1.3.0 (1.4.1 available)
  term_glyph 1.2.1 (1.2.2 available)
  test_api 0.7.3 (0.7.4 available)
  vm_service 14.3.0 (15.0.0 available)
  watcher 1.1.0 (1.1.1 available)
Got dependencies!
1 package is discontinued.
40 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

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