Questions tagged [illegalargumentexception]

An exception that indicates that the arguments supplied to a method or function are not valid for their intended purpose, or are different to the format expected by the method.

An exception that indicates that the arguments supplied to a method or function are not valid for their intended purpose, or are different to the format expected by the method.

This could occur as a result of many different actions, such as...

  1. You are calling a method that accepts a low-level object type for an argument (such as Object) but you're passing an object that is not one of the types expected by the method. For example, the method might be declaring the argument as an Object so that it can capture a range of different objects in the one method, but the code implementation of the method only allows objects of certain types (such as expecting a Number-based object, and you're passing a String).
  2. You're using methods that are building a dynamic structure for use in a different context, and the argument that you're passing is not valid for the other context. For example, you might be building an SQL statement, and you're passing an argument as a String for a database field that expects a Number. The database context would detect the error and report back the exception.

This type of exception may be hard to predict, as it won't be detected at compile-time, and may only show up under certain circumstances.

965 questions
6
votes
3 answers

IllegalArgumentException readExceptionFromParcel

I got this Error from one of my users and i have NO clue how to fix it... java.lang.IllegalArgumentException DatabaseUtils.readExceptionFromParcel() java.lang.IllegalArgumentException: URI: content://com.android.contacts/phone_lookup/, calling user:…
user754730
  • 1,341
  • 5
  • 31
  • 62
6
votes
1 answer

Adding an admob causes an error that does not exist. error - java.lang.IllegalArgumentException: Service not registered: lt@777a78f

To use the Admob. Implementation 'com.Google.android.gms:play-services-adds:19.2.0' I added this part. I added Menifest. (I've filed an official Admob document. ) Sample advertisement is also good. But the error message below kept coming up. There…
6
votes
3 answers

IllegalArgumentException: ID does not reference a View inside this Activity

I have been trying to make a home page for my app which contains some modern dashboard along with navigation drawer. Error found in my code: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.thinkerlab, PID: 13956 …
6
votes
3 answers

Creating a NotificationChannel throws an IllegalArgumentException

The app works on previous versions of Android, but not on Oreo. It's a WebView with Notifications. I've been researching this error and haven't found anything similar. The stack trace: E/AndroidRuntime: FATAL EXCEPTION: main Process:…
6
votes
3 answers

Comparison method violates its general contract while comparing java.util.Date

I am getting error below: Caused by: javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: Comparison method violates its general contract! at…
Jigar Naik
  • 1,946
  • 5
  • 29
  • 60
6
votes
4 answers

geocoder.getFromLocationName returns only null

I am going out of my mind for the last two days with an IllegalArgumentException error I receive in Android code when trying to get a coordinates out of an address, or even reverse, get address out of longitude and latitude. This is the code, but I…
test
  • 105
  • 1
  • 2
  • 6
6
votes
3 answers

java.lang.IllegalArgumentException: class java.text.DecimalFormat declares multiple JSON fields named maximumIntegerDigits

I am making an ajax call to the servlet. I want the data back from the servlet to the jsp: PrintWriter out = response.getWriter(); String isbn = (String) request.getParameter("isbn"); BookDetail bd = new BookDetail(); …
Pranjal Choladhara
  • 845
  • 2
  • 14
  • 35
6
votes
2 answers

IllegalArgumentException: File contains a path separator Android

I'm trying to write to an output file on my HTC One and get the following message in the LogCat: 11-21 08:05:18.228: W/System.err(6609): java.lang.IllegalArgumentException: File /storage/emulated/0/com.example.pattern1/myfile.txt contains a path…
Talal Saleem
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

Proguard: IllegalArgumentException - Unexpected error while evaluating instruction

I'm trying to build a release apk with the proguard enabled. I'm getting the error below. I will attach the full stacktrace below. Unexpected error while evaluating instruction: Class = [*] Method =…
Calvin Park
  • 1,144
  • 1
  • 12
  • 21
6
votes
3 answers

Correct usage of IllegalArgumentException

Original question is here I am reading in a UTF-8 file and parsing the contents of that file. If there is error in the file there is no point to continue and execution should stop. I have been suggested to throw IllegalArgumentException if there are…
Erki M.
  • 5,022
  • 1
  • 48
  • 74
6
votes
1 answer

IllegalArgumentException Surface.nativeLockCanvas , Choreographer, BufferQueue

I have a complex application that creates multiple Bitmap objets and uses them to create BitmapDrawables. I know this might be a tough question to answer, but any help in pointing me in the right direction would be much appreciated. I have run tests…
ChrisVollo
  • 157
  • 1
  • 3
  • 15
6
votes
3 answers

Tomcat 7 exception when cookie contain umlaut characters

I'm a developer and I face the exception below when Cookie contain umlaut characters (ä,ö,ü), I tried many solutions and configurations without any result. I use Tomcat7 Any solution please Feb 21, 2013 6:29:16 AM…
6
votes
4 answers

Android : IllegalArgumentException: "Component class X does not exist" in API 17 (no crash in API 8)

My emulators : When I launch the tablet emulator I get : FATAL EXCEPTION: main java.lang.IllegalArgumentException: Component class TriggerMonitoringBootReceiver does not exist in di.k23b.hw3 at android.os.Parcel.readException(Parcel.java:1429) …
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
6
votes
1 answer

java treeset throwing illegalArgumentException: key out of range

I've stripped down the code to reproduce an example which throws the error: public class Test { public static void main(String[] args) { NavigableSet set = new TreeSet( Arrays.asList("a", "b", "c", "d")); …
Kes115
  • 2,070
  • 2
  • 21
  • 37
5
votes
2 answers

Android TabView error?

I am trying to implement Tab View for my activity. I am getting an error that states. java.lang.IllegalArgumentException: you must specify a way to create the tab indicator Resources res = getResources(); // Resource object to get Drawables …
Vinoth
  • 1,339
  • 6
  • 23
  • 42