I'm reading the book "Beginning NFC Near Field Communication with Arduino, Android, and PhoneGap" . On page 29 under "Creating a PhoneGap Project" I'm trying to create a PhoneGap project with this command cordova create ~/Hello com.example.hello Hello
and cordova platform add android
. Everything seems (at least to me) to go well until when I try to run cordova run
which spits the following lines:
ANDROID_HOME=/home/moki/Work/Tools/android-sdk-linux/
JAVA_HOME=/usr/java/jdk1.8.0_91
No target specified, deploying to device 'CB5A2AKNFT'.
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
Exception in thread "main" java.lang.RuntimeException: java.net.SocketException: Connection reset
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:675)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
Error: Error code 1 for command: /home/moki/Work/src/Hello/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/moki/Work/src/Hello/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
I'm unable to figure out what's the problem. How can I fix that?
I've installed Android SDK tools rev 25.1.3
, Android SDK Platform-tools rev 23.1
, Android SDK Build-tools rev 23.0.3
and Android 6.0 (API 23) SDK Platform
. What else do I have to do to be able to run my first project successfully?
I'm trying to work under Debian Jessie
OS. I'v also set my Android phone which is a Sony Xperia Z5 dual premium and it's already in developer mode with usb debugging enabled.
Run "cordova build android" in CLI after you've entered "cordova add platform android".
Have fun!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.