0
votes

I've created a pipeline using codecommit->codebuild->codepipeline in order to build and test automatically my android app located on my github repository.

But at first stage after build step the pipeline returns this error:

enter image description here

I don't know the app location if it refers to .apk file because there is no .apk file into my repository.

Can anyone help me?

1
Hi @rubik90, you created a pipeline run that consists of: a source stage (codecommit) then a build stage (codebuild) and then another stage (which is the one failing). Is that correct? what's in that failing action? is that a custom script?marianogg9
Hi @marianogg9 I followed slavishly this aws tutorial docs.aws.amazon.com/codepipeline/latest/userguide/… You're right, the source stage is handled by codecommit (source github) and the build stage by codebuild. My problem is buildspec.yml. I notice that the next test stage needs a file (I think zip or apk file) but I am not able to check if the build step creates this file properly. I do believe that the last line of buildspec file is what I'm doing wrong, but can't find the solution on the web. Have you ever faced a similar job? Thank you.rubik90
This is the buildspec file I'm using version: 0.2 phases: install: runtime-versions: java: corretto11 pre_build: commands: - echo Nothing to do in the pre_build phase... build: commands: - java -version - bash ./gradlew assembleDebug post_build: commands: - echo Build completed on date artifacts: files: - '*/'rubik90
CodePipeline works with artifacts in zip format, have you tried zipping the apk file in the post_build step (within buildspec) and then add the path of that zip file to artifacts clause? it might be possible that apk file is not being left in a visible path by the build process: trust me, i've been there. A quick check would be adding a ls -ltr execution in the post_build clause so that you can see if the apk is actually in there. Hope that helps!marianogg9
the point is that running ls -ltr i can see no apk file, so i think that I'm wrong in buildspec setting, even if it's very trivial as you can see in my above reply. Very confused. further the app works properly on me phone so that it's to be excluded that I made coding errors. if I don't have an apk file as output how is it possible that the build phase is successful?rubik90

1 Answers

0
votes

You need an apk file in your input artifact to the 'Test' stage (AWS Device Farm action) and then specify the apk filename in 'App - optional' field while setting up the AWS Device Farm Test action in CodePipeline.