【Windows】CreateProcess error=206,文件名或扩展名太长
程序员文章站
2022-03-03 08:23:23
...
目录
问题
最近在Win 环境下跑APP,时不时的弹出 "CreateProcess error=206,文件名或扩展名太长" 的问题,刚开始的时候没咋注意,报错了,再次运行看着也不影响跑;
解决
方式一
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0"
}
}
apply plugin: "ua.eshepelyuk.ManifestClasspath"
注意: 此处应用在Project 的build.gradle 文件中,而不是
modules的build.gradle文件;
此时Project/build.gradle 为如下所示:
import java.nio.file.Paths
apply from: 'dependencies.gradle'
apply plugin: "ua.eshepelyuk.ManifestClasspath"
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.build_gradle_version = '3.3.2'
ext.greendao_gradle_plugin_version = '3.2.2'
ext.butterknife_gradle_plugin_version = '9.0.0'
repositories {
// maven { url "https://jitpack.io" }
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
mavenLocal()
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$build_gradle_version"
classpath "org.greenrobot:greendao-gradle-plugin:$greendao_gradle_plugin_version"
classpath "com.jakewharton:butterknife-gradle-plugin:$butterknife_gradle_plugin_version"
classpath "gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0"
// classpath 'com.github.TWiStErRob.butterknife:butterknife-gradle-plugin:fix1431-SNAPSHOT'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
mavenLocal()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
File outFile = file(Paths.get(project.rootDir.toString(), 'outputs'))
if (outFile.exists())
outFile.deleteDir()
}
方式二
plugins {
id "ua.eshepelyuk.ManifestClasspath" version "1.0.0"
}
参考
(完)
推荐阅读
-
(转)windows删除node_modules 文件名或扩展名太长
-
Cannot run program CreateProcess error=206, 文件名或扩展名太长
-
解决idea中CreateProcess error=206, 文件名或扩展名太长
-
Java IDEA CreateProcess error=206, 文件名或扩展名太长解决
-
【Windows】CreateProcess error=206,文件名或扩展名太长
-
CreateProcess error=206, 文件名或扩展名太长。 Gradle
-
ant CreateProcess error=206, 文件名或扩展名太长
-
Idea社区版 debug 启动 Cannot run program ““ :CreateProcess error=206, 文件名或扩展名太长