Incompréhensible crash - android

I'm creating an application which translate user's texts.
First, my code was :
textToReadEdittext.setText(TranslateManager.translate(text, from, to));
Now I need to use the translated text for an other thing. So I use a String variable :
String translatedText = TranslateManager.translate(text, from, to);
textToReadEdittext.setText(translatedText);
But now my application crashes! There is the logs from Eclipse :
03-21 20:24:58.437: E/AndroidRuntime(14867): FATAL EXCEPTION: main
03-21 20:24:58.437: E/AndroidRuntime(14867): java.lang.IllegalStateException: Could not execute method of the activity
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.view.View$1.onClick(View.java:2072)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.view.View.performClick(View.java:2408)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.view.View$PerformClick.run(View.java:8817)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.os.Handler.handleCallback(Handler.java:587)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.os.Handler.dispatchMessage(Handler.java:92)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.os.Looper.loop(Looper.java:144)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.app.ActivityThread.main(ActivityThread.java:4937)
03-21 20:24:58.437: E/AndroidRuntime(14867): at java.lang.reflect.Method.invokeNative(Native Method)
03-21 20:24:58.437: E/AndroidRuntime(14867): at java.lang.reflect.Method.invoke(Method.java:521)
03-21 20:24:58.437: E/AndroidRuntime(14867): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-21 20:24:58.437: E/AndroidRuntime(14867): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-21 20:24:58.437: E/AndroidRuntime(14867): at dalvik.system.NativeStart.main(Native Method)
03-21 20:24:58.437: E/AndroidRuntime(14867): Caused by: java.lang.reflect.InvocationTargetException
03-21 20:24:58.437: E/AndroidRuntime(14867): at fr.robinkaminski.devAndroid.projetthalie.activities.KeyboardActivity.keyboardTranslateListener(KeyboardActivity.java:44)
03-21 20:24:58.437: E/AndroidRuntime(14867): at java.lang.reflect.Method.invokeNative(Native Method)
03-21 20:24:58.437: E/AndroidRuntime(14867): at java.lang.reflect.Method.invoke(Method.java:521)
03-21 20:24:58.437: E/AndroidRuntime(14867): at android.view.View$1.onClick(View.java:2067)
03-21 20:24:58.437: E/AndroidRuntime(14867): ... 11 more
03-21 20:24:58.437: E/AndroidRuntime(14867): Caused by: java.lang.NullPointerException
03-21 20:24:58.437: E/AndroidRuntime(14867): at fr.robinkaminski.devAndroid.projetthalie.translate.TranslateManager.translate(TranslateMana ger.java:74)
03-21 20:24:58.437: E/AndroidRuntime(14867): ... 15 more
I don't understand why my activity crashes. Can you help me?
Thx, korax.

Either your text or from or to is null. Check them before passing to TranslateManager and print it out if any of them are null.

Related

Crash on Samsung devices for EditText containing links

Okay, so this code works perfectly fine on any other device, but crashes on Samsung devices. I can't seem to figure out why really, but I do know that if I use a TextView it does not crash. Problem is though, that I need an EditText for this field and it can contain multiple links. I've spent the past one day looking for a solution to no avail, so I thought I'd post here:
Note: This seems to work on Nexus and Motorola devices I tested on:
Is there some workaround that I may have missed as I'm going to guess samsung played around with how to handle links in EditText boxes?
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
EditText t3 = (EditText) findViewById(R.id.text3);
t3.setText(
Html.fromHtml(
"<b>text3:</b> Text with a " +
"link " +
"created in the Java source code using HTML."));
t3.setMovementMethod(LinkMovementMethod.getInstance());
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
Here's a look at the stacktrace if that helps:
03-21 11:17:34.897: E/AndroidRuntime(1810): FATAL EXCEPTION: main
03-21 11:17:34.897: E/AndroidRuntime(1810): java.lang.NullPointerException
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.widget.Editor.onTouchUpEvent(Editor.java:1927)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.widget.TextView.onTouchEvent(TextView.java:8865)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.View.dispatchTouchEvent(View.java:7817)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2174)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2174)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2174)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2441)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2174)
03-21 11:17:34.897: E/AndroidRuntime(1810): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2326)
03-21 11:17:34.897: E/AndroidRuntime(1810): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1612)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.app.Activity.dispatchTouchEvent(Activity.java:2494)
03-21 11:17:34.897: E/AndroidRuntime(1810): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2274)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.View.dispatchPointerEvent(View.java:8025)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4668)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4556)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4150)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4207)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4176)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4261)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4184)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4318)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4150)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4207)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4176)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4184)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4150)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6302)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6240)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6211)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6382)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.os.MessageQueue.nativePollOnce(Native Method)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.os.MessageQueue.next(MessageQueue.java:132)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.os.Looper.loop(Looper.java:124)
03-21 11:17:34.897: E/AndroidRuntime(1810): at android.app.ActivityThread.main(ActivityThread.java:5455)
03-21 11:17:34.897: E/AndroidRuntime(1810): at java.lang.reflect.Method.invokeNative(Native Method)
03-21 11:17:34.897: E/AndroidRuntime(1810): at java.lang.reflect.Method.invoke(Method.java:525)
03-21 11:17:34.897: E/AndroidRuntime(1810): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
03-21 11:17:34.897: E/AndroidRuntime(1810): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
03-21 11:17:34.897: E/AndroidRuntime(1810): at dalvik.system.NativeStart.main(Native Method)
Clickable links and copy/paste menu in EditView in android
This post helped me, if anyone is interested in the answer.

HoloEverywhere layout folder full of resource errors?

I'm using both ActionBarSherlock and HoloEverywhere as libraries in my project, and suddenly HoloEverywhere started messing up.
I made an AlertDialog like this:
AlertDialog.Builder alert = new AlertDialog.Builder(DomaCareDetailViewActivity.this)
.setTitle(R.string.edit_service)
.setItems(R.array.edit_service_array, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//tested and working code
});
alert.create();
alert.show();
But the "create" line throws the exception:
03-21 17:05:35.167: E/AndroidRuntime(25499): FATAL EXCEPTION: main
03-21 17:05:35.167: E/AndroidRuntime(25499): android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.LayoutInflater.tryCreateView(LayoutInflater.java:359)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:308)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:287)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:272)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:267)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.internal.AlertController$AlertParams.createListView(AlertController.java:143)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.internal.AlertController$AlertParams.apply(AlertController.java:129)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.app.AlertDialog$Builder.create(AlertDialog.java:60)
03-21 17:05:35.167: E/AndroidRuntime(25499): at com.invian.domacare.task.DomaCareDetailViewActivity$20.onClick(DomaCareDetailViewActivity.java:1004)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.View.performClick(View.java:4084)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.View$PerformClick.run(View.java:16966)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.os.Handler.handleCallback(Handler.java:615)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.os.Handler.dispatchMessage(Handler.java:92)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.os.Looper.loop(Looper.java:137)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.app.ActivityThread.main(ActivityThread.java:4931)
03-21 17:05:35.167: E/AndroidRuntime(25499): at java.lang.reflect.Method.invokeNative(Native Method)
03-21 17:05:35.167: E/AndroidRuntime(25499): at java.lang.reflect.Method.invoke(Method.java:511)
03-21 17:05:35.167: E/AndroidRuntime(25499): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
03-21 17:05:35.167: E/AndroidRuntime(25499): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
03-21 17:05:35.167: E/AndroidRuntime(25499): at dalvik.system.NativeStart.main(Native Method)
03-21 17:05:35.167: E/AndroidRuntime(25499): Caused by: java.lang.reflect.InvocationTargetException
03-21 17:05:35.167: E/AndroidRuntime(25499): at java.lang.reflect.Constructor.constructNative(Native Method)
03-21 17:05:35.167: E/AndroidRuntime(25499): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-21 17:05:35.167: E/AndroidRuntime(25499): ... 24 more
03-21 17:05:35.167: E/AndroidRuntime(25499): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f01007a a=-1}
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.content.res.Resources.loadDrawable(Resources.java:1921)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-21 17:05:35.167: E/AndroidRuntime(25499): at android.widget.ListView.<init>(ListView.java:153)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.widget.ListView.<init>(ListView.java:205)
03-21 17:05:35.167: E/AndroidRuntime(25499): at org.holoeverywhere.widget.ListView.<init>(ListView.java:200)
03-21 17:05:35.167: E/AndroidRuntime(25499): ... 27 more
I located the source in HoloEverywhere's com.holoeverywhere.internal.AlertController, and something is wrong with line 143:
final ListView listView = (ListView) mInflater
.inflate(dialog.mListLayout, null);
Checking mListLayout's initializing brings me to line 383:
mListLayout = a.getResourceId(R.styleable.AlertDialog_listLayout,
R.layout.select_dialog_holo);
This is as far as I get. I can't find "R.styleable.AlertDialog", but since the AlertDialog.create() throws the exception in my project, I'm sure this is where the problem lies. The select_dialog_holo.xml file does, however, have an error of sorts of its own:
Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.
Failed to convert ?listDividerAlertDialog into a drawable
Couldn't find theme resource listDividerAlertDialog for the current theme
Anyone have any ideas on how to fix this?
Edit: Going through the HoloEverywhere layout folder, I notice that there are tons of these types of errors. For example, simple_list_item_1 gives me several "could not find resource" errors as well as a few "listPreferredPaddingLeft/Right/etc in attribute paddingLeft is not a valid format" errors.

android error IllegalArgumentException

I can't find following error in my code. It looks like the problem is in the asynctask onpostexecute.
java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:672)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:368)
at android.view.WindowManagerImpl$CompatModeWrapper.removeView(WindowManagerImpl.java:160)
at android.app.Dialog.dismissDialog(Dialog.java:319)
at android.app.Dialog.dismiss(Dialog.java:302)
at www.mobilezar.mn.Advertisements$InitialLoading.onPostExecute(Advertisements.java:216)
at www.mobilezar.mn.Advertisements$InitialLoading.onPostExecute(Advertisements.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)

cannot load HelloWorld example in phonegap android

I am new with PhoneGap and I am using it for android. I am following step-by-step the tutorial HelloPhoneGap from http://phonegap.com/start/#android. at first run it it runs ok, but later-on when I run it i got this error:
logcat:
03-21 09:52:02.467: D/dalvikvm(534): Not late-enabling CheckJNI (already on)
03-21 09:52:04.738: W/System.err(534): =====================================================================================
03-21 09:52:04.738: W/System.err(534): ERROR: plugin.xml is missing. Add res/xml/plugins.xml to your project.
03-21 09:52:04.738: W/System.err(534): https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/res/xml/plugins.xml
03-21 09:52:04.738: W/System.err(534): =====================================================================================
03-21 09:52:04.738: W/ResourceType(534): No package identifier when getting value for resource number 0x00000000
03-21 09:52:04.748: D/AndroidRuntime(534): Shutting down VM
03-21 09:52:04.748: W/dalvikvm(534): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
03-21 09:52:04.758: W/System.err(534): java.net.SocketException: socket failed: EACCES (Permission denied)
03-21 09:52:04.768: W/System.err(534): at libcore.io.IoBridge.socket(IoBridge.java:573)
03-21 09:52:04.768: W/System.err(534): at java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)
03-21 09:52:04.768: W/System.err(534): at java.net.PlainServerSocketImpl.create(PlainServerSocketImpl.java:38)
03-21 09:52:04.778: W/System.err(534): at java.net.ServerSocket.<init>(ServerSocket.java:98)
03-21 09:52:04.788: W/System.err(534): at java.net.ServerSocket.<init>(ServerSocket.java:69)
03-21 09:52:04.788: W/System.err(534): at org.apache.cordova.CallbackServer.run(CallbackServer.java:208)
03-21 09:52:04.788: W/System.err(534): at java.lang.Thread.run(Thread.java:856)
03-21 09:52:04.788: W/System.err(534): Caused by: libcore.io.ErrnoException: socket failed: EACCES (Permission denied)
03-21 09:52:04.788: W/System.err(534): at libcore.io.Posix.socket(Native Method)
03-21 09:52:04.788: W/System.err(534): at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:181)
03-21 09:52:04.788: W/System.err(534): at libcore.io.IoBridge.socket(IoBridge.java:558)
03-21 09:52:04.788: W/System.err(534): ... 6 more
03-21 09:52:04.817: E/AndroidRuntime(534): FATAL EXCEPTION: main
03-21 09:52:04.817: E/AndroidRuntime(534): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.phonegap.helloworld/com.phonegap.helloworld.app}: android.content.res.Resources$NotFoundException: Resource ID #0x0
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.os.Handler.dispatchMessage(Handler.java:99)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.os.Looper.loop(Looper.java:137)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-21 09:52:04.817: E/AndroidRuntime(534): at java.lang.reflect.Method.invokeNative(Native Method)
03-21 09:52:04.817: E/AndroidRuntime(534): at java.lang.reflect.Method.invoke(Method.java:511)
03-21 09:52:04.817: E/AndroidRuntime(534): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-21 09:52:04.817: E/AndroidRuntime(534): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-21 09:52:04.817: E/AndroidRuntime(534): at dalvik.system.NativeStart.main(Native Method)
03-21 09:52:04.817: E/AndroidRuntime(534): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
03-21 09:52:04.817: E/AndroidRuntime(534): at android.content.res.Resources.getValue(Resources.java:1019)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2107)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.content.res.Resources.getXml(Resources.java:907)
03-21 09:52:04.817: E/AndroidRuntime(534): at org.apache.cordova.api.PluginManager.loadPlugins(PluginManager.java:82)
03-21 09:52:04.817: E/AndroidRuntime(534): at org.apache.cordova.api.PluginManager.<init>(PluginManager.java:62)
03-21 09:52:04.817: E/AndroidRuntime(534): at org.apache.cordova.DroidGap$1.run(DroidGap.java:502)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.Activity.runOnUiThread(Activity.java:4170)
03-21 09:52:04.817: E/AndroidRuntime(534): at org.apache.cordova.DroidGap.loadUrlIntoView(DroidGap.java:478)
03-21 09:52:04.817: E/AndroidRuntime(534): at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:444)
03-21 09:52:04.817: E/AndroidRuntime(534): at com.phonegap.helloworld.app.onCreate(app.java:15)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.Activity.performCreate(Activity.java:4465)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-21 09:52:04.817: E/AndroidRuntime(534): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
03-21 09:52:04.817: E/AndroidRuntime(534): ... 11 more
console:
[2012-03-21 09:49:28 - HelloPhoneGap] ------------------------------
[2012-03-21 09:49:28 - HelloPhoneGap] Android Launch!
[2012-03-21 09:49:28 - HelloPhoneGap] adb is running normally.
[2012-03-21 09:49:28 - HelloPhoneGap] Performing com.phonegap.helloworld.app activity launch
[2012-03-21 09:49:28 - HelloPhoneGap] Automatic Target Mode: launching new emulator with compatible AVD 'avd'
[2012-03-21 09:49:28 - HelloPhoneGap] Launching a new emulator with Virtual Device 'avd'
[2012-03-21 09:49:39 - Emulator] emulator: WARNING: Unable to create sensors port: Connection refused
[2012-03-21 09:49:39 - Emulator] emulator: emulator window was out of view and was recentered
[2012-03-21 09:49:39 - Emulator]
[2012-03-21 09:49:41 - HelloPhoneGap] New emulator found: emulator-5554
[2012-03-21 09:49:41 - HelloPhoneGap] Waiting for HOME ('android.process.acore') to be launched...
[2012-03-21 09:51:23 - HelloPhoneGap] HOME is up on device 'emulator-5554'
[2012-03-21 09:51:23 - HelloPhoneGap] Uploading HelloPhoneGap.apk onto device 'emulator-5554'
[2012-03-21 09:51:24 - HelloPhoneGap] Installing HelloPhoneGap.apk...
[2012-03-21 09:52:02 - HelloPhoneGap] Success!
[2012-03-21 09:52:02 - HelloPhoneGap] Starting activity com.phonegap.helloworld.app on device emulator-5554
[2012-03-21 09:52:04 - HelloPhoneGap] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.phonegap.helloworld/.app }
can anyone can help me about my case?
The fix that worked for me was to copy the file 'config.xml' from the Cordova download zip (lib/android/example/res/xml/config.xml) into my project's res/xml folder. I ran into this same error, working through the Cordova 2.0.0 Getting Started with Android page. The file plugin.xml does not appear to be in Cordova 2.0.0 (at least in the Android branch). The error to logcat still mentions it however.
1) In onCreate method did you initialize like super.init(); if not do
2) check plugins present in this path "xml/res/plugins.xml" if not find plugins here
Note: put that plugins tag inside cordova like <cordova> <plugins> <plugin> </plugins> </cordova>

