运行eclipse,导入工程,打开以前项目,AVD总是断开连接解决办法

1\导入工程出错 Parser exception for /home/zouxiaojia/workspace/pros/SplashScreen1/AndroidManifest.xml: Premature end of file.
修改导入工程的方法

把 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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值