Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Studio Gralde不在Mac上构建_Android_Android Gradle Plugin_Build.gradle - Fatal编程技术网

Android Studio Gralde不在Mac上构建

Android Studio Gralde不在Mac上构建,android,android-gradle-plugin,build.gradle,Android,Android Gradle Plugin,Build.gradle,我正在尝试我的android项目,我在两个不同的系统中导入该项目,一个是windows 10,另一个是Mac OS。 Android studiogradle在windows上构建,没有问题 但在Mac上,大约1.5小时后,它只显示以下错误 Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an

我正在尝试我的android项目,我在两个不同的系统中导入该项目,一个是windows 10,另一个是Mac OS。 Android studio
gradle
在windows上构建,没有问题 但在Mac上,大约1.5小时后,它只显示以下错误

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
Unable to create daemon log file

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
我在我的项目
gradle.properties
上添加了
org.gradle.jvmargs=-Xmx512m
,但现在是结果

我的
gradle wrapper.properties

#Fri Jun 08 19:47:34 IRDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
和我的系统信息

OS X  10.13.5 (17F77)  - High Sierra 
Android Studio  3.1.3
Gradle   4.4-all
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
当前我的Android Studio返回以下错误

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
Unable to create daemon log file

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
未找到模块的Gradle项目的根项目路径:…


我在mac上安装Gradle,并通过命令行构建它,没有任何问题,但在android studio中…

尝试在Gradle.properties中添加这行代码 org.gradle.jvmargs=-Xmx1024m-XX:MaxPermSize=512m 然后重新启动android studio。

  • chmod+x./gradlew
  • 尝试在没有守护程序的情况下运行:
  • /gradlew--stop
    停止系统中的所有守护进程,它们可能会相互冲突

  • /gradlew assembleDebug--试运行
    -运行以确认gradle文件是否包含任何语法错误
  • 确认根项目包含build.gradle文件,确认所有模块都包含build.gradle文件
  • 检查settings.gradle文件以及其中包含的模块的方式,如:
  • macos和windows在路径定义上有差异,所有文件路径的东西都应该正确更改。使用
    /
    作为macos和windows的路径分隔符。(在win
    \
    中是一个路径分隔符)
  • 如果您的模块结构比检查所有级别是否存在
    build.gradle
    文件更深,则可能会导致问题,尤其是在使用子模块git配置时
  • 仔细检查执行gradle包装的文件夹,您应该留在项目根文件夹中
助手:

def adoptToOs(String path) {
    // remove doubled dir separators
    path = path.replace("//", "/")
    path = path.replace("\\\\", "\\")

    if (Os.isFamily(Os.FAMILY_WINDOWS)) { // windows
        path = path.replace("/", "\\")
    } else if (Os.isFamily(Os.FAMILY_UNIX)) { // linux
        path = path.replace("\\", "/")
    } else if (Os.isFamily(Os.FAMILY_MAC)) { // mac os
        path = path.replace("\\", "/")
    }

    return path;
}
用法:

def path = """${project.buildDir}/reports/checkstyle/checkstyle.html"""
project.logger.info('  report: ' + adoptToOs(path))

你查过许可证了吗。或者检查它是否可执行?@CastroAlhdo如何检查它是否可执行?重新启动计算机,删除
.gradle
工作目录,然后重试。(或者试试——干净)@JamesPoag我做了这些事情,但没有结果。这不起作用,我测试这个。我觉得其他配置有问题谢谢@Olek我觉得我的android studio和gradle版本有问题
/gradlew AssembledBug--干运行
这次运行没有任何错误