android - Plugin Upgrader.dart flutter not work - Can't find an app in the Play Store with the id - Stack Overflow

I'm trying to make force update for user so user can't skip the update, i'm already use

I'm trying to make force update for user so user can't skip the update, i'm already use in_app_update and ask here My Question but not found solution so now i use plugin Upgrader in my flutter but update notification not display, here my code :

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:perhitungan_pkt_kgb/hitung_kgb.dart';
import 'package:perhitungan_pkt_kgb/hitung_pkt.dart';
import 'package:perhitungan_pkt_kgb/tentang.dart';
import 'package:perhitungan_pkt_kgb/utama.dart';
import 'package:upgrader/upgrader.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MainApp());
}

class MainApp extends StatefulWidget {
  const MainApp({super.key});

  @override
  State<MainApp> createState() => _MainAppState();
}

class _MainAppState extends State<MainApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: Homepage());
  }
}

class DrawerItem {
  String title;
  IconData icon;
  DrawerItem(this.title, this.icon);
}

class Homepage extends StatefulWidget {
  Homepage({super.key});
  final drawerItems = [
    DrawerItem("Beranda", Icons.home),
    DrawerItem("Hitung 1", Icons.military_tech),
    DrawerItem("Hitung 2", Icons.paid),
    DrawerItem("Tentang", Icons.account_circle),
  ];
  @override
  State<Homepage> createState() => _HomepageState();
}

class _HomepageState extends State<Homepage> {
  int _selectedDrawerIndex = 0;

  _getDrawerItemWidget(int pos) {
    switch (pos) {
      case 0:
        return Utama();
      case 1:
        return Hitung1();
      case 2:
        return Hitung2();
      case 3:
        return Tentang();

      default:
        return Text("Error");
    }
  }

  _onSelectItem(int index) {
    setState(() => _selectedDrawerIndex = index);
    Navigator.of(context).pop(); // close the drawer
  }

  @override
  Widget build(BuildContext context) {
    List<Widget> drawerOptions = [];
    for (var i = 0; i < widget.drawerItems.length; i++) {
      var d = widget.drawerItems[i];
      drawerOptions.add(
        ListTile(
          leading: Icon(d.icon),
          title: Text(d.title),
          selected: i == _selectedDrawerIndex,
          onTap: () => _onSelectItem(i),
        ),
      );
    }

    return UpgradeAlert(
      upgrader: Upgrader(
        messages: UpgraderMessages(code: 'id '),
        debugLogging: kReleaseMode ? false : true,
        debugDisplayOnce: false,
        debugDisplayAlways: false,
        showIgnore: false,
        showLater: false,
      ),
      child: Scaffold(
        appBar: AppBar(
          title: Text(widget.drawerItems[_selectedDrawerIndex].title),
        ),
        drawer: Drawer(
          child: ListView(
            padding: EdgeInsets.zero,
            children: <Widget>[
              SizedBox(
                height: 150,
                child: const DrawerHeader(
                  decoration: BoxDecoration(color: Colors.blue),
                  child: Text(
                    'Menu',
                    style: TextStyle(color: Colors.white, fontSize: 24),
                  ),
                ),
              ),
              Column(children: drawerOptions),
            ],
          ),
        ),
        body: _getDrawerItemWidget(_selectedDrawerIndex),
        bottomNavigationBar: Container(
          height: 25.0,
          color: Colors.grey[200],
          child: Text(
            'Copyright © ISSYAM 2025',
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 14.0),
          ),
        ),
      ),
    );
  }
}

here my debug result :

the result said :

upgrader: Can't find an app in the Play Store with the id:......

I have internal testing in my google play console, now i'm trying to get closed testing, i think that's problem because my app still in internal testing ?

i use version package_info_plus: ^4.2.0 and upgrader: ^8.2.0 because new version not support showIgnore: and showLater: parameter

i hope someone can fix my problem thanks

I'm trying to make force update for user so user can't skip the update, i'm already use in_app_update and ask here My Question but not found solution so now i use plugin Upgrader in my flutter but update notification not display, here my code :

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:perhitungan_pkt_kgb/hitung_kgb.dart';
import 'package:perhitungan_pkt_kgb/hitung_pkt.dart';
import 'package:perhitungan_pkt_kgb/tentang.dart';
import 'package:perhitungan_pkt_kgb/utama.dart';
import 'package:upgrader/upgrader.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MainApp());
}

class MainApp extends StatefulWidget {
  const MainApp({super.key});

  @override
  State<MainApp> createState() => _MainAppState();
}

