alibaba / macaca

Automation solution for multi-platform. 多端自动化解决方案
https://macacajs.github.io
MIT License
3.17k stars 419 forks source link

win 7 环境android驱动一直没装成功啊 #235

Closed nicholas-geek closed 8 years ago

nicholas-geek commented 8 years ago

win 7 安装macaca-android驱动时候总是编译报错,一直没成功过,实在不行只能放弃了!可能是人品有问题啊。。。

环境变量: macaca-doctor version: 1.0.21

Node.js checklist:

node env: D:\Program Files\nodejs\node.exe node version: v4.6.0

Android checklist:

JAVA version is 1.7.0_67 JAVA_HOME is set to E:\Program Files\Java\jdk1.7.0_67 ANDROID_HOME is set to D:\AndroidSdk\android-sdk Platforms is set to D:\AndroidSdk\android-sdk\platforms\android-22 Android tools is set to D:\AndroidSdk\android-sdk\tools\android.bat ADB tool is set to D:\AndroidSdk\android-sdk\platform-tools\adb.exe ANT_HOME is set to D:\apache-ant-1.9.7

Installed driver list:

其中,npm版本是2.15.9

Android SDK只用了API 22, API 23都没敢用,macaca-cli装好后就用cnpm装了macaca-chrome驱动,然后就开始安装 cnpm i -g macaca-android,编译报错信息如下:

[macaca-android@*] installed at node_modules.macaca-android_npminstall\node_modules.1.0.34@macaca-android (115 packages, use 8s, speed 193.59kB/s, json 1.46MB, tarball 0B) execute post install scripts... [unlock-apk@0.1.16] scripts.install: "node ./script/build.js" at D:\Program Files\nodejs\node_global\node_modules.macaca-android_npminstall\node_modules.0.1.16@unlock-apk JAVA_HOME is set to E:\Program Files\Java\jdk1.7.0_67 Buildfile: D:\Program Files\nodejs\node_global\node_modules.macaca-android_npminstall\node_modules.0.1.16@unlock-apk\build.xml

-set-mode-check:

-set-debug-files:

-check-env:

[checkenv] Android SDK Tools Revision 25.2.2

[checkenv] Installed at D:\AndroidSdk\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: 24.0.2

 [echo] Resolving Build Target for unlock_apk...

[gettarget] Project Target: Android 5.1.1

[gettarget] API level: 22

[gettarget] WARNING: No minSdkVersion value set. Application will install on all Android versions.

 [echo] ----------

 [echo] Creating output directories if needed...

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\libs

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\res

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\rsObj

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\rsLibs

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\gen

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\classes

[mkdir] Created dir: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\dexedLibs

 [echo] ----------

 [echo] Resolving Dependencies for unlock_apk...

[dependency] Library dependencies:

[dependency] No Libraries

[dependency]

[dependency] ------------------

 [echo] ----------

 [echo] Building Libraries with 'debug'...

[subant] No sub-builds to iterate on

-code-gen:

[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] Generating resource IDs...

 [echo] ----------

 [echo] Handling BuildConfig class...

[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:

[javac] Compiling 3 source files to D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\classes

[javac] ע: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\src\xdf\android_unlock\MainActivity.javaʹ�û򸲸����ѹ�ʱ�� API��

[javac] ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣

-post-compile:

-obfuscate:

-dex:

  [dex] input: D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\classes

  [dex] Converting compiled files and external libraries into D:\Program Files\nodejs\node_global\node_modules\.macaca-android_npminstall\node_modules\.0.1.16@unlock-apk\bin\classes.dex...

   [dx] java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0

   [dx]     at java.lang.ClassLoader.defineClass1(Native Method)
   [dx]     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

   [dx]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

   [dx]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

   [dx]     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

   [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

   [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

   [dx]     at java.security.AccessController.doPrivileged(Native Method)

   [dx]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

   [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

   [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:412)

   [dx]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
   [dx]     at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

   [dx] Exception in thread "main" 

BUILD FAILED D:\AndroidSdk\android-sdk\tools\ant\build.xml:888: The following error occurred while executing this line: D:\AndroidSdk\android-sdk\tools\ant\build.xml:890: The following error occurred while executing this line: D:\AndroidSdk\android-sdk\tools\ant\build.xml:902: The following error occurred while executing this line: D:\AndroidSdk\android-sdk\tools\ant\build.xml:283: null returned: 1

Total time: 1 second

[Error: build failed]

ziczhu commented 8 years ago

要不你更新到 24 和 java 8 再试试

xudafeng commented 8 years ago

https://macacajs.com/macaca/faq.html