精选文章 Flutter问题解决之 Waiting for another flutter command to release the startup lock.

Flutter问题解决之 Waiting for another flutter command to release the startup lock.

作者:MYBOYER 时间: 2021-02-07 01:31:46
MYBOYER 2021-02-07 01:31:46
【摘要】前段时间系统重装了一次之后,执行Flutter的Packages get一直卡在这里,再执行一次报这个问题Waiting for another flutter command to release the startup lock.查看了一下资料,找到了以下方法:

1:关闭 as

2:CTRL+ALT+DEL 关闭所有 dart进程和android进程,注意adb这个别忘了关

3:打...

前段时间系统重装了一次之后,执行Flutter的Packages get一直卡在这里,再执行一次报这个问题Waiting for another flutter command to release the startup lock.查看了一下资料,找到了以下方法:

1:关闭 as

2:CTRL+ALT+DEL 关闭所有 dart进程和android进程,注意adb这个别忘了关

3:打开 flutter 安装目录  如:...\flutter\bin\cache

删除里面的 lockfile

4:打开 as 先点击下面的 Invalidate 再打开此窗口 点击 Just Restart。

Flutter问题解决之 Waiting for another flutter command to release the startup lock.1

执行以上操作,然后有反应了,报了以下问题:

OS Error: 信号灯超时时间已到

, errno = 121, address = pub.dartlang.org, port = 53249

 虽然遇到了新问题,但也算一种进展吗?不怕它有反应,就怕它没反应啊!继续查询相关问题~

Google搜索一下,原来flutter 已经有对策了。

Using Flutter in China 。

大概意思就是 把默认的 package 获取地址改为访问没有问题的镜像站就可以了。

具体操作

  • Linux 或 Mac

export PUB_HOSTED_URL=https://pub.flutter-io.cn

export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

  • Windows

新增两个环境变量即可

PUB_HOSTED_URL ===== https://pub.flutter-io.cn

FLUTTER_STORAGE_BASE_URL ===== https://storage.flutter-io.cn

执行一下 flutter doctor命令

下载在 package get 应该就没有问题了。

 

flutter混合开发运行报错:VM snapshot must be valid. /Check failed: vm. Must be able to initialize the VM.

在现有android项目中集成flutter_boost时,运行host app发生崩溃:

 

VM snapshot must be valid. 
Check failed: vm. Must be able to initialize the VM.

查找资料得知,需要将flutter_sdk目录下packages/flutter_tools/gradle/flutter.gradle:
这句话
variant.outputs[0].processResources.dependsOn(copyFlutterAssetsTask)
改为
variant.outputs[0].processResources.dependsOn(flutterTask)

另外需要在fluttermodule的build文件Flutter/build.gradle的android{}节点添加:

project.android.libraryVariants.all { variant -> def targetAssets = "${project.buildDir}/intermediates/flutter/${variant.name}" def customSourceSet = variant.getSourceSets()[0] if (customSourceSet instanceof com.android.build.gradle.internal.api.DefaultAndroidSourceSet) { customSourceSet = (com.android.build.gradle.internal.api.DefaultAndroidSourceSet)customSourceSet customSourceSet.getAssets().srcDirs(targetAssets) }
}

对比项目,fluttermodule/.android/Flutter/Build/intermediates/flutter文件夹下,如果缺少debug/flutter_assets会导致主项目Flutter下也缺少这个文件夹,导致项目崩溃。

对比apk发现,assets文件夹下缺少flutter_shared或者flutter_assets会导致以上崩溃。

 

 

Flutter 打包问题 Could not resolve io.flutter:arm64_v8a_release解决

问题日志

Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:processReleaseResources'.
> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'. > Could not resolve io.flutter:arm64_v8a_release:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90. Required by: project :app > Could not resolve io.flutter:arm64_v8a_release:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90. > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90/arm64_v8a_release-1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.pom'. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90/arm64_v8a_release-1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.pom'. > Connect to storage.googleapis.com:443 [storage.googleapis.com/34.64.4.16] failed: Connection timed out: connect > Could not resolve io.flutter:arm64_v8a_release:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90. > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90/arm64_v8a_release-1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.pom'. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90/arm64_v8a_release-1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.pom'. > Connect to storage.googleapis.com:443 [storage.googleapis.com/34.64.4.80] failed: Connection timed out: connect > Could not resolve io.flutter:arm64_v8a_release:1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90. > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90/arm64_v8a_release-1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.pom'. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90/arm64_v8a_release-1.0.0-b851c718295a896918dc93cb1ff14f2f895a1b90.pom'. > Connect to storage.googleapis.com:443 [storage.googleapis.com/34.64.4.80] failed: Connection timed out: connect

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

* Get more help at https://help.gradle.org
BUILD FAILED in 8m 15s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 496.8s (!)
Gradle task assembleRelease failed with exit code 1

解决办法

1.你自己的磁盘:\flutter\packages\flutter_tools\gradle\flutter.gradle