class _MainAppState extends State<MainApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: Homepage());
  }
}

class DrawerItem {
  String title;
  IconData icon;
  DrawerItem(this.title, this.icon);
}

class Homepage extends StatefulWidget {
  Homepage({super.key});
  final drawerItems = [
    DrawerItem("Beranda", Icons.home),
    DrawerItem("Hitung 1", Icons.military_tech),
    DrawerItem("Hitung 2", Icons.paid),
    DrawerItem("Tentang", Icons.account_circle),
  ];
  @override
  State<Homepage> createState() => _HomepageState();
}

class _HomepageState extends State<Homepage> {
  int _selectedDrawerIndex = 0;

  _getDrawerItemWidget(int pos) {
    switch (pos) {
      case 0:
        return Utama();
      case 1:
        return Hitung1();
      case 2:
        return Hitung2();
      case 3:
        return Tentang();

      default:
        return Text("Error");
    }
  }

  _onSelectItem(int index) {
    setState(() => _selectedDrawerIndex = index);
    Navigator.of(context).pop(); // close the drawer
  }

  @override
  Widget build(BuildContext context) {
    List<Widget> drawerOptions = [];
    for (var i = 0; i < widget.drawerItems.length; i++) {
      var d = widget.drawerItems[i];
      drawerOptions.add(
        ListTile(
          leading: Icon(d.icon),
          title: Text(d.title),
          selected: i == _selectedDrawerIndex,
          onTap: () => _onSelectItem(i),
        ),
      );
    }

    return UpgradeAlert(
      upgrader: Upgrader(
        messages: UpgraderMessages(code: 'id '),
        debugLogging: kReleaseMode ? false : true,
        debugDisplayOnce: false,
        debugDisplayAlways: false,
        showIgnore: false,
        showLater: false,
      ),
      child: Scaffold(
        appBar: AppBar(
          title: Text(widget.drawerItems[_selectedDrawerIndex].title),
        ),
        drawer: Drawer(
          child: ListView(
            padding: EdgeInsets.zero,
            children: <Widget>[
              SizedBox(
                height: 150,
                child: const DrawerHeader(
                  decoration: BoxDecoration(color: Colors.blue),
                  child: Text(
                    'Menu',
                    style: TextStyle(color: Colors.white, fontSize: 24),
                  ),
                ),
              ),
              Column(children: drawerOptions),
            ],
          ),
        ),
        body: _getDrawerItemWidget(_selectedDrawerIndex),
        bottomNavigationBar: Container(
          height: 25.0,
          color: Colors.grey[200],
          child: Text(
            'Copyright © ISSYAM 2025',
            textAlign: TextAlign.center,
            style: TextStyle(fontSize: 14.0),
          ),
        ),
      ),
    );
  }
}

here my debug result :

the result said :

upgrader: Can't find an app in the Play Store with the id:......

I have internal testing in my google play console, now i'm trying to get closed testing, i think that's problem because my app still in internal testing ?

i use version package_info_plus: ^4.2.0 and upgrader: ^8.2.0 because new version not support showIgnore: and showLater: parameter

i hope someone can fix my problem thanks

Share asked Mar 4 at 8:09 DreamerDreamer 237 bronze badges 8
  • Is there a version of your application that is live in the Google play store? – tomerpacific Commented Mar 4 at 8:14
  • i think this issue is likely because your app is in internal testing or closed testing on the Google Play Console. The upgrader package fetches the latest version from the Play Store, but this apps may not be publicly available in the play store,thats way i think you are getting this error. – Jaspalsinh Gohil Commented Mar 4 at 8:16
  • @JaspalsinhGohil so plugin upgrader just work in production mode ? – Dreamer Commented Mar 4 at 8:38
  • @tomerpacific I have internal testing release in my play console, the status still internal testing, when i use plugin in_app_update here the update notification can display but the problem i can force user to update, now i use plugin upgrader the update notification not display – Dreamer Commented Mar 4 at 8:46
  • @Dreamer checkout this issue : github/larryaasen/upgrader/issues/404 – Jaspalsinh Gohil Commented Mar 4 at 8:48
 |  Show 3 more comments

1 Answer 1

Reset to default 1

The upgrader Flutter package works when your application is live in the Google Play store and not in internal testing. When reading the documentation, you can see that this is somewhat mentioned:

When running on Android the Google Play Store will provide the latest app version. When running on iOS the App Store will provide the latest app version.

As mentioned in the comments, there is an issue open and it is suggested there to use the AppCast option.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745055937a4608668.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信