Cordova cammands无法正常执行,但会永远挂起

时间:2018-12-21 15:08:54

标签: javascript node.js windows cordova cmd

我试图在命令行上运行cordova命令,但是我执行的任何命令,cordova进程永远挂起并且无法成功执行,例如,当我键入内容时,我正在尝试为Android构建Cordova应用程序 cordova run android --target=127.0.0.1:5000 --verbose 我得到以下报告

No scripts found for hook "before_run". No scripts found for hook "before_prepare". Checking config.xml and package.json for saved platforms that haven't been added to the project Config.xml and package.json platforms are the same. No pkg.json modification. Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms. PlatformApi successfully found for platform android Android Studio project detected Checking config.xml for saved plugins that haven't been added to the project Checking for any plugins added to the project that have not been installed in android platform No differences found between plugins added to project and installed in android platform. Continuing... Generating platform-specific config.xml from defaults for android at C:\Users\HP-15\Campus-Enotice-Android\platforms\android\app\src\main\res\xml\config.xml Merging project's config.xml into platform-specific android config.xml Merging and updating files from [www, platforms\android\platform_www] to platforms\android\app\src\main\assets\www Wrote out android application name "Campus E-Notice" to C:\Users\HP-15\Campus-Enotice-Android\platforms\android\app\src\main\res\values\strings.xml android-versionCode not found in config.xml. Generating a code based on version in config.xml (1.0.0): 10000 Wrote out Android package name "co.bucktechnology.co" to C:\Users\HP-15\Campus-Enotice-Android\platforms\android\app\src\main\java\co\bucktechnology\co\MainActivity.java This app does not have launcher icons defined This app does not have splash screens defined Updating resource files at platforms\android Prepared android project successfully No scripts found for hook "after_prepare". ANDROID_HOME=D:\android\sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111 studio Subproject Path: CordovaLib Subproject Path: app Running command: cmd "/s /c "C:\Users\HP-15\Campus-Enotice-Android\platforms\android\gradlew.bat cdvBuildDebug -b C:\Users\HP-15\Campus-Enotice-Android\platforms\android\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m"" Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details publishNonDefault is deprecated and has no effect anymore. All variants are now published. Observed package id 'add-ons;addon-google_apis-google-24' in inconsistent location 'D:\android\sdk\add-ons\addon-google_apis-google-24-1' (Expected 'D:\android\sdk\add-ons\addon-google_apis-google-24') Already observed package id 'add-ons;addon-google_apis-google-24' in 'D:\android\sdk\add-ons\addon-google_apis-google-24'. Skipping duplicate at 'D:\android\sdk\add-ons\addon-google_apis-google-24-1' Observed package id 'add-ons;addon-google_apis-google-24' in inconsistent location 'D:\android\sdk\add-ons\addon-google_apis-google-24-1' (Expected 'D:\android\sdk\add-ons\addon-google_apis-google-24') Already observed package id 'add-ons;addon-google_apis-google-24' in 'D:\android\sdk\add-ons\addon-google_apis-google-24'. Skipping duplicate at 'D:\android\sdk\add-ons\addon-google_apis-google-24-1' The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. at build_9308avscpha59jkwt518ezcf1.run(C:\Users\HP-15\Campus-Enotice-Android\platforms\android\app\build.gradle:150) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl UP-TO-DATE :CordovaLib:compileDebugRenderscript UP-TO-DATE :CordovaLib:checkDebugManifest UP-TO-DATE :CordovaLib:generateDebugBuildConfig UP-TO-DATE :CordovaLib:prepareLintJar UP-TO-DATE :CordovaLib:generateDebugResValues UP-TO-DATE :CordovaLib:generateDebugResources UP-TO-DATE :CordovaLib:packageDebugResources UP-TO-DATE :CordovaLib:platformAttrExtractor :CordovaLib:processDebugManifest UP-TO-DATE :CordovaLib:javaPreCompileDebug UP-TO-DATE :CordovaLib:processDebugJavaRes NO-SOURCE :app:preBuild UP-TO-DATE :app:preDebugBuild

它会像这样保持数小时,而无需进一步执行。 它做错了什么?我正在使用npm 6.4.1版本和cordova 8.1.2版本

1 个答案:

答案 0 :(得分:0)

这是互联网连接问题,我的ISP暂时阻止了我的google服务,从而导致gradle服务无法下载新的和更新的文件...因此,每当我运行Cordova时,它看起来都会继续下载文件,这会导致命令行挂起。与Google服务建立适当的连接后,一切都将完美执行。