Unzipping C:Usersapp.gradlewrapperdistsgradle-4.1-allzyivzo6n839fup2jbap0tjewgradle-4.1-all.zip to C:Usersapp.gradlewrapperdistsgradle-4.1-allzyivzo6n839fup2jbap0tjew
安装Gradle 之后 ,一直报错,主要如下 一直以为是 Unable to start the daemon process,搜到的解决方案就是删除用户目录下面的.gradle ,没有仔细往下看,删除几次未果。往下看:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
就查了下 :https://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap
This can also be caused by setting something too large on a 32-bit HotSpot vm, for example:
-Xms1536m -Xmx1536m
where this might/would work:
-Xms1336m -Xmx1336m
原来是我的java版本是32的 分配内存有限制 所以装一个64位版本的jdk就行了
-------------------------------------------------------------------
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
FAILURE: Build failed with an exception.
.
* What went wrong:
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/4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
.
* Try:
Run with
--stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
* Get more help at https://help.gradle.org
(node:10276) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
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/4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
at ChildProcess.whenDone
(F:srcjscordovahelloWorldplatformsandroidcordova
ode_modulescordova-commonsrcsuperspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:10276)
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a
catch block, or by rejecting a promise which was not handled with
.catch(). (rejection id: 1)
(node:10276) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In the
future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
--------------------------------------------------------------
http://www.cnblogs.com/yanxiaodi/p/5750860.html
问题二:打包错误,提示Unable to start the daemon process.
这个问题找了很多原因,有的说要改gradle.properties,也不管用,后来我删掉了D:yourusername.gradle文件夹,重新编译才过。如果失败一次的话,重新编译的话还是会失败,只能删掉重新来。
以上这两个问题是打包到Cordova的时候遇到的,还有一些其他的问题就没记下来,比较大的原因就是网络没下载到某些文件所致。我们是已经有了一个Cordova的平台,只做里面的html5插件即可,所以打包这部分没再仔细研究。
---------------------------------------------------------------------