npm i macaca-android -g命令执行异常:For 'N' SDK Preview, attribute minSdkVersion in AndroidManifest.xml must be 'N'
- Macaca Version: 1.0.24
- Macaca Doctor: 正常
- Platform: android EdisondeMacBook-Air:MXD-IOS-macaca edison$ npm i macaca-android -g npm WARN deprecated [email protected]: use cross-spawn or cross-spawn-async instead.
[email protected] install /usr/local/lib/node_modules/macaca-android/node_modules/unlock-apk node ./script/build.js
JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home Buildfile: /usr/local/lib/node_modules/macaca-android/node_modules/unlock-apk/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 25.1.3
[checkenv] Installed at /Users/edison/Library/Android/sdk
-setup:
[echo] Project Name: unlock_apk
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 23.0.3
[echo] Resolving Build Target for unlock_apk...
[gettarget] Project Target: Android N (Preview)
[gettarget] API level: N
BUILD FAILED /Users/edison/Library/Android/sdk/tools/ant/build.xml:538: For 'N' SDK Preview, attribute minSdkVersion in AndroidManifest.xml must be 'N' (current: )
Total time: 1 second
[Error: build failed] /usr/local/lib/node_modules/macaca-android/node_modules/unlock-apk/script/build.js:28 throw e; ^
Error: build failed
at ChildProcess.node ./script/build.js
npm WARN install:[email protected] Exit status 1
[email protected] install /usr/local/lib/node_modules/macaca-android/node_modules/macaca-chromedriver ./bin/macaca-chromedriver install
chromedriver cdn url: http://chromedriver.storage.googleapis.com/2.20/chromedriver_mac32.zip chromedriver local in /usr/local/lib/node_modules/macaca-android/node_modules/macaca-chromedriver/exec/chromedriver Fixed file permissions
[email protected] install /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client node ./scripts/build.js
JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home Updated file ./build.xml
Buildfile: /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/build.xml
-check-env:
[checkenv] Android SDK Tools Revision 25.1.3
[checkenv] Installed at /Users/edison/Library/Android/sdk
-build-setup:
[getbuildtools] Using latest Build Tools: 23.0.3
[echo] Resolving Build Target for uiautomator-bootstrap...
[getuitarget] Project Target: Android N (Preview)
[getuitarget] API level: N
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/bin
[mkdir] Created dir: /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/bin/classes
-pre-compile:
compile:
[javac] Compiling 15 source files to /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/bin/classes
[javac] 警告: [options] 源值1.5已过时, 将在未来所有发行版中删除
[javac] 警告: [options] 目标值1.5已过时, 将在未来所有发行版中删除
[javac] 警告: [options] 要隐藏有关已过时选项的警告, 请使用 -Xlint:-options。
[javac] 3 个警告
-post-compile:
-dex:
[dex] input: /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/bin/classes
[dex] Converting compiled files and external libraries into /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/bin/classes.dex...
-post-dex:
-jar:
[jar] Building jar: /usr/local/lib/node_modules/macaca-android/node_modules/uiautomator-client/bin/uiautomator-bootstrap.jar
-post-jar:
build:
BUILD SUCCESSFUL Total time: 3 seconds
uiautomator-bootstrap build success! /usr/local/lib └── (empty)
npm ERR! code 1
删除 sdk n后解决
@ftvbftvbq 新版cli新增了对android环境的检测,请更新