My app crashes when trying to verify username and password from mySQL database (logging in). This is verified on an AsyncTask method. It works fine on the normal Eclipse emulator. Are there any settings or tweaks to be done? Does it crash coz of the AsyncTask, or is there any other factor?
Here's the logcat:
03-14 17:01:57.755: W/EGL_genymotion(2395): eglSurfaceAttrib not implemented
03-14 17:03:00.862: W/System.err(2395): org.apache.http.conn.HttpHostConnectException: Connection to http://10.0.2.2 refused
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
03-14 17:03:00.862: W/System.err(2395): at com.example.shareity.library.JSONParser.getJSONFromUrl(JSONParser.java:33)
03-14 17:03:00.862: W/System.err(2395): at com.example.shareity.library.UserFunctions.loginUser(UserFunctions.java:35)
03-14 17:03:00.862: W/System.err(2395): at com.example.shareity.Login$ProcessLogin.doInBackground(Login.java:204)
03-14 17:03:00.862: W/System.err(2395): at com.example.shareity.Login$ProcessLogin.doInBackground(Login.java:1)
03-14 17:03:00.862: W/System.err(2395): at android.os.AsyncTask$2.call(AsyncTask.java:287)
03-14 17:03:00.862: W/System.err(2395): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
03-14 17:03:00.862: W/System.err(2395): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-14 17:03:00.862: W/System.err(2395): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
03-14 17:03:00.862: W/System.err(2395): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
03-14 17:03:00.862: W/System.err(2395): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
03-14 17:03:00.862: W/System.err(2395): at java.lang.Thread.run(Thread.java:856)
03-14 17:03:00.862: W/System.err(2395): Caused by: java.net.ConnectException: failed to connect to /10.0.2.2 (port 80): connect failed: ETIMEDOUT (Connection timed out)
03-14 17:03:00.862: W/System.err(2395): at libcore.io.IoBridge.connect(IoBridge.java:114)
03-14 17:03:00.862: W/System.err(2395): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
03-14 17:03:00.862: W/System.err(2395): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
03-14 17:03:00.862: W/System.err(2395): at java.net.Socket.connect(Socket.java:842)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
03-14 17:03:00.862: W/System.err(2395): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
03-14 17:03:00.862: W/System.err(2395): ... 17 more
03-14 17:03:00.862: W/System.err(2395): Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)
03-14 17:03:00.862: W/System.err(2395): at libcore.io.Posix.connect(Native Method)
03-14 17:03:00.862: W/System.err(2395): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
03-14 17:03:00.862: W/System.err(2395): at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
03-14 17:03:00.862: W/System.err(2395): at libcore.io.IoBridge.connect(IoBridge.java:112)
03-14 17:03:00.862: W/System.err(2395): ... 22 more
03-14 17:03:00.862: E/Buffer Error(2395): Error converting result java.lang.NullPointerException
03-14 17:03:00.862: E/JSON Parser(2395): Error parsing data org.json.JSONException: End of input at character 0 of
03-14 17:03:00.878: D/AndroidRuntime(2395): Shutting down VM
03-14 17:03:00.878: W/dalvikvm(2395): threadid=1: thread exiting with uncaught exception (group=0xa62d0288)
03-14 17:03:00.878: E/AndroidRuntime(2395): FATAL EXCEPTION: main
03-14 17:03:00.878: E/AndroidRuntime(2395): java.lang.NullPointerException
03-14 17:03:00.878: E/AndroidRuntime(2395): at com.example.shareity.Login$ProcessLogin.onPostExecute(Login.java:210)
03-14 17:03:00.878: E/AndroidRuntime(2395): at com.example.shareity.Login$ProcessLogin.onPostExecute(Login.java:1)
03-14 17:03:00.878: E/AndroidRuntime(2395): at android.os.AsyncTask.finish(AsyncTask.java:631)
03-14 17:03:00.878: E/AndroidRuntime(2395): at android.os.AsyncTask.access$600(AsyncTask.java:177)
03-14 17:03:00.878: E/AndroidRuntime(2395): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
03-14 17:03:00.878: E/AndroidRuntime(2395): at android.os.Handler.dispatchMessage(Handler.java:99)
03-14 17:03:00.878: E/AndroidRuntime(2395): at android.os.Looper.loop(Looper.java:137)
03-14 17:03:00.878: E/AndroidRuntime(2395): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-14 17:03:00.878: E/AndroidRuntime(2395): at java.lang.reflect.Method.invokeNative(Native Method)
03-14 17:03:00.878: E/AndroidRuntime(2395): at java.lang.reflect.Method.invoke(Method.java:511)
03-14 17:03:00.878: E/AndroidRuntime(2395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-14 17:03:00.878: E/AndroidRuntime(2395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-14 17:03:00.878: E/AndroidRuntime(2395): at dalvik.system.NativeStart.main(Native Method)
03-14 17:08:00.935: I/Process(2395): Sending signal. PID: 2395 SIG: 9
Related
E/test(20965): Exception E/AndroidRuntime(20965): FATAL EXCEPTION:
main E/AndroidRuntime(20965): java.lang.RuntimeException: Unable to
start activity
ComponentInfo{sliit.mad.contact_list/sliit.mad.contact_list.TEST}:
android.os.NetworkOnMainThreadException E/AndroidRuntime(20965): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2062)
E/AndroidRuntime(20965): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2087)
E/AndroidRuntime(20965): at
android.app.ActivityThread.access$600(ActivityThread.java:133)
E/AndroidRuntime(20965): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1198)
E/AndroidRuntime(20965): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(20965): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(20965): at
android.app.ActivityThread.main(ActivityThread.java:4793)
E/AndroidRuntime(20965):at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(20965):at
java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(20965):at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808)
E/AndroidRuntime(20965): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575)
E/AndroidRuntime(20965):at dalvik.system.NativeStart.main(Native
Method) E/AndroidRuntime(20965): Caused by:
android.os.NetworkOnMainThreadException E/AndroidRuntime(20965):at
android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
E/AndroidRuntime(20965):at
libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84)
E/AndroidRuntime(20965):at
libcore.io.IoBridge.connectErrno(IoBridge.java:127)
E/AndroidRuntime(20965):at
libcore.io.IoBridge.connect(IoBridge.java:112)
E/AndroidRuntime(20965):at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
E/AndroidRuntime(20965):at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:460)
E/AndroidRuntime(20965):at java.net.Socket.connect(Socket.java:832)
E/AndroidRuntime(20965):at
org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
E/AndroidRuntime(20965):at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
E/AndroidRuntime(20965):at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
E/AndroidRuntime(20965):at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
E/AndroidRuntime(20965):at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
E/AndroidRuntime(20965):at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
E/AndroidRuntime(20965):at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
E/AndroidRuntime(20965):at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
E/AndroidRuntime(20965):at
sliit.mad.contact_list.JSONParser.makeHttpRequest(JSONParser.java:65)
E/AndroidRuntime(20965):at
sliit.mad.contact_list.TEST.onCreate(TEST.java:38)
E/AndroidRuntime(20965):at
android.app.Activity.performCreate(Activity.java:5008)
E/AndroidRuntime(20965): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
E/AndroidRuntime(20965):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2026)
E/AndroidRuntime(20965):... 11 more
Maybe you already had fixed this issue. but this issue was caused by that you tried to do network operation in the main UI thread and that is not allowed.
The exception log can explain itself.
E/AndroidRuntime(20965): Caused by: android.os.NetworkOnMainThreadException E/AndroidRuntime(20965):at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
I have integrated Paypal Sdk in my android app.It is having two options to pay using Paypal user account and to pay using credit card.Payment with credit can be done by card Io library but don't know why it is not working.Not working means it is not scanning card.Please tell me how to use it .I just keep card in front of long time but it does not fetch the details from the card .
SDK version 2.0.2
Logcat while scanning card
03-14 11:05:20.000: E/mm-camera(140): Ignoring execution of AEC as AF is active
03-14 11:05:20.060: E/mm-camera(140): Ignoring execution of AEC as AF is active
03-14 11:05:20.110: E/mm-camera(140): Ignoring execution of AEC as AF is active
03-14 11:05:20.110: W/QCameraHWI_Preview(132): android::status_t android::QCameraStream_preview::processPreviewFrameWithDisplay(mm_camera_ch_data_buf_t*): dis_proc_time 0ms, asd_proc_time 0ms, gpu_proc_time 0ms, face_proc_time 3ms, genlock_unlock_time 0ms, genlock_lock_time 0ms, enqueue_time 3ms, dequeue_time 0ms, ion_flush_time 2ms, lock_buffer_time 0ms, buf_done_time 8ms, data_callback_time 27ms, frame_proc_time 46ms
Even not able to made transaction by filling card details .App is getting crash
Logcat after filling card details :
03-14 11:09:23.370: E/AndroidRuntime(25350): java.lang.NullPointerException
03-14 11:09:23.370: E/AndroidRuntime(25350): at com.paypal.android.sdk.payments.PayPalService.h(Unknown Source)
03-14 11:09:23.370: E/AndroidRuntime(25350): at com.paypal.android.sdk.payments.PaymentMethodActivity.a(Unknown Source)
03-14 11:09:23.370: E/AndroidRuntime(25350): at com.paypal.android.sdk.payments.PaymentMethodActivity.f(Unknown Source)
03-14 11:09:23.370: E/AndroidRuntime(25350): at com.paypal.android.sdk.payments.aj.onServiceConnected(Unknown Source)
03-14 11:09:23.370: E/AndroidRuntime(25350): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1187)
03-14 11:09:23.370: E/AndroidRuntime(25350): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1204)
03-14 11:09:23.370: E/AndroidRuntime(25350): at android.os.Handler.handleCallback(Handler.java:615)
03-14 11:09:23.370: E/AndroidRuntime(25350): at android.os.Handler.dispatchMessage(Handler.java:92)
03-14 11:09:23.370: E/AndroidRuntime(25350): at android.os.Looper.loop(Looper.java:155)
03-14 11:09:23.370: E/AndroidRuntime(25350): at android.app.ActivityThread.main(ActivityThread.java:5520)
03-14 11:09:23.370: E/AndroidRuntime(25350): at java.lang.reflect.Method.invokeNative(Native Method)
03-14 11:09:23.370: E/AndroidRuntime(25350): at java.lang.reflect.Method.invoke(Method.java:511)
03-14 11:09:23.370: E/AndroidRuntime(25350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
03-14 11:09:23.370: E/AndroidRuntime(25350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
03-14 11:09:23.370: E/AndroidRuntime(25350): at dalvik.system.NativeStart.main(Native Method)
03-14 11:09:23.380: E/EmbeddedLogger(343): App crashed! Process: com.paypal.example.paypalandroidsdkexample
03-14 11:09:23.380: E/EmbeddedLogger(343): App crashed! Package: com.paypal.example.paypalandroidsdkexample v1 (1.0)
03-14 11:09:23.380: E/EmbeddedLogger(343): Application Label: PayPal SDK Example
03-14 11:09:26.480: E/ThermalDaemon(25739): Thermal daemon started
I am attempting to display OpenX ads within an Android application. I have installed the SDK and followed the video found here. Everything is going smoothly, except when I edit the layout. I am constantly greeted with this friendly error message in the error log.
eclipse.buildId=M20120914-1800
java.version=1.7.0_11
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64
Error
Thu Mar 14 17:40:44 PDT 2013
com.openx.ad.mobile.sdk.views.OXMAdBanner failed to instantiate.
java.lang.NullPointerException
at com.openx.ad.mobile.sdk.controllers.OXMAdBaseController.<init>(OXMAdBaseController.java:130)
at com.openx.ad.mobile.sdk.controllers.OXMAdController.<init>(OXMAdController.java:37)
at com.openx.ad.mobile.sdk.views.OXMAdBanner.init(OXMAdBanner.java:141)
at com.openx.ad.mobile.sdk.views.OXMAdBanner.reflectAttrs(OXMAdBanner.java:136)
at com.openx.ad.mobile.sdk.views.OXMAdBanner.<init>(OXMAdBanner.java:86)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:746)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:749)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:372)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:385)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:332)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:325)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:440)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1545)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1302)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(GraphicalEditorPart.java:1059)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate.delegatePageChange(LayoutEditorDelegate.java:686)
at com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor.pageChange(CommonXmlEditor.java:360)
at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:292)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3023)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1730)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:270)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
I can't find any help on Google, and I am wondering if anyone has had this issue before. I have my manifest set up properly, and am running android:targetSdkVersion="17"
<activity
android:name="com.openx.ad.mobile.sdk.OXMAdBrowser"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
So since there are no build errors, I am able to launch my app, but it quickly creahses and throws some errors.
03-14 17:45:35.517: E/AndroidRuntime(23227): FATAL EXCEPTION: main
03-14 17:45:35.517: E/AndroidRuntime(23227): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.portlandtribune.pamplinmedia_beta/com.portlandtribune.pamplinmedia_beta.PM_section}: android.view.InflateException: Binary XML file line #97: Error inflating class com.openx.ad.mobile.sdk.views.OXMAdBanner
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.ActivityThread.access$600(ActivityThread.java:130)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.os.Handler.dispatchMessage(Handler.java:99)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.os.Looper.loop(Looper.java:137)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-14 17:45:35.517: E/AndroidRuntime(23227): at java.lang.reflect.Method.invokeNative(Native Method)
03-14 17:45:35.517: E/AndroidRuntime(23227): at java.lang.reflect.Method.invoke(Method.java:511)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-14 17:45:35.517: E/AndroidRuntime(23227): at dalvik.system.NativeStart.main(Native Method)
03-14 17:45:35.517: E/AndroidRuntime(23227): Caused by: android.view.InflateException: Binary XML file line #97: Error inflating class com.openx.ad.mobile.sdk.views.OXMAdBanner
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.actionbarsherlock.internal.ActionBarSherlockNative.setContentView(ActionBarSherlockNative.java:119)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.actionbarsherlock.app.SherlockActivity.setContentView(SherlockActivity.java:229)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.portlandtribune.pamplinmedia_beta.PM_section.onCreate(PM_section.java:145)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.Activity.performCreate(Activity.java:5008)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
03-14 17:45:35.517: E/AndroidRuntime(23227): ... 11 more
03-14 17:45:35.517: E/AndroidRuntime(23227): Caused by: java.lang.reflect.InvocationTargetException
03-14 17:45:35.517: E/AndroidRuntime(23227): at java.lang.reflect.Constructor.constructNative(Native Method)
03-14 17:45:35.517: E/AndroidRuntime(23227): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-14 17:45:35.517: E/AndroidRuntime(23227): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-14 17:45:35.517: E/AndroidRuntime(23227): ... 24 more
03-14 17:45:35.517: E/AndroidRuntime(23227): Caused by: java.lang.NullPointerException
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.openx.ad.mobile.sdk.controllers.OXMAdBaseController.<init>(OXMAdBaseController.java:161)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.openx.ad.mobile.sdk.controllers.OXMAdController.<init>(OXMAdController.java:37)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.openx.ad.mobile.sdk.views.OXMAdBanner.init(OXMAdBanner.java:141)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.openx.ad.mobile.sdk.views.OXMAdBanner.reflectAttrs(OXMAdBanner.java:136)
03-14 17:45:35.517: E/AndroidRuntime(23227): at com.openx.ad.mobile.sdk.views.OXMAdBanner.<init>(OXMAdBanner.java:86)
Has anyone else had this issue?
Other information
I am using the standard code for the xml layout file. I know I haven't specified any details but it shouldn't be returning a com.openx.ad.mobile.sdk.views.OXMAdBanner failed to instantiate error. Right?
<com.openx.ad.mobile.sdk.views.OXMAdBanner
android:id="#+id/banner"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="center_horizontal|center_vertical"
domain="d.example.com"
portrait_id="1234"
landscape_id="4321"
change_interval="30000" />
I am trying to send Email from my android app from background.Mail was sent successfully with attachment but still after that i am getting error in log.Here is the log please guide me where is the error and how to resolve it.
03-14 13:37:37.697: E/MailApp(1296): Could not send email
03-14 13:37:37.697: E/MailApp(1296): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
03-14 13:37:37.697: E/MailApp(1296): at android.os.Handler.<init>(Handler.java:197)
03-14 13:37:37.697: E/MailApp(1296): at android.os.Handler.<init>(Handler.java:111)
03-14 13:37:37.697: E/MailApp(1296): at android.widget.Toast$TN.<init>(Toast.java:324)
03-14 13:37:37.697: E/MailApp(1296): at android.widget.Toast.<init>(Toast.java:91)
03-14 13:37:37.697: E/MailApp(1296): at android.widget.Toast.makeText(Toast.java:238)
03-14 13:37:37.697: E/MailApp(1296): at com.example.mytest.ReadContactsActivity.SendMail(ReadContactsActivity.java:173)
03-14 13:37:37.697: E/MailApp(1296): at com.example.mytest.ReadContactsActivity.access$0(ReadContactsActivity.java:156)
03-14 13:37:37.697: E/MailApp(1296): at com.example.mytest.ReadContactsActivity$CountDownTask.doInBackground(ReadContactsActivity.java:131)
03-14 13:37:37.697: E/MailApp(1296): at com.example.mytest.ReadContactsActivity$CountDownTask.doInBackground(ReadContactsActivity.java:1)
03-14 13:37:37.697: E/MailApp(1296): at android.os.AsyncTask$2.call(AsyncTask.java:287)
03-14 13:37:37.697: E/MailApp(1296): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
03-14 13:37:37.697: E/MailApp(1296): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
03-14 13:37:37.697: E/MailApp(1296): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
03-14 13:37:37.697: E/MailApp(1296): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
I think you are trying to display Toast message inside the AsynTask doInBackground() method,
just do it in onPostExecute() method....
You might be using some background thread which is directly trying to make change in your main thread, if that is the issue then use
runOnUiThread(new Runnable() {
public void run() {
//do your work here
}
});
I have an activity that is formed of 2 tabs. The problem is, when I have this code:
tabHost.setCurrentTab(0);
I am getting the following exception:
03-14 01:06:39.520: ERROR/AndroidRuntime(588): java.lang.NullPointerException
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:295)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:295)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.view.ViewRoot.handleMessage(ViewRoot.java:1819)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.os.Handler.dispatchMessage(Handler.java:99)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.os.Looper.loop(Looper.java:123)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at android.app.ActivityThread.main(ActivityThread.java:4363)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at java.lang.reflect.Method.invokeNative(Native Method)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at java.lang.reflect.Method.invoke(Method.java:521)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-14 01:06:39.520: ERROR/AndroidRuntime(588): at dalvik.system.NativeStart.main(Native Method)
However, if I change the second tab to be displayed by default (I have only 2 tabs), as in:
tabHost.setCurrentTab(1);
everything is displayed correctly and I am able to switch between the tabs as well. This tells me that the tabs are configured correctly somehow, but then, why this behavior ?
I realized what I was doing wrong: the Tab mechanism was working ok, it was a ListActivity implemented for the first tab that was causing the NPE.