Saya mencoba mengikuti petunjuk penggunaan cordova di laman ini: http://cordova.apache.org/docs/en/dev/guide/cli/index.html.

Menginstal Cordova

npm install -g cordova

cordova.png

Membuat Aplikasi dengan Cordova

cordova create hello com.example.hello HelloBlora

create

kemudian silakan cek di direktori:

hasil create.png

Melihat Platform yang tersedia

platforms.png

Melihat Apakah Requirements Terpenuhi

requirements

Mem- build aplikasi

Saya mencoba, tetapi terjadi error berikut:

C:\Users\sosial\hello>cordova build
ANDROID_HOME=C:\Program Files\Android\android-sdk
JAVA_HOME=C:\Program Files\java\jdk1.7.0_55
Downloading http://services.gradle.org/distributions/gradle-2.13-all.zip
……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….
Unzipping C:\Users\sosial\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1q\gradle-2.13-all.zip to C:\Users\sosial\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1q
Starting a new Gradle Daemon for this build (subsequent builds will be faster).

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/2.13/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 object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.
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/2.13/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 object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

C:\Users\sosial\hello>

Nah, masalahnya ada di error ketika menjalankan Java Virtual Machine. Solusinya bisa dilihat di laman ini: http://www.tomsguide.com/faq/id-1761312/fix-create-java-virtual-machine-issue.html, yakni dengan menambahkan variabel “_JAVA_OPTIONS” pada environment variables dengan isian “-Xmx512M”.

Saya coba lagi untuk mem-build:


