我使用的是 Ubuntu 12.04.4 LTS,我的 Android 手机是
Samsung Galaxy S3 Neo I93001 Android 版本 4.3 并已成功连接到设备。
~$ adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
4e1eb1e1 device
尝试在 Android 设备中构建示例应用程序时出现此错误。
Execution failed for task ':CordovaLib:processDebugResources'.
java.io.IOException: Cannot run program "/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
~/socially1-3$ meteor run android-device --verbose
Getting installed version for platform android in Cordova project
Checking Cordova requirements for platform Android
[[[[[ /socially1-3 ]]]]]
=> Started proxy.
=> Started MongoDB.
Local package version is up-to-date: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="39585a5a564c574d4a145b584a5c7908170b170b" rel="noreferrer noopener nofollow">[email protected]</a>
....
Local package version is up-to-date: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="384f5d5a5948481550594b5051565f78091608160d" rel="noreferrer noopener nofollow">[email protected]</a>
Preparing Cordova project from app bundle
Processing mobile-config.js
Copying resources for mobile apps
Writing new config.xml
Preparing Cordova project for platform Android
WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server, make sure your device is on
the same network, and that the network configuration allows clients to talk to each other (no client isolation).
Running Cordova app for platform Android with options --device
ANDROID_HOME=/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Running: /socially1-3/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildDebug -b /socially1-3/.meteor/local/cordova-build/platforms/android/build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
=> Started your app.
=> App running at: http://localhost:3000/
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
java.io.IOException: Cannot run program "/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 29.25 secs
Starting app on Android Device \
/socially1-3/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /socially1-3/.meteor/local/cordova-build/platforms/android/gradlew with args: cdvBuildDebug,-b,/socially1-3/.meteor/local/cordova-build/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
=> Errors executing Cordova commands:
While running Cordova app for platform Android with options --device:
Error: Command failed: /socially1-3/.meteor/local/cordova-build/platforms/android/cordova/run
--device
at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess.handle.onexit (childprocess.js:820:12)
ExitWithCode:1
我首先认为文件“aapt”不可用或没有该文件的权限。但是'aapt'文件在指定的路径下是可用的,并且用户也有读写权限。
最佳答案
您正在尝试在 64 位系统上运行 32 位文件。尝试一下
>file aapt
它应该给你以下结果
aapt: ELF 32-bit LSB shared object ...
SDK Manager 实际上正在安装 32 位文件..
尝试此修复:
(Using software centre or command lines) If your Ubuntu is a 32-bit OS then install libgl1-mesa-dev
In case of 64-bit OS install ia32-libs (Ubuntu 13.04 or earlier), or libgl1-mesa-dev:i386 (Ubuntu 13.10 and above)
关于cordova - 错误 : java. io.IOException:在 Android 设备上构建在任务 'processDebugResources' 处失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35037373/