Cordova Build失败,但有例外

时间:2015-05-14 10:07:41

标签: android eclipse cordova plugins

在我的项目中添加https://github.com/cowbell/cordova-plugin-geofence插件后,只是遇到了一些错误。

删除了插件,但异常的错误仍在提高。 :/

> $ cordova -d --stacktrace build android
Generating config.xml from defaults for platform "android"
Calling plugman.prepare for platform "android"
Preparing android project
Processing configuration changes for plugins.
Iterating over installed plugins: [ 'com.phonegap.plugins.facebookconnect',
  'it.mobimentum.phonegapspinnerplugin',
  'org.apache.cordova.camera',
  'org.apache.cordova.device',
  'org.apache.cordova.dialogs',
  'org.apache.cordova.file',
  'org.apache.cordova.file-transfer',
  'org.apache.cordova.geolocation',
  'org.apache.cordova.inappbrowser',
  'org.apache.cordova.network-information',
  'net.trentgardner.cordova.galaxygear',
  'io.github.pwlin.cordova.plugins.pdialog' ]
Writing out cordova_plugins.js...
Wrote out Android application name to "<ProjectName>"
deleted: c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\res\drawable-hdpi\icon.png
deleted: c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\res\drawable-ldpi\icon.png
deleted: c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\res\drawable-mdpi\icon.png
deleted: c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\res\drawable-xhdpi\icon.png
deleted: c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\res\drawable-xxhdpi\icon.png
copying image from c:\Users\<Name>\workspace\<ProjectName>\www\ico
n.png to c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\res\drawable\icon.png
copying image from c:\Users\<Name>\workspace\<ProjectName>\www\res
\icon\android\icon-36-ldpi.png to c:\Users\<Name>\workspace\<ProjectName>\platforms\android\res\drawable-ldpi\icon.png
copying image from c:\Users\<Name>\workspace\<ProjectName>\www\res
\icon\android\icon-48-mdpi.png to c:\Users\<Name>\workspace\<ProjectName>\platforms\android\res\drawable-mdpi\icon.png
copying image from c:\Users\<Name>\workspace\<ProjectName>\www\res
\icon\android\icon-72-hdpi.png to c:\Users\<Name>\workspace\<ProjectName>\platforms\android\res\drawable-hdpi\icon.png
copying image from c:\Users\<Name>\workspace\<ProjectName>\www\res
\icon\android\icon-96-xhdpi.png to c:\Users\<Name>\workspace\<ProjectName>\platforms\android\res\drawable-xhdpi\icon.png
copying image from c:\Users\<Name>\workspace\<ProjectName>\www\res
\icon\android\icon-144-xxhdpi.png to c:\Users\<Name>\workspace\<ProjectName>\platforms\android\res\drawable-xxhdpi\icon.png
Wrote out Android package name to "com.projectname.app"
Running command: c:\Users\<Name>\workspace\<ProjectName>\platforms
\android\cordova\build.bat
ANDROID_HOME=c:\Users\<Name>\android-sdks
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_40
Running: c:\Users\<Name>\workspace\<ProjectName>\platforms\android
\gradlew cdvBuildDebug -b c:\Users\<Name>\workspace\<ProjectName>\
platforms\android\build.gradle -Dorg.gradle.daemon=true

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\Users\<Name>\workspace\<ProjectName>\platforms\a
ndroid\settings.gradle' line: 4

* What went wrong:
A problem occurred evaluating settings 'android'.
> A path must be specified!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 2.395 secs

c:\Users\<Name>\workspace\<ProjectName>\platforms\android\cordova\
node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c "c:\Users\<Name>\workspace\<ProjectName>\platforms\android\gradlew cdvBuildDebug -b c:\Users\<Name>\
workspace\<ProjectName>\platforms\android\build.gradle -Dorg.grad
le.daemon=true"
Command finished with error code 8: c:\Users\<Name>\workspace\<ProjectName>\platforms\android\cordova\build.bat
Error: c:\Users\<Name>\workspace\<ProjectName>\platforms\android\c
ordova\build.bat: Command failed with exit code 8
    at ChildProcess.whenDone (c:\Users\<Name>\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

settings.gradle文件:

// GENERATED FILE - DO NOT EDIT
include ":"
include ":CordovaLib"
include ":com.phonegap.plugins.facebookconnect::FacebookLib"

尝试过几件事:

  
      
  • ant clean through console
  •   
  • 项目 - &gt;通过Eclipse清理
  •   
  • 通过控制台安装android更新项目
  •   

对我来说没有任何作用。 :/

任何人都可以帮助我吗? :)

1 个答案:

答案 0 :(得分:1)

已删除与settings.gradle文件中的第4行关联的插件,已编译项目。 然后再添加Geofence插件,它再次工作! :)