Search code examples
androidazuregradlemobile-centervisual-studio-app-center

Fix "Error: Publish build artifacts failed with error: Not found PathtoPublish" on VS Mobile Center


When trying to build an Android project with Mobile Center Im getting this error during the Publish Build phase:

2017-06-13T22:17:25.1335750Z ##[section]Starting: Publish build
2017-06-13T22:17:25.1445350Z ==============================================================================
2017-06-13T22:17:25.1462330Z Task         : Publish Build Artifacts
2017-06-13T22:17:25.1477300Z Description  : Publish Build artifacts to the server or a file share
2017-06-13T22:17:25.1492900Z Version      : 1.0.42
2017-06-13T22:17:25.1507730Z Author       : Microsoft Corporation
2017-06-13T22:17:25.1522710Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
2017-06-13T22:17:25.1539050Z ==============================================================================
2017-06-13T22:17:25.7478050Z ##[error]Publish build artifacts failed with error: Not found PathtoPublish: /Users/ci/agent/vstsagent/_work/1/a/build
2017-06-13T22:17:25.7559290Z ##[section]Finishing: Publish build

I start to get this error after migrating my prject to Android Studio 3.0 with:

  • buildToolsVersion 26
  • gradle-4.0-milestone-1-all

Obs.: There's actually an answer to this question, but it covers just iOS builds.


Solution

  • This is Mat from the Mobile Center Android Build team. There currently is no official support for the Android Development Tools Developer Previews (including Android Studio 3.0 and more notably the Android Gradle Plugin 3.0 which is currently in alpha) as their APIs are not guaranteed to be stable.

    In this particular case, it looks like with the Developer Preview versions of the Android Developer Tools, the resulting APKs are put in a different location than in the latest stable releases, causing the Mobile Center Build pipeline to not pick them up. We are closely watching this and will have support for the latest Android Developer Tools - when they are officially released.

    Please note, that this answer is only true at this moment and will change with further development releases of the Android Development Tools and as we adapt for these changes in Mobile Center.