Android apk not being found anymore

#1

Suddenly apk generated files are not being found during a successful gradle-runner step (version: 1.5.3):

ApkFileIncludeFilter: app-stage-release.apk
ApkFileExcludeFilter: *-unaligned.apk
MappingFileIncludeFilter: */mapping.txt
MappingFileExcludeFilter: 
DeployDir: /bitrise/deploy

BUILD SUCCESSFUL

Total time: 1 mins 38.999 secs

Move apk files...
  find "." "-path" "app-stage-release.apk" "!" "-path" "*-unaligned.apk"
No apk matched the filters

Move mapping files...
  find "." "-path" "*/mapping.txt" "!" "-path" ""
  No mapping file matched the filters

Any idea what could be going wrong?

1 Like

#2

Hi @fmiralles,

Thanks for asking this question here!

Did you change your Gradle configs, related to the APK’s name? It seems that you did set a filter to only copy/deploy app-stage-release.apk, but this Gradle step no longer generates an APK with that file name.

If you want to copy/deploy a single APK, you have to specify the APK’s file name in the Gradle Runner step’s APK file include filter input/option (the APK’s file name which will be generated by the gradle task you specified for the Gradle Runner step).

If you want to copy/deploy all generated APK files, you can use a wildcard filter like: *.apk

Let us know if you’d have any questions!

0 Likes

#3

It’s already specified. Check the pre-formatted attached lines…

0 Likes

#4

That’s exactly what I meant, that you specified a filter app-stage-release.apk, but your Gradle task does not generate an APK with that file name (app-stage-release.apk).

You should check what’s the generated APK’s file name is, and set that as the include filter.

0 Likes

#5

Checking btirise logs looks it’s the right name: /bitrise/src/app/build/outputs/apk/app-stage-release.apk
I did also check locally and it’s indeed the file being generated: app-stage-release.apk

0 Likes

#6

Ohh, it might actually be related to the latest Gradle Runner version’s change: https://github.com/bitrise-io/steps-gradle-runner/releases/tag/1.5.3

Can you please try it with v1.5.2 of the Gradle Runner step?

0 Likes

#7

OK, we found the issue and it’s indeed related to the new Gradle Runner step version. Fortunately the issue is really simple to fix: just add a * prefix to the filter.

E.g. instead of:

app-stage-release.apk

use:

*app-stage-release.apk

or

*/app-stage-release.apk

Basically the change was that the filter is no longer applied on the file name, but instead on the path, so if you specify an exact value without * then the full path have to match that. The advantage of the new filter method is that you can now filter by the path too, and not just by the apk’s name. E.g. previously this wasn’t possible: */apk/release/*.apk but now it is!

0 Likes

File already exists error
#8

As you said it does works on Gradle v1.5.2.

Understood…

Thanks Viktor!

1 Like

#9

We published a #changelog for this - you can find more info about how you can use v1.5.3

TL;DR; you just have to prefix the file name with * or */, as I mentioned above.

0 Likes