C:\Users\sosial\hello>cordova build android
ANDROID_HOME=C:\Program Files\Android\android-sdk
JAVA_HOME=C:\Program Files\java\jdk1.7.0_55
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-core/2.1.0/gradle-core-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/2.1.0/builder-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/25.1.0/lint-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-api/2.1.0/gradle-api-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/databinding/compilerCommon/2.1.0/compilerCommon-2.1.0.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
Download https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/5.2.1/proguard-parent-5.2.1.pom
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.pom
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.build/0.7.4.201502262128/org.jacoco.build-0.7.4.201502262128.pom
Download https://repo1.maven.org/maven2/org/antlr/antlr/3.5.2/antlr-3.5.2.pom
Download https://repo1.maven.org/maven2/org/antlr/antlr-master/3.5.2/antlr-master-3.5.2.pom
Download https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/2.1.0/builder-model-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/2.1.0/builder-test-api-2.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/25.1.0/sdklib-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/25.1.0/sdk-common-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/common/25.1.0/common-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/25.1.0/manifest-merger-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/25.1.0/ddmlib-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/jack/jack-api/0.10.0/jack-api-0.10.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/jill/jill-api/0.10.0/jill-api-0.10.0.pom
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
Download https://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.pom
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/25.1.0/lint-checks-25.1.0.pom
Download https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.pom
Download https://repo1.maven.org/maven2/com/android/tools/annotations/25.1.0/annotations-25.1.0.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava/17.0/guava-17.0.pom
Download https://repo1.maven.org/maven2/com/google/guava/guava-parent/17.0/guava-parent-17.0.pom
Download https://repo1.maven.org/maven2/com/android/databinding/baseLibrary/2.1.0/baseLibrary-2.1.0.pom
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4/4.5/antlr4-4.5.pom
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4-master/4.5/antlr4-master-4.5.pom
Download https://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/25/commons-parent-25.pom
Download https://repo1.maven.org/maven2/org/apache/apache/9/apache-9.pom
Download https://repo1.maven.org/maven2/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.pom
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-parent/5.0.1/asm-parent-5.0.1.pom
Download https://repo1.maven.org/maven2/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.pom
Download https://repo1.maven.org/maven2/org/antlr/ST4/4.0.8/ST4-4.0.8.pom
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/25.1.0/layoutlib-api-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/25.1.0/dvlib-25.1.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/repository/25.1.0/repository-25.1.0.pom
Download https://repo1.maven.org/maven2/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/33/commons-parent-33.pom
Download https://repo1.maven.org/maven2/org/apache/apache/13/apache-13.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1.1/httpcomponents-client-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1/httpcomponents-client-4.1.pom
Download https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/25.1.0/lint-api-25.1.0.pom
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.pom
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4-runtime/4.5/antlr4-runtime-4.5.pom
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4-annotations/4.5/antlr4-annotations-4.5.pom
Download https://repo1.maven.org/maven2/com/intellij/annotations/12.0/annotations-12.0.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-core/4.1/httpcomponents-core-4.1.pom
Download https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/5/commons-parent-5.pom
Download https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.pom
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.pom
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/11/commons-parent-11.pom
Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.pom
Download https://repo1.maven.org/maven2/org/abego/treelayout/org.abego.treelayout.core/1.0.1/org.abego.treelayout.core-1.0.1.pom
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-core/2.1.0/gradle-core-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder/2.1.0/builder-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint/25.1.0/lint-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/gradle-api/2.1.0/gradle-api-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/databinding/compilerCommon/2.1.0/compilerCommon-2.1.0.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar
Download https://repo1.maven.org/maven2/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.jar
Download https://repo1.maven.org/maven2/org/antlr/antlr/3.5.2/antlr-3.5.2.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-model/2.1.0/builder-model-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/builder-test-api/2.1.0/builder-test-api-2.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdklib/25.1.0/sdklib-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/sdk-common/25.1.0/sdk-common-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/common/25.1.0/common-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/build/manifest-merger/25.1.0/manifest-merger-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/ddms/ddmlib/25.1.0/ddmlib-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/jack/jack-api/0.10.0/jack-api-0.10.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/jill/jill-api/0.10.0/jill-api-0.10.0.jar
Download https://repo1.maven.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar
Download https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar
Download https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-checks/25.1.0/lint-checks-25.1.0.jar
Download https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
Download https://repo1.maven.org/maven2/com/android/tools/annotations/25.1.0/annotations-25.1.0.jar
Download https://repo1.maven.org/maven2/com/google/guava/guava/17.0/guava-17.0.jar
Download https://repo1.maven.org/maven2/com/android/databinding/baseLibrary/2.1.0/baseLibrary-2.1.0.jar
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4/4.5/antlr4-4.5.jar
Download https://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar
Download https://repo1.maven.org/maven2/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar
Download https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.1/asm-debug-all-5.0.1.jar
Download https://repo1.maven.org/maven2/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.jar
Download https://repo1.maven.org/maven2/org/antlr/ST4/4.0.8/ST4-4.0.8.jar
Download https://repo1.maven.org/maven2/com/android/tools/layoutlib/layoutlib-api/25.1.0/layoutlib-api-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/dvlib/25.1.0/dvlib-25.1.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/repository/25.1.0/repository-25.1.0.jar
Download https://repo1.maven.org/maven2/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
Download https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar
Download https://repo1.maven.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar
Download https://repo1.maven.org/maven2/com/android/tools/lint/lint-api/25.1.0/lint-api-25.1.0.jar
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4-runtime/4.5/antlr4-runtime-4.5.jar
Download https://repo1.maven.org/maven2/com/tunnelvisionlabs/antlr4-annotations/4.5/antlr4-annotations-4.5.jar
Download https://repo1.maven.org/maven2/com/intellij/annotations/12.0/annotations-12.0.jar
Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar
Download https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar
Download https://repo1.maven.org/maven2/org/abego/treelayout/org.abego.treelayout.core/1.0.1/org.abego.treelayout.core-1.0.1.jar
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:compileDebugAidl
:CordovaLib:generateDebugBuildConfig
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:processDebugManifest
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac – is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac – is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:prePackageMarkerForDebug
:transformClassesWithDexForDebug
Running dex in-process requires build tools 23.0.2.
For faster builds update this project to use the latest build tools.
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 1 mins 44.248 secs
Built the following apk(s):
C:/Users/sosial/hello/platforms/android/build/outputs/apk/android-debug.apk

C:\Users\sosial\hello>

berhasil.png

Advertisements