java.lang.IllegalArgumentException: IMyClient.getUser: Must have return type or Callback as last argument, not both.


Solutions on the web

Solution icon of stackoverflow
via Stack Overflow by Keeano
, 9 months ago
IMyClient.getUser: Must have return type or Callback as last argument, not both.

Solution icon of stackoverflow
via Stack Overflow by Qasim Khokhar
, 1 year ago
RetrofitInterface.getUser: Must have return type or Callback as last argument, not both.

Solution icon of stackoverflow
CustomService.show: Must have either a return type or Callback as last argument.

Solution icon of github
IntercomApiInterface.getUnreadConversations: Must have either a return type or Callback as last argument.

Solution icon of stackoverflow
via Stack Overflow by sarthakmeh
, 1 year ago
d.a: Last parameter must be of type Callback<X> or Callback<? super X>.

Solution icon of github
RestApiService.loadCurrentUser: URL query string "i={i}" must not have replace block.

Solution icon of stackoverflow
via Stack Overflow by Perry Hoekstra
, 1 year ago
FooService.getPositionByZip: URL query string "address={zipcode}&sensor=false" must not have replace block.

Solution icon of stackoverflow
via Stack Overflow by Akshay Sood
, 1 year ago
api.getData: URL query string "path={latlong}&interpolate=true&key=AIzaSyDAsAs9k2dQ6aDMUlgLcE-dTxAOxMtADTU" must not have replace block. For dynamic query parameters use @Query.

Solution icon of github
PodApi.sendMultipleLocations: @FieldMap parameter type must be Map. (parameter #2)

Solution icon of stackoverflow
PodApi.sendMultipleLocations: @FieldMap parameter type must be Map. (parameter #2)

Stack trace

java.lang.IllegalArgumentException: IMyClient.getUser: Must have return type or Callback as last argument, not both.
	at retrofit.RestMethodInfo.methodError(RestMethodInfo.java:107)
	at retrofit.RestMethodInfo.parseResponseType(RestMethodInfo.java:267)
	at retrofit.RestMethodInfo.<init>(RestMethodInfo.java:97)
	at retrofit.RestAdapter.getMethodInfo(RestAdapter.java:213)
	at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:236)
	at java.lang.reflect.Proxy.invoke(Proxy.java:393)
	at $Proxy15.getUser(Unknown Source)
	at client.MyClient.getUser(MyClient.java:111)
	at task.UserProfileTask.call(UserProfileTask.java:41)
	at task.UserProfileTask.call(UserProfileTask.java:22)
	at roboguice.util.SafeAsyncTask$SafeAsyncTaskAndroidCallable.doInBackground(SafeAsyncTask.java:163)
	at roboguice.util.AndroidCallableWrapper.doDoInBackgroundThread(AndroidCallableWrapper.java:113)
	at roboguice.util.AndroidCallableWrapper.run(AndroidCallableWrapper.java:41)
	at roboguice.util.AndroidCallable.run(AndroidCallable.java:20)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
	at java.lang.Thread.run(Thread.java:818)
	at dalvik.system.VMStack.getThreadStackTrace(Native Method)
	at java.lang.Thread.getStackTrace(Thread.java:580)
	at roboguice.util.AndroidCallable.<init>(AndroidCallable.java:12)
	at roboguice.util.SafeAsyncTask$SafeAsyncTaskAndroidCallable.<init>(SafeAsyncTask.java:160)
	at roboguice.util.SafeAsyncTask.newTask(SafeAsyncTask.java:156)
	at roboguice.util.SafeAsyncTask.future(SafeAsyncTask.java:66)
	at roboguice.util.SafeAsyncTask.execute(SafeAsyncTask.java:94)
	at roboguice.util.SafeAsyncTask.execute(SafeAsyncTask.java:90)
	at ui.fragment.AccountFragment.onViewCreated(AccountFragment.java:122)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1127)
	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290)
	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1677)
	at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
	at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:604)
	at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
	at roboguice.activity.RoboActionBarActivity.onStart(RoboActionBarActivity.java:106)
	at ui.activity.BaseActivity.onStart(BaseActivity.java:270)
	at ui.activity.AccountActivity.onStart(AccountActivity.java:60)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
	at android.app.Activity.performStart(Activity.java:6253)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago