突然,我的创建新项目是android中的错误

时间:2014-04-19 12:23:03

标签: android r.java-file

当我创建新项目时,这显示Error.I无法理解为什么显示错误。

This line is show Error:  setContentView(R.layout.activity_main);

错误显示(更改为'activityy_list_Item;)

当改变它时,它也是错误。

然后它说“导入”

Logcat还会显示一些消息:

04-19 11:33:51.104: E/StrictMode(606): null
04-19 11:33:51.104: E/StrictMode(606): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d10dc8 that was originally bound here
04-19 11:33:51.104: E/StrictMode(606):  at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
04-19 11:33:51.104: E/StrictMode(606):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
04-19 11:33:51.104: E/StrictMode(606):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
04-19 11:33:51.104: E/StrictMode(606):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
04-19 11:33:51.104: E/StrictMode(606):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
04-19 11:33:51.104: E/StrictMode(606):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
04-19 11:33:51.104: E/StrictMode(606):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-19 11:33:51.104: E/StrictMode(606):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-19 11:33:51.104: E/StrictMode(606):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-19 11:33:51.104: E/StrictMode(606):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-19 11:33:51.104: E/StrictMode(606):  at java.lang.Thread.run(Thread.java:856)
04-19 11:33:51.104: W/ActivityManager(291): Unbind failed: could not find connection for android.os.BinderProxy@40dfb620
04-19 11:33:51.157: E/ActivityThread(606): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cef628 that was originally bound here
04-19 11:33:51.157: E/ActivityThread(606): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cef628 that was originally bound here
04-19 11:33:51.157: E/ActivityThread(606):  at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
04-19 11:33:51.157: E/ActivityThread(606):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
04-19 11:33:51.157: E/ActivityThread(606):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
04-19 11:33:51.157: E/ActivityThread(606):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
04-19 11:33:51.157: E/ActivityThread(606):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
04-19 11:33:51.157: E/ActivityThread(606):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
04-19 11:33:51.157: E/ActivityThread(606):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
04-19 11:33:51.157: E/ActivityThread(606):  at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
04-19 11:33:51.157: E/ActivityThread(606):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
04-19 11:33:51.157: E/ActivityThread(606):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
04-19 11:33:51.157: E/ActivityThread(606):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
04-19 11:33:51.157: E/ActivityThread(606):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-19 11:33:51.157: E/ActivityThread(606):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-19 11:33:51.157: E/ActivityThread(606):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-19 11:33:51.157: E/ActivityThread(606):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-19 11:33:51.157: E/ActivityThread(606):  at java.lang.Thread.run(Thread.java:856)
04-19 11:33:51.157: E/StrictMode(606): null
04-19 11:33:51.157: E/StrictMode(606): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cef628 that was originally bound here
04-19 11:33:51.157: E/StrictMode(606):  at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
04-19 11:33:51.157: E/StrictMode(606):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
04-19 11:33:51.157: E/StrictMode(606):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
04-19 11:33:51.157: E/StrictMode(606):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
04-19 11:33:51.157: E/StrictMode(606):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
04-19 11:33:51.157: E/StrictMode(606):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
04-19 11:33:51.157: E/StrictMode(606):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
04-19 11:33:51.157: E/StrictMode(606):  at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
04-19 11:33:51.157: E/StrictMode(606):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
04-19 11:33:51.157: E/StrictMode(606):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
04-19 11:33:51.157: E/StrictMode(606):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
04-19 11:33:51.157: E/StrictMode(606):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-19 11:33:51.157: E/StrictMode(606):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-19 11:33:51.157: E/StrictMode(606):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-19 11:33:51.157: E/StrictMode(606):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-19 11:33:51.157: E/StrictMode(606):  at java.lang.Thread.run(Thread.java:856)
04-19 11:33:51.164: W/ActivityManager(291): Unbind failed: could not find connection for android.os.BinderProxy@40e17988
04-19 11:34:36.054: D/ExchangeService(606): Received deviceId from Email app: null
04-19 11:34:36.054: D/ExchangeService(606): !!! deviceId unknown; stopping self and retrying
04-19 11:34:41.165: D/ExchangeService(606): !!! EAS ExchangeService, onCreate
04-19 11:34:41.165: D/ExchangeService(606): !!! EAS ExchangeService, onStartCommand, startingUp = false, running = false
04-19 11:34:41.186: D/ExchangeService(606): !!! EAS ExchangeService, onStartCommand, startingUp = true, running = false
04-19 11:34:41.204: W/ActivityManager(291): Unable to start service Intent { act=com.android.email.ACCOUNT_INTENT } U=0: not found
04-19 11:34:41.204: D/ExchangeService(606): !!! Email application not found; stopping self
04-19 11:34:41.244: W/ActivityManager(291): Unable to start service Intent { act=com.android.email.ACCOUNT_INTENT } U=0: not found
04-19 11:34:41.264: E/ActivityThread(606): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cf5e70 that was originally bound here
04-19 11:34:41.264: E/ActivityThread(606): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection 

2 个答案:

答案 0 :(得分:0)

您可能已将android.R.java导入yourpackage.R.java。如果你这样做,那么删除import android.R,然后清理并构建你的项目。

答案 1 :(得分:0)

检查AndroidManifest.xml中是否有任何错误以及res /文件夹下的文件。如果有任何错误,则可能会生成R.java,这可能导致问题。