【发布时间】:2016-05-24 20:32:17
【问题描述】:
我已经为这个问题苦苦挣扎了太多小时。在我的 Cordova 应用程序中安装 AdMob-Pro 后,我无法成功清理或构建。 AdMob-Pro 最后一次安装是使用本地存储库。安装了依赖cordova-plugin-extension。诊断输出如下。
我不知道 MDA 任务错误指的是什么;在哪里配置输出目录?无论如何,bin 确实包含调试文件夹。
而且我在 AdMob-Pro 安装说明中找不到任何引用构建输出所引用的 google 依赖项的内容。
如果没有这个插件,我的项目将在模拟器和设备上构建和运行。有人可以向我解释这里出了什么问题吗?
谢谢!
>------ Rebuild All started: Project: projectname, Configuration: Debug Android ------
>Build started 5/24/2016 12:54:29 PM.
>
>
>Building with tools version "14.0".
>
>
>Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\projectname.jsproj" (entry point):
> Set Property: _InvalidConfigurationMessageText=The OutputPath property is not set for project 'projectname.jsproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='Android'.
> Set Property: _InvalidConfigurationMessageText=The OutputPath property is not set for project 'projectname.jsproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='Android'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.
> Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
> Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
> Using "Message" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
> Task "Message"
> Task Parameter:Text=Configuration=Debug
> Task Parameter:Importance=Low
> Configuration=Debug
> Done executing task "Message".
> Task "Message"
> Task Parameter:Text=Platform=Android
> Task Parameter:Importance=Low
> Platform=Android
> Done executing task "Message".
> Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('bin\Android\Debug\' != '' and !HasTrailingSlash('bin\Android\Debug\')).
> Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('bld\' != '' and !HasTrailingSlash('bld\')).
> Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('bld\Android\Debug\' != '' and !HasTrailingSlash('bld\Android\Debug\')).
>
>
>Done building target "_CheckForInvalidConfigurationAndPlatform" in project "projectname.jsproj".
>
>
>Target "_BeforeBeforeRebuild" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets" from project "C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\projectname.jsproj" (target "BeforeRebuild" depends on it):
> Set Property: _Rebuilding=true
>
>
>Done building target "_BeforeBeforeRebuild" in project "projectname.jsproj".
>
>
>Target "BeforeRebuild" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\projectname.jsproj" (target "Rebuild" depends on it):
>
>
>Done building target "BeforeRebuild" in project "projectname.jsproj".
>
>
>Target "BeforeClean" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets" from project "C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\projectname.jsproj" (target "Clean" depends on it):
> Using "CallTarget" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
> Task "CallTarget"
> Task Parameter:Targets=CleanCordovaDeploy
>
>
>Target "CleanCordovaDeploy" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets" from project "C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\projectname.jsproj" (target "BeforeClean" depends on it):
> Added Item(s): CordovaDeployDirs=C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin
> Using "RemoveDir" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
> Task "RemoveDir"
> Task Parameter:Directories=C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin
> Directory "C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin" doesn't exist. Skipping.
> Output Item(s):
> DeletedDirectories=
> C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin
> OriginalItemSpec=C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin
> Done executing task "RemoveDir".
> Task "MdaError" skipped, due to false condition; (@(CordovaDeployDirs) != @(DeletedDirectories)) was evaluated as (C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin != C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin).
>
>
>Done building target "CleanCordovaDeploy" in project "projectname.jsproj".
> Done executing task "CallTarget".
> Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
> Task "Exec"
> Task Parameter:StdErrEncoding=utf-8
> Task Parameter:StdOutEncoding=utf-8
> Task Parameter:Command=platforms\android\cordova\clean.bat
> platforms\android\cordova\clean.bat
> ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
> JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
> null
> org.xwalk:xwalk_core_library_beta:18+
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> A problem occurred configuring root project 'android'.
> > Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
> > Could not find any version that matches com.google.android.gms:play-services-ads:+.
> Searched in the following locations:
> https://repo1.maven.org/maven2/com/google/android/gms/play-services-ads/maven-metadata.xml
> https://repo1.maven.org/maven2/com/google/android/gms/play-services-ads/
> https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/google/android/gms/play-services-ads/maven-metadata.xml
> https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/google/android/gms/play-services-ads/
> file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-ads/maven-metadata.xml
> file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-ads/
> Required by:
> :android:unspecified
>
> * 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: 3.472 secs
> Picked up _JAVA_OPTIONS: -Xmx512M
>
>
>EXEC : error : cmd: Command failed with exit code 1
> at ChildProcess.whenDone (C:\Users\username\Documents\Visual Studio 2015\Projects\projectname\projectname\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
> at ChildProcess.emit (events.js:110:17)
> at maybeClose (child_process.js:1016:16)
> at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
>
>
>C:\Program Files
> (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets(349,5): error MSB3073: The command "platforms\android\cordova\clean.bat" exited with code 2.
> Done executing task "Exec" -- FAILED.
>
>
>Done building target "BeforeClean" in project "projectname.jsproj" -- FAILED.
>
>Build FAILED.
>
>Time Elapsed 00:00:05.66
>========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
【问题讨论】:
-
显然文档确实包含对 play-services-ads 的引用。从 SO 上的相关问题中找到它。我将更新我的 Android SDK,看看是否能解决构建问题。稍后将返回这里结果。 github.com/floatinghotpot/cordova-admob-pro/wiki/…
标签: android cordova visual-studio-2015 msbuild cordova-plugins