问题
When I create new project then this show Error.I can not understand Why this show Error.
This line is show Error: setContentView(R.layout.activity_main);
Error show (Change to 'activityy_list_Item;)
When change this then it also Error.
Then it Say do "Import"
Logcat also show some message:
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
回答1:
May be you have imported android.R.java
where it should be yourpackage.R.java
. If you did that then delete the import android.R
and then clean and build your project.
回答2:
Check whether you have any errors in AndroidManifest.xml and the files under res/ folder. If there are any error R.java won't get generated which may be causing the issue.
来源:https://stackoverflow.com/questions/23170010/suddenly-my-create-new-project-is-error-in-android