【发布时间】:2019-12-31 07:39:55
【问题描述】:
我有一个项目,它的后端使用 laravel,我把它放在 virtualbox 机器中。我已成功从本地浏览器访问。现在我必须构建从后端调用 api 的 android 应用程序。但它给了我错误
JS: {
JS: "headers": {
JS: "normalizedNames": {},
JS: "lazyUpdate": null,
JS: "headers": {}
JS: },
JS: "status": 0,
JS: "statusText": "Unknown Error",
JS: "url": "http://izat.test:8000/api/v1/auth/login",
JS: "ok": false,
JS: "name": "HttpErrorResponse",
JS: "message": "Http failure response for http://izat.test:8000/api/v1/auth/login: 0 Unknown Error",
JS: "error": {
JS: "originalStack": "Error: java.net.UnknownHostException: Unable to resolve host \"izat.test\": No address associated with hostname\n at new ZoneAwareError (file:///data/data/org.nativescript.fraapp/files/app/vendor.js:91443:33)\n at onRequestComplete (file:///data/data/org.nativescript.fraapp/files/app/vendor.js:97223:34)\n at Object.onComplete (file:///node_modules\@nativescript\core\http\http-request\http-request.js:43:0)"
JS: }
JS: }
顺便说一句,我使用 nativescript-angular 来构建我的 android 应用程序。 我将 API 27 用于 android 模拟器
【问题讨论】:
-
如果
izat.test是在您的本地计算机配置中注册的域,那么您的模拟器可能无法使用它。 -
@Manoj 你能告诉我如何让它在我的模拟器中可用吗?
标签: android android-emulator nativescript nativescript-angular