Cordova Run Error - Proxy? - android

I'm on Windows 7, I set all my proxies. As you can see it fails with error code 8, but anything I search for seems not to match my problem exactly.
When I try to build and run my app in cordova, I get this error. I have no idea what to do! Any advice? Thanks everyone!
C:\Users\310202751\Documents\CordovaProjects\Locator>cordova run
Running command: cmd "/s /c "C:\Users\310202751\Documents\CordovaProjects\Locato
r\platforms\android\cordova\run.bat""
ANDROID_HOME=C:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45
WARNING : No target specified, deploying to device '84deb82e'.
Running: C:\Users\310202751\Documents\CordovaProjects\Locator\platforms\android\
gradlew cdvBuildDebug -b C:\Users\310202751\Documents\CordovaProjects\Locator\pl
atforms\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException
: Connection refused: connect
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.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.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
at sun.net.www.http.HttpClient.New(HttpClient.java:308)
at sun.net.www.http.HttpClient.New(HttpClient.java:326)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:1168)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConn
ection.java:1104)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:998)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:932)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLCo
nnection.java:1512)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1440)
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(ExclusiveFileAcc
essManager.java:65)
... 3 more

Related

Android Studio - Can't run project

I want to create a Flutter project on Android Studio. I'm downloaded a Flutter and integrated to Android Studio. And when I want to run my project on my smartphone, I'm getting an error:
Launching lib\main.dart on Galaxy J5 in debug mode...
Running Gradle task 'assembleDebug'...
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.base/java.net.PlainSocketImpl.connect0(Native Method)
at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/java.net.Socket.connect(Socket.java:558)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:526)
at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:524)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.www.http.HttpClient.privilegedOpenServer(HttpClient.java:523)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:564)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:212)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1208)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Exception: Gradle task assembleDebug failed with exit code 1
What I'm doing wrong?
Thanks a lot.

Error while executing command "phonegap build android" in cmd

I've just installed Phonegap in my windows and created a helloWorld application. Now I want to create unsigned apk file for this. But there is no android platform in folder named platforms in the project directory.
That's why I reached this SO link for solution.
Now I'm following one of the answers and trying to execute the command phonegap build android. But it is giving me following errors in cmd.
I've opened this commands as administrator.
Error log:
C:\Users\Kaushal28\Documents\ooo>phonegap build android
[phonegap] executing 'cordova build android ' ...
ANDROID_HOME=C:\Users\Kaushal28\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
Subproject Path: CordovaLib
Unzipping C:\Users\Kaushal28\.gradle\wrapper\dists\gradle-2.14.1- all\53l0mv9mggp9q5m2ip574m21oh\gradle-2.14.1-all.zip to C:\Users\Kaushal28\.gradle\wrapper\dists\gradle-2.14.1- all\53l0mv9mggp9q5m2ip574m21oh
Exception in thread "main"
java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
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.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
Error: cmd: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
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.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager. java:65)
... 3 more
What is the solution for this? Or I'm doing something wrong?
Thank you :)

Cordova: Error in adding android platform

I tried to add android platform but got an error. I don't know what it is.
Android project created with cordova-android#6.0.0
Installing "cordova-plugin-battery-status" for android
ANDROID_HOME=C:\Users\MariaLigayahin\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
Subproject Path: CordovaLib
Unzipping C:\Users\MariaLigayahin\.gradle\wrapper\dists\gradle-2.14.1-all\53l0mv9mggp9q5m2ip574m21oh\gradle-2.14.1-all.zip to C:\Users\MariaLigayahin\.gradle\wrapper\dists\gradle-2.14.1-all\53l0mv9mggp9q5m2ip574m21oh
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
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.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
Failed to install 'cordova-plugin-battery-status':Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (D:\MariaLigayahin\Desktop\android_app\Helloworld\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Error: cmd: Command failed with exit code 1
Already tried removing and then adding again. Any help would be much appreciated.

connectedAndroidTest launched via gradle doesn't complete

I have over a hundred Espresso tests. Once in a while, when I launch them using ./gradlew clean cAT the tests complete on the connected device, in my case Genymotion emulator, but when they're done, the gradle task is stuck in the terminal at Building 96% > : <appname>:connectedAndroidTest . I can close the task with CTRL+C, but as it doesn't complete normally, no html output is produced.
EDIT:
10 minutes after the tests had concluded this is produced in the terminal (-d flag):
`
22:07:44.542 [DEBUG] [org.gradle.api.Task] DeviceConnector 'Google Nexus 5 - 5.1.0 - API 22 - 1080x1920 - 5.1': uninstalling <package>.test
22:07:44.551 [ERROR] [org.gradle.api.Task] Unable to uninstall <package>.test
com.android.ddmlib.InstallException: device '192.168.59.101:5555' not found
at com.android.ddmlib.Device.uninstallPackage(Device.java:1015)
at com.android.builder.testing.ConnectedDevice.uninstallPackage(ConnectedDevice.java:136)
at com.android.builder.internal.testing.SimpleTestCallable.uninstall(SimpleTestCallable.java:260)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:242)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:48)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.ddmlib.AdbCommandRejectedException: device '192.168.59.101:5555' not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:862)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:451)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:382)
at com.android.ddmlib.Device.executeShellCommand(Device.java:615)
at com.android.ddmlib.Device.uninstallPackage(Device.java:1009)
... 10 more
22:07:44.554 [ERROR] [org.gradle.api.Task] null
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: device '192.168.59.101:5555' not found
at com.android.builder.testing.ConnectedDevice.uninstallPackage(ConnectedDevice.java:139)
at com.android.builder.internal.testing.SimpleTestCallable.uninstall(SimpleTestCallable.java:260)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:242)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:48)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.ddmlib.InstallException: device '192.168.59.101:5555' not found
at com.android.ddmlib.Device.uninstallPackage(Device.java:1015)
at com.android.builder.testing.ConnectedDevice.uninstallPackage(ConnectedDevice.java:136)
... 9 more
Caused by: com.android.ddmlib.AdbCommandRejectedException: device '192.168.59.101:5555' not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:862)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:451)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:382)
at com.android.ddmlib.Device.executeShellCommand(Device.java:615)
at com.android.ddmlib.Device.uninstallPackage(Device.java:1009)
... 10 more
22:07:44.658 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':<appname>:connectedAndroidTest'
22:07:44.658 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :<appname>:connectedAndroidTest FAILED
`
EDIT:
It looks like it hangs on trying to uninstall the app in test.

Can't debugging JUnit + Roboloctric test in Android Studino with gradle

Yesterday it work fine!
But today i can't run with debug junit test. I don't understand what happens.
Logcat:
17:25:43.540 [ERROR] [system.err] ERROR: transport error 202: connect failed: Connection refused
17:25:43.540 [QUIET] [system.out] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
17:25:43.540 [ERROR] [system.err] ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
17:25:43.541 [ERROR] [system.err] JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:741]
17:25:43.927 [ERROR] [org.gradle.process.internal.streams.ExecOutputHandleRunner] Could not write standard input into: Gradle Test Executor 2.
java.io.IOException: Broken pipe
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:318)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:50)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
UPD
In this question "Broken pipe error when running Gradle test" was a problem in antivirus. But I dont have it.
Did you have any connectivity issues?
ERROR: transport error 202: connect failed: Connection refused
I had similar problem when executing my tests through proxy.

Categories

Resources