i am developing an Android app that communicates with Bluetooth sending and receiving raw commands on byte array.
Randomly the app crashes right after i send some of this command, with the following excepcion;
`Process: xxx.xxx.xxx, PID: 19983
java.lang.IndexOutOfBoundsException: 2, 1
at android.text.PackedIntVector.getValue(PackedIntVector.java:75)
at android.text.DynamicLayout.getLineTop(DynamicLayout.java:1010)
at android.text.Layout.getLineBottom(Layout.java:1725)
at android.widget.Editor.drawHardwareAcceleratedInner(Editor.java:2310)
at android.widget.Editor.drawHardwareAccelerated(Editor.java:2251)
at android.widget.Editor.onDraw(Editor.java:2191)
at android.widget.TextView.onDraw(TextView.java:8852)
at android.view.View.draw(View.java:23901)`
As i understand the problem is on the PackedIntVector.java class, but its an Android class and on the stack trace there isn`t any of my app files, all are from Android classes.
Does anybody know what could be happening? The excepcion always happen right after sending a command and not always happen, but i have not found any thtat triggers it, seems "random".
Thanks in advice!
Related
I am using Android WifiP2P service to make a group connection between 10 phones with one being the Host and others being Guests. I coded everything and it seems to be working fine when I test on API<=22, but on API 23 and higher I randomly get
E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiP2pService
Java.lang.IllegalArgumentException: Null device
The error occurs with no apparent trigger, and it happens randomly. Sometimes phones are able to communicate with no issues for almost 30 minutes, but sometimes it happens a couple of times in just a few minutes.
I am not sure what might be causing this. I would be very grateful if someone finds time and knowledge to help me with this issue. Thanks in advance!
This is a screenshot of the error.
I have a problem with my android application. In Android Studio, everything looks normal since no error appears. The application is supposed to connect to the web server for data recovery. But every time I test the app on my android device or on an emulator, I still have the same message: "Appname can not connect to the server"
So, since I do not see any error on Android studio, I do not know where to look. I tried with the coordinates of two different servers, but still the same message. I have concluded that the problem is not at the level of the connection to the server, but in my code, but where?
If anyone has any suggestion, I'm a taker. If you need to see any file, let me know.
When I run my application many lines appear in the logcat but only one error:
E/art﹕ Failed sending reply to debugger: Broken pipe.
What does it mean? And how can I fix it?
Explaining the error:
E/ART: Failed sending reply to debugger: Broken pipe.
What is E/ART?
ART is the Android RunTime. This is the bytecode interpreter on your Android phone. The E simply indicates the logging level of ERROR.
What is "sending reply to debugger"?
Debugging on the Android phone is done using the adb (Android Debugging Bridge). The adb process runs on your dev machine (your laptop or PC) and a daemon runs on the Android device (i.e., the emulator or handset).
What is a broken pipe?
Your dev machine and the Android device communicate like a client server and a broken pipe means that the communication has become invalid. For instance, the client (the Android device) is trying to send a reply to the server (the adb process running on the dev machine) but the server has already closed the socket.
How to fix it
First make sure your app is building correctly by performing a clean/rebuild.
Then if you are running your app using USB debugging on a real phone then you can often fix the problem by unplugging the USB cable and then plugging it back in to reestablish the client/server connection.
If this doesn't work, you can disconnect the USB cable and (stop the emulator if necessary) and close Android Studio. This is often enough to stop the adb process. Then when you open Android Studio again it will restart and the connection will be reestablished.
If this doesn't work, you can try stopping the adb server manually using the instructions in this question. For instance, you can try opening command prompt or terminal and going to the sdk/platform-tools directory and typing:
adb kill-server
adb start-server
You can do the following:
Kill emulator and Android Studio
Open Android Studio and "Rebuild" that basically deletes the build folder and recreates it.
I had a breakpoint in a return statement, when I removed it everything ran as it should. So give that a try too (removing all breakpoints).
killing the "adb" process helped me recover from this error. Just try restarting the adb.
The Error comes because of not getting the actual data or class. Use Android Monitor with Log level Error and no Regex filter to check error.
Hope you will get actual error.
I had this error when I made a mistake with a object type (img response) in my model class, while I tried to get response from my Url in Android. And when I fixed it the error gone
Check the file name colors in res folder
if name is color then replace with colors
I think you need to move your color declaration out of strings.xml and put it inside of colors.xml
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="myColor">#ccff00</color>
</resources>
i'm sorry to repost this question, but the other one was put on hold for no reason and i have an app out there that doesn't work because of this problem, and i need a fix as soon as possible.
THIS IS THE ONLY INFO ECLIPSE AND THE APP ITSELF GIVES TO ME:
i've developed an app for android that uses fb to share a link, when i share a post with MY fb account everything goes fine, except that no one sees that post! but when i do with my gf's it doesn't even post it and gives me back a toast saying that error and logcat is this:
04-18 15:57:57.650: E/Activity(16658): Error: com.facebook.FacebookException: Error publishing message
there, i do this:
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(Favorites.this)
.setDescription("xxxxxxxxxxxxxx")
.setApplicationName("xxx")
.setName("xxx")
.setPicture(imagesURL+filenames.get(location))
.setLink("http://xxxxxxxxxx"+filenames.get(location))
.build();
uiHelper.trackPendingDialogCall(shareDialog.present());
The only possible reason seems to me is that, your application is still in the development mode. If so, besides you and other administrators/testers/developers; no one can see the post and also can't publish a post via your app.
To change the mode of your app to live in the app settings-
I made a very simple application to start playing around with Android development.
It works fine on the emulator, but it gives me the following error when I try to install it on my HTC Hero (v1.5):
Sorry! The application Simple Dial (process com.foo.simpledial) has
stopped unexpectedly. Please try again. (Force Close button)
and on in the Eclipse console, I get the following message:
[2010-06-14 23:10:52 - Simple Dial] Uploading Simple Dial.apk onto device 'HT9BSHF00222'
[2010-06-14 23:10:53 - Simple Dial] Installing Simple Dial.apk...
[2010-06-14 23:10:56 - Simple Dial] Success!
[2010-06-14 23:10:56 - Simple Dial] Starting activity com.alanvaghti.simpledial.DialActivity on device
[2010-06-14 23:10:57 - Simple Dial] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined
[2010-06-14 23:10:57 - Simple Dial] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined
[2010-06-14 23:10:57 - Simple Dial] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={com.alanvaghti.simpledial/com.alanvaghti.simpledial.DialActivity} }
I did put android:debuggable="true" inside the application tag on the manifest.xml
Any ideas on what is going on?? Thanks in advance!
Have the uses-sdk in your manifest?
<uses-sdk android:minSdkVersion="4" />
This is the problem that many of us would be facing and this problem may not be applicable only to testing the app but also to the app that you install on your device.
Android has 4 Layouts (most of us know)
Layout
Layout-small
Layout-large
Layout-xlarge
The issue with me was that I made the change in the XML file in the layout-small folder which supports 2.7 inches.
I ran the Emulator which was again for 2.7 inches and worked absolutely fine.
Now when I exported the signed application and tested in the device, it fails. The reason was that I did not make the necessary changes in the Layout folder.
My device was expecting some fields for the calculation that was in the main.xml file but not in the version installed.
So couple of things you should do.
1) When testing the application, do create only 1 folder (layout with all the xml files) and that way you will be able to test the FUNCTIONALITY of your app on all devices.
2) if you have created all the Layout folders and then make change in any XML file, do make sure that the change(s) is(are) cascaded to all folders.
Happy development...
I also see the same problem in my phone, but in emulator it works fine. Try debugging the app in the phone (USB debug), not in emulator. In my case, an "out of bound exception" in an array caused the crash in phone. To debug in the phone, you need to install "google usb driver".
Regards
Charly