无法在通过USB连接的设备测试科尔多瓦Android应用? [英] Not able to test cordova android app in device attached via USB?
问题描述
该应用程序上运行虚拟设备AVD nexus5罚款。但是,当我试图测试我corova Android应用我收到错误。
我使用的Android 1.3工作室。我已创建使用CLI科尔多瓦,然后在Android Studio中导入的应用程序。
另外我的设备-Mi4i运行的是Android 5.0(这是否有什么差别?)
The app is running fine on virtual device AVD nexus5. But when I am trying to test my corova android app I am getting error. I am using Android Studio 1.3. I have create the app using cordova CLI and then imported in Android Studio. Also my device -Mi4i is running Android 5.0 (Does this makes any difference?)
编译SDK版本:API 22(5.1,棒棒堂)
构建工具版本:22.0.1
Compile SDK version: API 22 (5.1, Lollipop) Build Tools version: 22.0.1
在logcat中的错误是:结果
一)E / SysUtils单元:ApplicationContext就是在ApplicationStatus结果无效
二)E / libEGL:validate_display:255错误3008(EGL_BAD_DISPLAY)
The errors in logcat are:
a) E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
b) E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
在使用Chrome开发人员工具检查,显示此错误:结果
无法加载资源:净:: ERR_ADDRESS_UNREACHABLE
<一href=\"http://10.0.2.2/s/state?callback=jQuery213013105976837687194_1442380968984&_=1442380968985\" rel=\"nofollow\">http://10.0.2.2/s/state?callback=jQuery213013105976837687194_1442380968984&_=1442380968985
When inspected using chrome developer tools, this error is shown:
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE
http://10.0.2.2/s/state?callback=jQuery213013105976837687194_1442380968984&_=1442380968985
推荐答案
现在,我能够测试/与USB连接的设备上运行我的应用程序。
我写的要点!
所有的结果首先,确保你是用手机已连接的相机(PTP)选项,而不是媒体设备(MTP)连接。
Now, I am able to test/run my app in the device connected with USB.
I am writing the important points!
First of all, make sure you are connected with the mobile with 'Connected as Camera (PTP)' option and not 'Media Device(MTP)'.
另外,我卸载我的应用程序,我得到了早些时候从移动安装!
Also, I uninstalled my app that I got installed earlier from the mobile!
接下来,我改变了从Android的工作室'我的应用程序的版本的信息。
以下是我做到了:结果
1)打开Android Studio中搜索应用
2)打开项目结构对话框(文件菜单 - >项目结构)的
结果
图。 1
结果
接下来在属性选项卡结果
改变编译SDK版本,以API 21结果
改变构建工具版本'到21.1.2结果
来源兼容性1.7结果
目标兼容性1.7结果
Next I changed the 'versions' info of my application from 'Android Studio'.
Here's how I did it:
1) Open 'app' in Android Studio
2) Open 'Project Structure' dialog box (File menu -> project structure)
Fig. 1
Next on Properties Tab
Changed ‘Compile Sdk Version’ to API 21
Changed ‘Build Tools Version’ to 21.1.2
Source Compatibility to 1.7
Target Compatibility to 1.7
结果
设置最小SDK版本为API15(虽然截至目前,闵SDK版本为API14)结果
选择目标SDK版本,以API 21
结果
Select Min Sdk Version to API15 ( Though as of now, Min Sdk version is API14)
Select 'Target Sdk Version' to API 21
最后,从 http://10.0.2.2 '改变了服务器URL(应用程序中访问),以 HTTP://54.xx.xx.xx ,即远程服务器的URL!
结果当试图访问 http://10.0.2.2 我得到错误网:: ERR_NAME_NOT_RESOLVED。结果
但是,远程服务器上我的应用程序正在运行没有错误!请确保您使用的互联网连接。
And lastly, Changed the server Url (accessed in app) from ‘http://10.0.2.2’ to ‘http://54.xx.xx.xx’ i.e. url of remote server!
When trying to access ‘http://10.0.2.2’ I was getting error "net::ERR_NAME_NOT_RESOLVED".
But on remote server my app was running without errors! Make sure you are connected with internet.
这篇关于无法在通过USB连接的设备测试科尔多瓦Android应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!