java.exe finished with non-zero exit value 1 问题引申

今天导入layoutlib.jar,在eclipse上没有啥问题,但是在android studio 上就是如下的问题:

Error:Execution failed for task ':dexAppDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:> Process 'command 'C:Program FilesJavajdk1.8.0_25 in java.exe'' finished with non-zero exit value 1

网上有人说是gradle里加入

dexOptions {  

javaMaxHeapSize "xx"

}

然并卵。后面再搜如何扩展gradle的编译使用内存。也是卵。。。。

后面再查,是否因为我的gradle里配置的

compileSdkVersion 和 targetSdkVersion 以及要导入的layoutlib.jar的不一致。然而发现都是一致的。哭了。。。。。
擦干了泪,我再搜android studio layoutlib.jar,最后在一位知乎评论里看到了如下的方式引入layoutlib.jar,顺利完成编译。。。。

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
    compile files('libs/fastjson-1.1.43.android.jar')
    compile files('libs/analytics-5.6.1.jar')
    compile files('libs/commons-codec-1.10.jar')
    compile files('libs/IPJ1.jar')
    compile files('libs/layoutlib.jar')
    provided files(getLayoutLibPath())
}

def getLayoutLibPath() {
    def rootDir = project.rootDir
    def localProperties = new File(rootDir, "local.properties")
    if (localProperties.exists()) {
        Properties properties = new Properties()
        localProperties.withInputStream {
            instr -> properties.load(instr)
        }
        def sdkDir = properties.getProperty('sdk.dir')
        def compileSdkVersion = android.compileSdkVersion
        Console.println("app compileSdkVersion : " + compileSdkVersion)
        def androidJarPath = sdkDir + "/platforms/" + compileSdkVersion + "/data/layoutlib.jar"
        return androidJarPath
    }
    return rootDir
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This book is designed to teach you how to use AdonisJs. To get the most out of it, you should have a firm grasp of modern JavaScript and some knowledge of how to work with relational databases and the command line. I explain new and interesting bits of syntax, but this book isn’t primarily about teaching you how to use JavaScript. It’s about teaching you how to build real applications by using AdonisJs. The application we’re going to build is called Threadbear. It’s a play on words, meant to conjure up thoughts of patchy, knitted teddy bears. We’re going to make an application through which sellers can register and upload their knitted patterns and products. Customers will then be able to register and purchase these things. We’re not going to focus much on design. Instead, we’re going to focus on the mechanics of commerce applications. Beyond adding a CSS framework, everything is as the good browser vendors intended. That said, I welcome you to add your own style to the application We’ll create a secure registration and login system. We’ll add profile and product management. We’ll connect the front end to the back end by using WebSockets and the Fetch API. We’ll design a shopping cart in React and we’ll package static files with a custom build chain. Finally, we’ll learn how to deploy the application to a virtual server, and install custom domains and SSL certificates. It is my hope that by the time you are finished reading this book, you’ll know all you need to know in order to build your online business.
引用\[1\]:Execution failed for task ':core:Kafka.main()'. > Process 'command 'C:/Program Files/Java/jdk1.8.0_77/jre/bin/java.exe'' finished with non-zero exit value 1 。 引用\[2\]:碰到的问题: 1)运行java的main方法出现 Process ‘command ‘D:/jdk8/bin/java.exe’’ finished with non-zero exit value 1 将idea的gradle按如下设置 2)Failed to apply plugin \[id ‘com.gradle.build-scan’\] What went wrong: An exception occurred applying plugin request \[id: ‘com.gradle.build-scan’, version: ‘1.8’\] 。 引用\[3\]:Open File(spring-beans\spring-beans.gradle ) 点击:Open File 然后注释掉 //compileGroovy.dependsOn = compileGroovy.taskDependencies.values - ‘compileJava’ 。 问题:Process 'command 'D:/JDK8/bin/java.exe'' finished with non-zero exit value 1 回答: 出现"Process 'command 'D:/JDK8/bin/java.exe'' finished with non-zero exit value 1"的错误通常是由于Java程序在执行过程中遇到了问题导致的。这个错误可能有多种原因,比如代码错误、依赖问题或者环境配置错误。根据提供的引用内容,有两个可能的解决方案。首先,你可以检查你的代码,确保没有语法错误或逻辑错误。其次,你可以检查你的依赖项和环境配置,确保它们正确设置。如果问题仍然存在,你可以尝试注释掉一些代码或者调整一些配置,以便找到问题的根本原因。希望这些解决方案能帮助你解决这个问题。 #### 引用[.reference_title] - *1* [kafka Process ‘command ‘/jdk1.8.0_77/jre/bin/java.exe finished with non-zero exit value 1](https://blog.csdn.net/qq_31686241/article/details/125113723)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [IDEA导入spring5.1源码的构建](https://blog.csdn.net/qq_40088250/article/details/104219666)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值