buildscript { repositories { //注释以前的 //google() // jcenter() ///增加这段代码 maven { url'https://maven.aliyun.com/repository/google'}
		maven { url'https://maven.aliyun.com/repository/jcenter'}
		maven { url'http://maven.aliyun.com/nexus/content/groups/public'} } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' }
}
class FlutterPlugin implements Plugin {
	//原下载路径
 	//private static final String MAVEN_REPO = "https://storage.googleapis.com/download.flutter.io";
 	//修改后的下载路径 private static final String MAVEN_REPO = "https://storage.flutter-io.cn/download.flutter.io"

project.rootProject.allprojects { repositories { maven { url repository } ///增加这段代码 maven { url'https://maven.aliyun.com/repository/google'} maven { url'https://maven.aliyun.com/repository/jcenter'} maven { url'http://maven.aliyun.com/nexus/content/groups/public' }
}

2.项目位置:项目名/android/build.gradle

buildscript { ext.kotlin_version = '1.3.50' repositories { /*   google() jcenter()*/ maven{ url 'https://maven.aliyun.com/repository/google' } maven{ url 'https://maven.aliyun.com/repository/jcenter' } maven{ url 'https://maven.aliyun.com/repository/public'} maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'} } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
}

allprojects { repositories { /*   google() jcenter()*/ maven{ url 'https://maven.aliyun.com/repository/google' } maven{ url 'https://maven.aliyun.com/repository/jcenter' } maven{ url 'https://maven.aliyun.com/repository/public'} maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'} }
}

rootProject.buildDir = '../build'
subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects { project.evaluationDependsOn(':app')
}

task clean(type: Delete) { delete rootProject.buildDir
}

解决成功日志

	G:\workspaces\intelligent-logistics-app>flutter  build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size. To generate an app bundle, run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 Learn more on: https://developer.android.com/guide/app-bundle To split the APKs per ABI, run: flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
Removed unused resources: Binary resource data reduced from 894KB to 884KB: Removed 1%
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 216.2s (!)
√ Built build\app\outputs\apk\release\app-release.apk (27.0MB).

 

 

勿删,copyright占位
您找到想要的结果了吗?
Flutter问题解决之 Waiting for another flutter command to release the startup lock.
提交成功!非常感谢您的反馈,我们会继续努力做到更好
分享文章到微博
分享文章到朋友圈

上一篇:js拦截物联返回键跳转到指定页面

下一篇:Java输出流需要明白的几点细节

您可能感兴趣

  • Android工程内嵌Flutter

    本文记录一下Android主工程中嵌入部分Fluttter页面的实现方法。 创建一个Android工程模拟你的现有工程 为了让Android工程和Flutter工程互不干扰,这里不再以Android工程为工程的跟目录,而是让Android工程和平级的Flutter工程的公共目录作为根目录。 最终的目录结构...

  • ORACLE数据库表解锁record is locked by another user

    ORACLE数据库表解锁record is locked by another user 解决方案: 1、查看锁 select t2.username,t2.sid,t2.serial#,t2.logon_tim...

  • (40)C#设计模式——命令模式(Command Pattern)

    定义 命令模式属于对象的行为模式。命令模式是把一个操作或者行为抽象到一个对象中,通过命令的抽象化使发出命令的责任和执行命令的责任分离开。命令模式的实现可以提供命令的撤销和回复功能 结构 既然命令模式是把发出命令的责任和执行命令的责任分隔开,那么中间就必须有某个对象来帮助发出命令者来传达命令,使得执行命令的接收者可以收到命令并执行命令。例如,开学...

  • app widget 在8.0以上收不到广播问题解决

    AppWidget的基础知识可以参考网上也有的资料,相对比较实用的可以看看这篇: app widget简单用法之音乐播放器桌面控件 但在实际调测过程中,8.0版本以上的手机死活收不到service发过来的ACTIO...

  • Navicat操作mysql遇问题1142-create command denied to user×××的解决

    今天使用Navicat的命令列界面操作MySQL的时候遇到了1142-create command denied to user×××的问题,于是在网上查了一下,很简单: 给用户添加CREATE,DROP权限。 Mysql命令: [sql] mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DRO...

  • 解决MySQL满屏在报“Waiting for the table metadata lock”的错误

           因为公司是做网络安全的,所以会对平时设备收到的日志以对应的规则集进行解析然后存入数据库。涉及大数据,与数据库的交互量大概是3000条/秒,所以如果设备持续收日志的话,一般两天时间数据库对应表的存放的数据量大概就有5、6亿条。       有一天我突然发现后台的日志信息一直再报“队列已满”的错误信息,到数据库查询相应表的数据发现其入库的...

  • WIN8.1无法更新kb2919355问题解决心得

    环境:电脑是MACBOOKAIR,用BOOTCAMP安装的WINDOWS系统,是新安装的WINDOWS8.1英文版 原因:安装这个更新包的原因是因为要安装VS2015,提示要更新这个更新包,可是安装却提示“此更新不适用于你的计算机” 过程 : 在网上找了各种的文章,有的说是系统文件损坏,有的说是有安装垃圾要进行清理等,我就不一一赘述了。我和网上...

  • java登录过滤 跨站脚本攻击问题解决

    一,web.xml 文件添加过滤,要加在登陆验证之前 <!-- 特殊字符过滤验证或转义 --> <filter> <filter-name>XSSFilter</filter-name> <filter-class>com.web.system.filter.XSSFilter</filter-class> ...

CSDN

CSDN

中国开发者社区CSDN (Chinese Software Developer Network) 创立于1999年,致力为中国开发者提供知识传播、在线学习、职业发展等全生命周期服务。
Flutter问题解决之 Waiting for another flutter command to release the startup lock.介绍:华为云为您免费提供Flutter问题解决之 Waiting for another flutter command to release the startup lock.在博客、论坛、帮助中心等栏目的相关文章,同时还可以通过 站内搜索 查询更多Flutter问题解决之 Waiting for another flutter command to release the startup lock.的相关内容。| 移动地址: Flutter问题解决之 Waiting for another flutter command to release the startup lock. | 写博客