Adwhirl + inMobi Problem in Android

I am trying to use inMobi(ver 2) through Adwhirl(2.6.3) on my Android(2.2) application.
But I am recieving an odd problem.
Do you have any idea what is wrong?
Here is the stack trace:
03-21 21:33:39.656: VERBOSE/inmobiandroidwebsdk(30457): requestactivity=AdRequest&d-deviceModel=Nexus+One&d-deviceMachineHW=Linux%28Android%3A2.6.35.7-59423-g08607d4%29&d-deviceSystemName=BASE&d-deviceSystemVersion=1.0&d-deviceName=google&d-deviceBTHW=Sat+Mar+19+08%3A15%3A44+GMT%2B02%3A00+2011&d-deviceStorageSize=InBuilt%3A196+MB%2CExt%3A3+GB&d-device-screen-density=1.5&d-device-screen-size=480X800&x-inmobi-phone-useragent=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.3.3%3B+en-us%3B+Nexus+One+Build%2FGRI40%29+AppleWebKit%2F533.1+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F533.1&mk-siteid=ff8080812eb70f85012ecd66bc330119&u-id=173adca6177f8d35&mk-version=pr-SPEC-ATATA-20091223&format=xhtml&mk-ads=1&h-user-agent=InMobi_androidsdk%3D2.0&u-InMobi_androidwebsdkVersion=2.0&u-appBId=com.tests.mytest&u-appDNM=Pattern+Maker&u-appVer=1.1&d-localization=en_us&d-netType=&mk-banner-size=9
03-21 21:33:39.656: WARN/inmobiandroidwebsdk(30457): requestactivity=AdRequest&d-deviceModel=Nexus+One&d-deviceMachineHW=Linux%28Android%3A2.6.35.7-59423-g08607d4%29&d-deviceSystemName=BASE&d-deviceSystemVersion=1.0&d-deviceName=google&d-deviceBTHW=Sat+Mar+19+08%3A15%3A44+GMT%2B02%3A00+2011&d-deviceStorageSize=InBuilt%3A196+MB%2CExt%3A3+GB&d-device-screen-density=1.5&d-device-screen-size=480X800&x-inmobi-phone-useragent=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.3.3%3B+en-us%3B+Nexus+One+Build%2FGRI40%29+AppleWebKit%2F533.1+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F533.1&mk-siteid=ff8080812eb70f85012ecd66bc330119&u-id=173adca6177f8d35&mk-version=pr-SPEC-ATATA-20091223&format=xhtml&mk-ads=1&h-user-agent=InMobi_androidsdk%3D2.0&u-InMobi_androidwebsdkVersion=2.0&u-appBId=com.tests.mytest&u-appDNM=Pattern+Maker&u-appVer=1.1&d-localization=en_us&d-netType=&mk-banner-size=9
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): Exception retrieving ad
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): com.inmobi.androidsdk.impl.net.ConnectionException: Error requesting new Ad
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.net.RequestResponseManager.retrieveAd(RequestResponseManager.java:197)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.net.RequestResponseManager.requestAd(RequestResponseManager.java:54)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.InMobiAdView.fetchAndDisplayAd(InMobiAdView.java:206)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.InMobiAdView.access$4(InMobiAdView.java:179)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.InMobiAdView$3.call(InMobiAdView.java:292)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.InMobiAdView$3.call(InMobiAdView.java:1)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at android.os.Handler.handleCallback(Handler.java:587)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at android.os.Handler.dispatchMessage(Handler.java:92)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at android.os.Looper.loop(Looper.java:123)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.BackgroundWorker$1.run(BackgroundWorker.java:36)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at java.lang.Thread.run(Thread.java:1019)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): Caused by: java.io.FileNotFoundException: http://w.sandbox.mkhoj.com/showad.asm
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:521)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): at com.inmobi.androidsdk.impl.net.RequestResponseManager.retrieveAd(RequestResponseManager.java:157)
03-21 21:33:41.576: ERROR/inmobiandroidwebsdk(30457): ... 12 more
I'm from the InMobi Operations team. The problem is that the latest Adwhirl release does not have the updated InMobi Adapters. Can you try with the following versions of the Adwhirl Adapter and the InMobi SDK?
Updated InMobi Android SDK: http://dl.dropbox.com/u/16117/InMobi_Android_SDK_Rel_v2.3.zip Update Adwhirl Adapters:
http://dl.dropbox.com/u/30899852/InMobiAdapter.java – This is for the Source version of Adwhirl SDK http://dl.dropbox.com/u/30899852/adWhirl/AdWhirlSDK_Android_3.0.0.jar – This is for developers using the Compiled version of the Adwhirl SDK (has the adapters of other ad networks which come by default with the Source SDK)
Just to make sure, have you requested the Internet permission ?
InMobi adapter that is part of the Adwhirl SDK is not compatible with InMobi SDK version 2.0
Please star the open issues (looks like some are repeated) here:
http://code.google.com/p/adwhirl/issues/detail?id=176
http://code.google.com/p/adwhirl/issues/detail?id=186
http://code.google.com/p/adwhirl/issues/detail?id=187

Categories

Resources