Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty url results in crash in RN Android #1115

Closed
harshsrivastavaglobussoft opened this issue Oct 5, 2017 · 3 comments
Closed

Empty url results in crash in RN Android #1115

harshsrivastavaglobussoft opened this issue Oct 5, 2017 · 3 comments

Comments

@harshsrivastavaglobussoft
Copy link

harshsrivastavaglobussoft commented Oct 5, 2017

 `   export const peopleSearch = ({ name, location, navigation }) => {
  console.log('People_Name: '+ name +' Location: '+location);
  console.log("Search Url ============");
  console.log(config.SEARCH_URL);

const search_name = name;

return (dispatch) => {
	axios.post(config.SEARCH_URL, {
			search_type: "people",
			searchCriteria1: name,
		})
		.then( data => {
			console.log(data);
			if(data.data.message === 'Success'){
				console.log("success")
				peopleSearchSuccess(dispatch, data, search_name, navigation)
			}else{
				console.log("Failed")
				peopleSearchFailed(dispatch)
			}
		})
		.catch(error => console.log(error.response))
}

}
`
in Android I am getting error

`0-05 07:44:20.068 1063-1245/com.d########ka E/unknown:ReactNative: Exception in native call
java.lang.IllegalArgumentException: unexpected url: undefinedsearch-details
at okhttp3.Request$Builder.url(Request.java:142)
at com.facebook.react.modules.network.NetworkingModule.sendRequest(NetworkingModule.java:171)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:137)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
at java.lang.Thread.run(Thread.java:856)
screen shot 2017-10-05 at 1 34 33 pm

`

@sabakugaara
Copy link

maybe you should check variable config.SEARCH_URL, I think it is undefined, not a axios bug

@ekimlinger
Copy link

Axios should still be throwing some kind of js error in this case though. (Also experiencing the same issue) This is an exception being thrown at the android level which is something that axios should be able to catch.

@chinesedfan chinesedfan changed the title Unexpected Url issue in android Empty url results in crash in RN Android Dec 21, 2019
@chinesedfan
Copy link
Collaborator

Closed in favor of #3110.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants