修改导入工程的方法
把 File -> Import -> Android -> Existing Android Code Into Workspace
改为
File -> Import -> General -> Existing projects Into Workspace...
2\[环境相关] jdk升级到1.7后,打开以前的android项目出现错误
在Problems中提示错误是“ Android requires compiler compliance level 5.0 or 6.0.Found ''1.7” instead.Please use Android Tools >Fix Project Properties.现在使用eclipse版本是3.8
解决办法:Project Properties -> java Compiler -> Enable project specific settings -> 再选择 Compiler Compliance Leave(选择任意一个值) -> OK
重复第1步操作,将Compiler Compliance Leave选为正确的值-〉OK
或者
点击项目 右键 ->Android tools ->Fix Project
将编译器改为jdk1.6
3\运行是用Eclipse Juno Service Release 2 +android4.0+jdk1.7
但是每次运行时,模拟器显示后就没有响应
控制台的信息是
[2011-03-26 10:16:04 - TestAndroid] ------------------------------
[2011-03-26 10:16:04 - TestAndroid] Android Launch!
[2011-03-26 10:16:04 - TestAndroid] adb is running normally.
[2011-03-26 10:16:04 - TestAndroid] Performing com.test.Test activity launch
[2011-03-26 10:16:04 - TestAndroid] Automatic Target Mode: Preferred AVD 'avd4.0' is not available. Launching new emulator.
[2011-03-26 10:16:04 - TestAndroid] Launching a new emulator with Virtual Device 'avd4.0'
[2011-03-26 10:16:07 - TestAndroid] New emulator found: emulator-5554
[2011-03-26 10:16:07 - TestAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-03-26 10:17:35 - TestAndroid] emulator-5554 disconnected! Cancelling 'com.test.Test activity launch'!
解决办法一(推荐):
新添加一个环境变量,名字为 "ANDROID_SDK_HOME” (这个变量名不能改变,只能是这个名字!),然后把变量值改为你想将".android”文件夹(AVD信息)所放置的位置,在这里我把它设置为Android SDK包中,值为:"D:\android-sdk-windows",问题解决了。
linux下$: vim ~/.bashrc
export ANDROID_SDK_HOME= /home/zxj/workspace/android/android-sdk-linux
export PATH=$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH
保存退出
$:source ~/.bashrc
解决办法二:把 "F:\Users\<username>\.android“ 下的文件复制到 “C:\Users\<username>\.android“ 下面也可解决这个问题,不过这样的解决方案有一个明显的缺点,那就是如果又新建立AVD,又得重新复制。
ADV总是断开连接
法1 go to Eclipse IDE-->window--> Show Views -->others->android-> device--> view menu --> reset adb
法2 Open Android SDK and AVD Manager, choose your virtual device, click "Start..." then check the "wipe user data" mode then click "Launch".
法3 delete the old AVD and create a new avd