当前位置: 首页 > news >正文

敦化建设局网站素材网有哪些

敦化建设局网站,素材网有哪些,怎么制作自己的微信公众号,建设网站应该加什么服务器背景 最近遇到一个需求#xff0c;需要实现app的热更新,了解了一下热更新方案时间的时间有点久#xff0c;就做了个app升级的过渡版本#xff0c;然后遇到问题 真机安装遇到签名不一致的问题 如下 安装过程 版本升级的代码如下 ///版本更新检查static FutureVersionEnti…背景 最近遇到一个需求需要实现app的热更新,了解了一下热更新方案时间的时间有点久就做了个app升级的过渡版本然后遇到问题 真机安装遇到签名不一致的问题 如下 安装过程 版本升级的代码如下 ///版本更新检查static FutureVersionEntity checkVersionUpdate() async {if (isWeb) {return VersionEntity(need: false);}PackageInfo packageInfo await PackageInfo.fromPlatform();String version packageInfo.version;// String jsonStr await rootBundle.loadString(assets/json/version.json);// MapString, dynamic jsonData json.decode(jsonStr);MapString, dynamic jsonData await getVersion();VersionEntity versionEntity VersionEntity.fromJson(jsonData);Version latestVersion Version.parse(versionEntity.version ?? version);Version currentVersion Version.parse(version);print(1);if (latestVersion currentVersion) {_toUpdate(versionEntity);} else {return VersionEntity(need: false);}/// 非强制更新// if (versionEntity.data!.need! !(versionEntity.data!.necessary!)) {// _toUpdate(versionEntity);// } // 强制更新// else if (versionEntity.data!.need! versionEntity.data!.necessary!) {// _toUpdate(versionEntity);// } else {// // KLogUtil.d(无需更新);// }return versionEntity;}///版本更新弹窗static _toUpdate(VersionEntity versionEntity) {// 进度String progress ;double downloadProgress 0.0;bool downloadStart false;// 禁止返回bool disBack versionEntity.necessary!;Get.bottomSheet(isDismissible: !(versionEntity.necessary!),enableDrag: !(versionEntity.necessary!),StatefulBuilder(builder: (context, state) {String fileAddress ;return WillPopScope(onWillPop: () _onBackPressed(disBack),child: AppToast.bottomSheetContainer(padding: EdgeInsets.fromLTRB(20.w, 5.h, 20.w, 20.h),height: 429.h,bgColor: const Color(0xFF25272B),child: Column(children: [Container(width: 36.w,height: 4.h,decoration: BoxDecoration(color: versionEntity.necessary!? Colors.transparent: const Color(0xFF3B3D40),borderRadius: BorderRadius.circular(3.r),),),10.verticalSpace,Assets.images.versionUpdate.image(width: 100.r, height: 100.r),Padding(padding: EdgeInsets.symmetric(vertical: 20.h),child: Text(Update to ${versionEntity.version},style: TextStyle(color: Colors.white,fontSize: 16.sp,),),),Padding(padding: EdgeInsets.symmetric(vertical: 5.h),child: Row(children: [Text(更新内容,style: TextStyle(color: Colors.white,fontSize: 14.sp,),),],),),Expanded(child: ListView.builder(itemCount: versionEntity.contents?.length ?? 0,itemBuilder: (context, index) {return Text(versionEntity!.contents![index],style: TextStyle(color: Colors.grey,fontSize: 13.sp,),);},),),Row(mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [versionEntity.necessary false disBack false? Expanded(child: SizedBox(height: 56.h,child: ElevatedButton(onPressed: () {/// 每天弹一次更新Get.back();},style: ButtonStyle(backgroundColor: MaterialStateProperty.all(const Color(0xFF25272B)),shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius:BorderRadius.circular(16.r),),),),child: Text(Not Now ,style: TextStyle(color: const Color(0xFF25272B),fontSize: 14.sp,fontWeight: FontWeight.bold,),),),),): Container(),versionEntity.necessary false disBack false? SizedBox(width: 15.w): Container(),Visibility(visible: progress ,child: Expanded(child: SizedBox(height: 56.h,child: ElevatedButton(onPressed: () async {if (Platform.isIOS) {InstallPlugin.install(iosAppStoreUrl);// AppInstaller.goStore(// iosAppStoreUrl, id1375433239,// review: true);return;}if (progress ) {state(() {downloadStart true;});disBack true; //开始下载后禁止退出弹窗final filePath await getExternalStorageDirectory();fileAddress ${filePath!.path}/app-LH.apk;try {Dio dio Dio(BaseOptions(connectTimeout:const Duration(milliseconds: 10000),receiveTimeout: const Duration(milliseconds: 100000),sendTimeout:const Duration(milliseconds: 10000),),);await dio.download(versionEntity.url!,fileAddress,onReceiveProgress: (received, total) {if (total ! -1) {state(() {progress ${(received / total * 100).toStringAsFixed(2)}%;downloadProgress received / total;});}},).then((response) async {if (response.statusMessage OK) {// AppInstaller.installApk(fileAddress);InstallPlugin.install(fileAddress);// await AppInstaller.installApk(// fileAddress);} else {AppToast.toast(stateType: StateType.error,tips: Failed to download);disBack false;}},);} catch (e) {print(e);}}},style: ButtonStyle(backgroundColor: MaterialStateProperty.all(const Color(0xFF4677FF)),shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius:BorderRadius.circular(16.r)),),),child: downloadStart? CircularProgressIndicator(valueColor: const AlwaysStoppedAnimation(Colors.white),backgroundColor:Colors.white.withOpacity(.1),): Text(Update,style: TextStyle(fontSize: 14.sp,fontWeight: FontWeight.bold,color: Colors.white,)),),),),),Visibility(visible: progress ! ,child: Expanded(child: Container(decoration: BoxDecoration(color: Colors.white.withOpacity(.1),borderRadius: BorderRadius.circular(16.r),),clipBehavior: Clip.hardEdge,child: Stack(alignment: AlignmentDirectional.center,children: [InkWell(child: SizedBox(height: 56.h,width: double.infinity,child: LinearProgressIndicator(value: downloadProgress,backgroundColor: Colors.transparent,valueColor: const AlwaysStoppedAnimation(Color(0xFF4677FF)),),),onTap: () async {if (progress 100.00%) {await InstallPlugin.install(fileAddress);}},),Text(progress ? Update: (progress 100.00%? 安装app: progress),style: TextStyle(fontSize: 14.sp,fontWeight: FontWeight.bold,))],),),),),],),],),),);},),);}static Futurebool _onBackPressed(bool necessary) async {// 强更 禁止退出弹窗if (necessary) {return false;} else {return true;}}class VersionEntity {bool? necessary;bool? need;String? version;String? url;ListString? contents;VersionEntity({this.necessary, this.need, this.version, this.url});VersionEntity.fromJson(MapString, dynamic json) {necessary json[necessary];need json[need];version json[version];url json[url];contents json[contents].castString();}MapString, dynamic toJson() {final MapString, dynamic data String, dynamic{};data[necessary] necessary;data[need] need;data[version] version;data[url] url;data[contents] contents;return data;} } 下面是解决签名不一致的问题 解决方案 keytool -genkey -v -keystore ./key.jks -keyalg RSA -keysize 2048 -validity 20000 -alias HL 很多会遇到  原因是keytool 是java的库  需要配置java环境  或者 在java目录下进行操作 bash: keytool: command not found 在java环境目录 打开cmd 执行后 复制key.jks 到你的安卓目录下 (android/)  在安卓目录下(android/) 新增key.properties 文件 写入 密码是你自己设置的密码 storePassword789asd keyPassword789asd keyAliasLH storeFile../key.jks 最后在你 (android/app) 下的build.gradle 配置 buildTypes // 最上面 def keystorePropertiesFile rootProject.file(key.properties) def keystoreProperties new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile))//签名信息signingConfigs {release {keyAlias keystoreProperties[keyAlias]keyPassword keystoreProperties[keyPassword]storeFile file(keystoreProperties[storeFile])storePassword keystoreProperties[storePassword]}}buildTypes {release {// TODO: Add your own signing config for the release build.// Signing with the debug keys for now, so flutter run --release works.debuggable falseminifyEnabled true// signingConfig signingConfigs.debugsigningConfig signingConfigs.releasendk{ // 必须加入这部分否则可能导致编译成功的release包在真机中会闪退abiFilters armeabi-v7a}}debug {ndk {//这里要加上否则debug包会出问题,后面三个为可选x86建议加上不然部分模拟器回报错abiFilters armeabi, armeabi-v7a, arm64-v8a, x86}}} flutter build apk --release 这样就解决了升级遇到的签名版本不一致的问题
http://www.pierceye.com/news/760928/

