为什么我需要根目录来编译那些无效的Cordova应用程序?

时间:2015-08-10 11:53:48

标签: android cordova gradle emulation

我无法弄清楚为什么我不能再在使用Cordova的同一台计算机上构建Android应用程序,而这些计算机是在我更新Cordova和NodeJS之后构建上个月运行的相同应用程序的。 目前,我必须利用超级用户权限才能获得Cordova启动模拟器,但它无法在模拟器上安装应用程序,并随后因以下错误而崩溃。 首先以

为根
sudo -E su

然后cordova命令将启动没有sudo的模拟器

cordova emulate android

如果我尝试使用cordova运行android,我就无法在连接的设备上启动。以下是删除root然后运行emulate命令后的输出。

Running command: /home/lyndon/myapp/platforms/android/cordova/run --emulator
ANDROID_HOME=/home/lyndon/Software/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-oracle/bin
WARNING : no emulator specified, defaulting to myavd
Waiting for emulator...
emulator: emulator window was out of view and was recentered

Booting up emulator (this may take a while)...................BOOT COMPLETE
Running: /home/lyndon/myapp/platforms/android/gradlew cdvBuildDebug -b /home/lyndon/myapp/platforms/android/build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true

ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-8-oracle/bin

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.


/home/lyndon/myapp/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /home/lyndon/myapp/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/lyndon/myapp/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
Error: /home/lyndon/myapp/platforms/android/cordova/run: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5) 

我以前从未必须使用Cordova启动Android模拟器,为什么目前就是这种情况,为什么应用程序没有在模拟器上安装?

0 个答案:

没有答案