Android 试图在Ubuntu 13.04上运行Phonegap
我已经准备好运行Phonegap,但我遇到了一个错误。也许有人知道如何解决它 错误如下: 我在键入phonegap run android后出现此错误Android 试图在Ubuntu 13.04上运行Phonegap,android,node.js,ubuntu,cordova,ant,Android,Node.js,Ubuntu,Cordova,Ant,我已经准备好运行Phonegap,但我遇到了一个错误。也许有人知道如何解决它 错误如下: 我在键入phonegap run android后出现此错误 [apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key... -post-package: -do-debug: [zipalign] Running zip align on final apk... [echo]
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/almeidamarcell/my-app/platforms/android/ant-build/HelloWorld-debug.apk
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/ant-build
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 6 seconds
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
{ [ReferenceError: a is not defined]
stack: 'ReferenceError: a is not defined\n at Object.ConfigParser.getPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/ConfigParser.js:88:23)\n at Object.module.exports.findOrientationPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:52:26)\n at Object.module.exports.update_from_config (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:84:36)\n at Object.module.exports.update_project (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:167:18)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/src/prepare.js:113:31\n at _fulfilled (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:798:54)\n at self.promiseDispatch.done (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:827:30)\n at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:760:13)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:821:14\n at flush (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:108:17)' }
Buildfile: /home/almeidamarcell/my-app/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: HelloWorld
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
[echo] Set jars path to: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 1 source file to /home/almeidamarcell/my-app/platforms/android/ant-build/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /home/almeidamarcell/my-app/platforms/android/ant-build/classes
[dex] input: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Using Pre-Dexed classes-a82c7d07d612c222e41d4b5fb4fa6480.jar <- /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /home/almeidamarcell/my-app/platforms/android/ant-build/classes.dex...
[dx] Merged dex A (7 defs/2.2KiB) with dex B (205 defs/312.8KiB). Result is 212 defs/383.8KiB. Took 0.3s
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found modified input file
[aapt] Creating full resource package...
-package:
[apkbuilder] Found modified input file
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/almeidamarcell/my-app/platforms/android/ant-build/HelloWorld-debug.apk
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/ant-build
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 6 seconds
WARNING : No started emulators found, starting an emulator.
/home/almeidamarcell/my-app/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
ERROR : No emulator images (avds) found, if you would like to create an
avd follow the instructions provided here:
http://developer.android.com/tools/devices/index.html
Or run 'android create avd --name <name> --target <targetID>'
in on the command line.
[phonegap] no device was found
[phonegap] trying to install app onto emulator
{ [ReferenceError: a is not defined]
stack: 'ReferenceError: a is not defined\n at Object.ConfigParser.getPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/ConfigParser.js:88:23)\n at Object.module.exports.findOrientationPreference (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:52:26)\n at Object.module.exports.update_from_config (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:84:36)\n at Object.module.exports.update_project (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:167:18)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/src/prepare.js:113:31\n at _fulfilled (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:798:54)\n at self.promiseDispatch.done (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:827:30)\n at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:760:13)\n at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:821:14\n at flush (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/q/q.js:108:17)' }
Buildfile: /home/almeidamarcell/my-app/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: HelloWorld
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.0
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
[echo] Set jars path to: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 1 source file to /home/almeidamarcell/my-app/platforms/android/ant-build/classes
-post-compile:
-obfuscate:
-dex:
[dex] input: /home/almeidamarcell/my-app/platforms/android/ant-build/classes
[dex] input: /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Using Pre-Dexed classes-a82c7d07d612c222e41d4b5fb4fa6480.jar <- /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build/classes.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /home/almeidamarcell/my-app/platforms/android/ant-build/classes.dex...
[dx] Merged dex A (7 defs/2.2KiB) with dex B (205 defs/312.8KiB). Result is 212 defs/383.8KiB. Took 0.3s
-crunch:
[crunch] Crunching PNG Files in source dir: /home/almeidamarcell/my-app/platforms/android/res
[crunch] To destination dir: /home/almeidamarcell/my-app/platforms/android/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Found modified input file
[aapt] Creating full resource package...
-package:
[apkbuilder] Found modified input file
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
-post-package:
-do-debug:
[zipalign] Running zip align on final apk...
[echo] Debug Package: /home/almeidamarcell/my-app/platforms/android/ant-build/HelloWorld-debug.apk
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
[propertyfile] Updating property file: /home/almeidamarcell/my-app/platforms/android/ant-build/build.prop
-post-build:
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/ant-build
[move] Moving 1 file to /home/almeidamarcell/my-app/platforms/android/CordovaLib/ant-build
debug:
BUILD SUCCESSFUL
Total time: 6 seconds
/home/almeidamarcell/my-app/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
ERROR : No emulator images (avds) found, if you would like to create an
avd follow the instructions provided here:
http://developer.android.com/tools/devices/index.html
Or run 'android create avd --name <name> --target <targetID>'
in on the command line.
[error] /home/almeidamarcell/my-app/platforms/android/cordova/run: Command failed with exit code 1
almeidamarcell@ubuntu:~/my-app$
[apkbuilder]创建HelloWorld-debug-unaligned.apk并使用调试密钥对其进行签名。。。
-邮包:
-执行调试:
[zipalign]在最终apk上运行zip align。。。
[echo]调试包:/home/almeidamarcell/my app/platforms/android/ant build/HelloWorld-Debug.apk
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/ant build/build.prop
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/ant build/build.prop
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/ant build/build.prop
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/ant build/build.prop
-建造后:
[移动]将1个文件移动到/home/almeidamarcell/my app/platforms/android/ant build
[移动]将1个文件移动到/home/almeidamarcell/my app/platforms/android/CordovaLib/ant build
调试:
建设成功
总时间:6秒
[phonegap]已成功编译Android应用程序
[phonegap]正在尝试将应用程序安装到设备上
{[ReferenceError:未定义a]
堆栈:Object.ConfigParser.getPreference(/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/ConfigParser.js:88:23)处未定义引用错误:a\n Object.module.exports.findoritionPreference(/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/metadata/android_parser.js:52:26)\n位于Object.module.exports.update\u from\u config(/usr/local/lib/node\u modules/phonegap/node\u modules/cordova/src/metadata/android\u parser.js:84:36)\n位于Object.module.exports.update\u项目(/usr/local/lib/node\u modules/phonegap/node\u modules/cordova/src/metadata/android\u parser.js:167:18)\n在/usr/local/lib/node\u modules/phonegap/node\u modules/cordova/src/prepare.js:113:31\n在完成时(/usr/local/lib/node\u modules/phonegap/node\u modules/cordova/node\u modules/q/q.js:798:54)\n在self.promisedpatch.done(/usr/local/lib/node\node\u modules/phonegap/node\node\u modules/cordova/node\u modules/q.js:827:30)\n at Promise.promiseDispatch(/usr/local/lib/node\u modules/phonegap/node\u modules/cordova/node\u modules/q/q.js:760:13)\n at/usr/local/lib/node\u modules/phonegap/node\u modules/q/q.js:821:14\n处于刷新状态(/usr/local/lib/node\u modules/phonegap/node\u modules/cordova/node\u modules/q/q.js:108:17)})
Buildfile:/home/almeidamarcell/my-app/platforms/android/build.xml
-设置模式检查:
-设置调试文件:
-检查环境:
[checkenv]Android SDK工具修订版22.6.0
[checkenv]安装在/opt/android sdk linux上
-设置:
[echo]项目名称:HelloWorld
[gettype]项目类型:应用程序
-设置调试模式:
-调试混淆检查:
-预构建:
-生成设置:
[getbuildtools]使用最新的构建工具:19.0.3
[echo]正在解析HelloWorld的生成目标。。。
[gettarget]项目目标:Android 4.4.2
[gettarget]API级别:19
[回声]----------
[echo]如果需要,正在创建输出目录。。。
[回声]----------
[echo]正在解析HelloWorld的依赖项。。。
[依赖项]库依赖项:
[依赖性]
[依赖性]------------------
[依赖项]有序库:
[依赖性]
[依赖性]------------------
[回声]----------
[echo]正在使用“调试”生成库。。。
节点:
-设置模式检查:
-设置调试文件:
-检查环境:
[checkenv]Android SDK工具修订版22.6.0
[checkenv]安装在/opt/android sdk linux上
-设置:
[echo]项目名称:CordovaLib
[gettype]项目类型:Android库
-设置调试模式:
-调试混淆检查:
-预构建:
-生成设置:
[getbuildtools]使用最新的构建工具:19.0.3
[echo]正在解析CordovaLib的生成目标。。。
[gettarget]项目目标:Android 4.4.2
[gettarget]API级别:19
[回声]----------
[echo]如果需要,正在创建输出目录。。。
[回声]----------
[echo]正在解析CordovaLib的依赖项。。。
[依赖项]库依赖项:
[依赖关系]没有库
[依赖性]
[依赖性]------------------
-代码生成:
[mergemanifest]找到已删除的目标文件
[mergemanifest]将AndroidManifest文件合并为一个文件。
[mergemanifest]已禁用清单合并。仅使用项目清单。
[echo]正在处理aidl文件。。。
[aidl]没有要编译的aidl文件。
[回声]----------
[echo]正在处理RenderScript文件。。。
[回声]----------
[echo]正在处理资源。。。
[aapt]找到修改的输入文件
[aapt]正在生成资源ID。。。
[回声]----------
[echo]正在处理BuildConfig类。。。
[buildconfig]无需生成新的buildconfig。
-预编译:
-汇编:
[echo]正在创建库输出jar文件。。。
-编译后:
-混淆:
-指数:
[echo]库项目:不转换字节码。。。
-嘎吱嘎吱:
[crunch]在源目录下处理PNG文件:/home/almeidamarcell/my app/platforms/android/CordovaLib/res
[crunch]到目的地目录:/home/almeidamarcell/my app/platforms/android/CordovaLib/ant build/res
[crunch]压缩了0个PNG文件以更新缓存
-套餐资源:
[echo]库项目:不打包资源。。。
-包装:
[echo]库项目:不打包apk。。。
-邮包:
-执行调试:
[echo]库项目:不创建apk。。。
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/CordovaLib/ant build/build.prop
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/CordovaLib/ant build/build.prop
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/CordovaLib/ant build/build.prop
[propertyfile]正在更新属性文件:/home/almeidamarcell/my app/platforms/android/CordovaLib/ant build/build.prop
-建造后:
调试:
-代码生成:
[mergemanifest]找到已删除的目标文件
[默格