VS 2015 Cordova / Admob-Pro构建错误

时间:2016-05-24 20:32:17

标签: android cordova visual-studio-2015 msbuild cordova-plugins

我已经在这个问题上挣扎了太多时间。在我的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 ==========

1 个答案:

答案 0 :(得分:1)

是的,插件所需的SDK有几个项目尚未经过选中和安装检查。详细信息可以在插件wiki的链接中找到:

https://github.com/floatinghotpot/cordova-admob-pro/wiki/Difference-of-Plugin-IDs

更新SDK安装后,清理VS Cordova缓存,重新启动并重建,一切都很顺利。