-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Platform
Web
Plugin
package_info_plus
Version
9.0.0
Flutter SDK
3.35.2
Steps to reproduce
- Add package info plus to dependencies
- Call
packageInfo.fromPlatform()after init - Build web app (
flutter build web --release)
Code Sample
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(const MainApp());
}
class MainApp extends StatefulWidget {
const MainApp({super.key});
@override
State<MainApp> createState() => _MainAppState();
}
class _MainAppState extends State<MainApp> {
String version = 'unknown';
void _getVersion() async {
final PackageInfo info = await PackageInfo.fromPlatform();
version = info.version;
setState(() {});
}
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_){
_getVersion();
});
}
@override
Widget build(BuildContext context) {
return Text(version);
}
}Logs
I do not know how to run verbose in built web release.
Here is log from console (in browser)
Exception while loading service worker: Error: Service Worker API unavailable.
The current context is NOT secure.
Read more: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
loadServiceWorker http://192.168.2.112/flutter_bootstrap.js:3
load http://192.168.2.112/flutter_bootstrap.js:31
<anonymous> http://192.168.2.112/flutter_bootstrap.js:39
flutter_bootstrap.js:31:1185
Referrer policy: Менее строгая политика no-referrer-when-downgrade игнорирована для междоменного запроса: https://www.gstatic.com/flutter-canvaskit/a8bfdfc394deaed5c57bd45a64ac4294dc976a72/canvaskit.wasm canvaskit.wasm
Referrer policy: Менее строгая политика no-referrer-when-downgrade игнорирована для междоменного запроса: https://www.gstatic.com/flutter-canvaskit/a8bfdfc394deaed5c57bd45a64ac4294dc976a72/canvaskit.js canvaskit.js
Injecting <script> tag. Using callback. flutter_bootstrap.js:1:2245
Referrer policy: Менее строгая политика no-referrer-when-downgrade игнорирована для междоменного запроса: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Me4GZLCzYlKw.woff2 KFOmCnqEu92Fr1Me4GZLCzYlKw.woff2
Initializing Firebase firebase_core line 45240 > injectedScript:2:17
Referrer policy: Менее строгая политика no-referrer-when-downgrade игнорирована для междоменного запроса: https://www.gstatic.com/firebasejs/12.0.0/firebase-app.js firebase-app.js
Initializing Firebase firebase_firestore line 45240 > injectedScript:2:17
Referrer policy: Менее строгая политика no-referrer-when-downgrade игнорирована для междоменного запроса: https://www.gstatic.com/firebasejs/12.0.0/firebase-firestore.js firebase-firestore.js
Uncaught : MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
e http://192.168.2.112/main.dart.js:3690
iW http://192.168.2.112/main.dart.js:73005
s http://192.168.2.112/main.dart.js:5031
$2 http://192.168.2.112/main.dart.js:39027
$1 http://192.168.2.112/main.dart.js:39021
avt http://192.168.2.112/main.dart.js:39969
D2 http://192.168.2.112/main.dart.js:39972
$0 http://192.168.2.112/main.dart.js:39477
ti http://192.168.2.112/main.dart.js:5168
nZ http://192.168.2.112/main.dart.js:39388
$0 http://192.168.2.112/main.dart.js:39441
b0w http://192.168.2.112/main.dart.js:5200
b0M http://192.168.2.112/main.dart.js:5202
$1 http://192.168.2.112/main.dart.js:38971
main.dart.js:6099:19
WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. 2 canvaskit.js:15:383
Referrer policy: Менее строгая политика no-referrer-when-downgrade игнорирована для междоменного запроса: https://fonts.gstatic.com/s/notosanskr/v36/PbyxFmXiEBPT4ITbgNA5Cgms3VYcOA-vvnIzzuoyeLGC5nwuDo-KBTUm6CryotyJROlrnQ.99.woff2 PbyxFmXiEBPT4ITbgNA5Cgms3VYcOA-vvnIzzuoyeLGC5nwuDo-KBTUm6CryotyJROlrnQ.99.woff2
WebGL warning: getParameter: The READ_BUFFER attachment is multisampled. 2
Ошибка карты кода: Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Stack in the worker:parseSourceMapInput@resource://devtools/client/shared/vendor/source-map/lib/util.js:163:15
_factory@resource://devtools/client/shared/vendor/source-map/lib/source-map-consumer.js:1066:22
SourceMapConsumer@resource://devtools/client/shared/vendor/source-map/lib/source-map-consumer.js:26:12
_fetch@resource://devtools/client/shared/source-map-loader/utils/fetchSourceMap.js:83:19
URL ресурса: http://192.168.2.112/flutter_bootstrap.js
URL карты кода: flutter.js.map
Flutter Doctor
Server when i building:
[✓] Flutter (Channel stable, 3.35.2, on Debian GNU/Linux 12 (bookworm) 6.1.0-40-amd64, locale C.UTF-8) [67ms]
• Flutter version 3.35.2 on channel stable at /home/noc/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 05db968908 (7 weeks ago), 2025-08-25 10:21:35 -0700
• Engine revision a8bfdfc394
• Dart version 3.9.0
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
[✗] Android toolchain - develop for Android devices [61ms]
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [27ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Linux toolchain - develop for Linux desktop [76ms]
✗ clang++ is required for Linux development.
It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
✗ CMake is required for Linux development.
It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
✗ ninja is required for Linux development.
It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases
✗ pkg-config is required for Linux development.
It is likely available from your distribution (e.g.: apt install pkg-config), or can be downloaded from https://www.freedesktop.org/wiki/Software/pkg-config/
[!] Android Studio (not installed) [20ms]
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
[✓] Connected device (1 available) [85ms]
• Linux (desktop) • linux • linux-x64 • Debian GNU/Linux 12 (bookworm) 6.1.0-40-amd64
[✓] Network resources [536ms]
• All expected network resources are available.
! Doctor found issues in 4 categories.
My PC where i develop:
[√] Flutter (Channel master, 3.32.0-1.0.pre.73, on Microsoft Windows [Version 10.0.26100.6584], locale ru-RU) [4,1s]
• Flutter version 3.32.0-1.0.pre.73 on channel master at D:\program\flutter3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a7f820163c (6 months ago), 2025-04-11 18:24:16 -0700
• Engine revision a7f820163c
• Dart version 3.8.0 (build 3.8.0-265.0.dev)
• DevTools version 2.45.0-dev.0
[√] Windows Version (Майкрософт Windows 11 Домашняя 64-bit, 24H2, 2009) [790ms]
[X] Android toolchain - develop for Android devices [137ms]
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[√] Chrome - develop for the web [84ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.1) [83ms]
• Visual Studio at D:\program\VisualStudio
• Visual Studio Community 2022 version 17.12.35514.174
• Windows 10 SDK version 10.0.22621.0
[!] Android Studio (not installed) [16ms]
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/windows-android-setup for detailed instructions).
[√] Connected device (3 available) [123ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.6584]
• Chrome (web) • chrome • web-javascript • Google Chrome 140.0.7339.128
• Edge (web) • edge • web-javascript • Microsoft Edge 141.0.3537.71
[√] Network resources [1 236ms]
• All expected network resources are available.
! Doctor found issues in 2 categories.Checklist before submitting a bug
- I searched issues in this repository and couldn't find such bug/problem
- I Google'd a solution and I couldn't find it
- I searched on StackOverflow for a solution and I couldn't find it
- I read the README.md file of the plugin
- I'm using the latest version of the plugin
- All dependencies are up to date with
flutter pub upgrade - I did a
flutter clean - I tried running the example project