相关文章:

  • 淮安市网站东莞关键词排名seo
  • 网站建设制作设计seo优化湖南个人信用信息服务平台
  • 运营网站wordpress改了固定链接
  • 咸阳市住房和城乡建设局网站网站建设外包必须注意几点
  • 沭阳三剑客做网站小熊代刷推广网站
  • 手机网站怎么建设网站快速设计
  • 上海高端网站建设有关网站设计与制作的论文
  • wps2016怎么做网站企业主题展厅设计公司
  • 网页设计与网站建设实训目的wordpress 别名插件
  • 做婚庆网站的功能定位5分钟建站wordpress
  • 淄博网站制作优化北京高端网页
  • 专业网站设计速寻亿企邦wordpress下载官网
  • 水网站源码网站建设客户合同
  • 网站制作遨游免费企业网站备案查询
  • 保洁公司网站怎么做阿里企业邮箱个人版
  • 网站开发里的输入网站的内容建设
  • 怎么到国外网站去接模具订单做socks5免费代理地址
  • 青海西宁做网站多少钱网页设计与网站规划
  • 铁岭建设网站古典网站案例
  • 织梦html网站地图外国人讲汉语做网站的视频
  • 唯品会购物网站开发项目h5网站建设的具体内容
  • 苏州网站设计电话显示网站建设精美页面
  • 怎么做外汇返佣的网站电商网站 收费与免费
  • 网站建设 计划书繁体网站模板
  • 设计公司做网站有用吗互联网营销的概念
  • 网站中数据库教程网站未续费到期后打开会怎样
  • 企业网站的规划与建设纯静态网站开发
  • 静海集团网站建设网址收录查询
  • 怎样做网站的外链怎么做自己的网站
  • nas 建网站asp.net 做网站源代码