Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache Cordova:生成失败错误代码1和Javascript异常_Javascript_Android_Apache_Cordova - Fatal编程技术网

Apache Cordova:生成失败错误代码1和Javascript异常

Apache Cordova:生成失败错误代码1和Javascript异常,javascript,android,apache,cordova,Javascript,Android,Apache,Cordova,我正在用ApacheCordova制作一个小的Android应用程序。在构建开始崩溃之前,一切都很好。正如这里的另一个线程所建议的,我重新安装了我正在使用的Apache Cordova插件(媒体)。在MSDN上,有人通过删除C:/Users/MyName/.gradle并关闭防火墙找到了帮助,所以java将再次下载一些东西。下载后,我遇到了一个故障: ...... :compileDebugRenderscript UP-TO-DATE 1> :generateDebugBuil

我正在用ApacheCordova制作一个小的Android应用程序。在构建开始崩溃之前,一切都很好。正如这里的另一个线程所建议的,我重新安装了我正在使用的Apache Cordova插件(媒体)。在MSDN上,有人通过删除C:/Users/MyName/.gradle并关闭防火墙找到了帮助,所以java将再次下载一些东西。下载后,我遇到了一个故障:

......
    :compileDebugRenderscript UP-TO-DATE
1>  :generateDebugBuildConfig UP-TO-DATE
1>  :generateDebugAssets UP-TO-DATE
1>  :mergeDebugAssets FAILED
1>
1>  FAILURE: Build failed with an exception.
1>
1>  * What went wrong:
1>  Execution failed for task ':mergeDebugAssets'.
1>  > java.lang.NullPointerException (no error message)
1>
1>  * Try:
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>
1>  BUILD FAILED
1>
1>  Total time: 3 mins 11.981 secs
1>  Picked up _JAVA_OPTIONS: -Xmx512M
1>
1>  C:\Users\Paul\Documents\Visual Studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\cordova\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>  Error code 1 for command: cmd with args: /s /c ""C:\Users\Paul\Documents\Visual Studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\gradlew" cdvBuildDebug -b "C:\Users\Paul\Documents\Visual Studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1>  Command finished with error code 1: cmd /s /c ""C:\Users\Paul\documents\visual studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\cordova\build.bat" --debug "--buildConfig=C:\Users\Paul\documents\visual studio 2015\Projects\LifePointCounter\LifePointCounter\build.json""
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
1>  You may not have the required environment or OS to build this project
1>MDAVSCLI : error : cmd: Command failed with exit code 1
在出现此错误之前,我做的最后一件事是:

  • 更改某些资源音频文件(之后播放这些文件会在运行时出错)
  • 在我的设备上卸载我的应用程序(通过内部版本重新安装)
我不知道那里发生了什么,我对这方面也不是很在行

编辑:

另一个线程建议将Node.js升级到版本0.10.36
现在我得到退出代码8,只有一个错误>对于我来说,解决方案是:

cordova clean
然后当我跑步时:

cordova emulate android

一切又恢复了

非常感谢!当我在另一台PC上构建代码时,我遇到了
mergeDebugAssets失败
问题,并且
cordova clean
得到了帮助。