Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,093
Community Members
 
Community Events
184
Community Groups

Pipeline failed to upload APK in Microsoft App center tester group

Edited

Hi All, I am running a pipeline to upload files to the app center tester group. I follow the steps using bitbucket docs to generate a file bitbucket-pipeline. YAML file my issue is every time I try to upload a file to the Microsoft app center through Node script it failed a  pipeline and throws the error No Such file or directory open package.json error picture also attach

pipeline_3.png

my complete bitbucket-pipeline.YAML file is this 

image: androidsdk/android-30

pipelines:
default:
- parallel:
- step:
name: Android Debug Application
caches:
- gradle
script:
- ./gradlew assembleDebug
artifacts:
- app/build/outputs/**
# - step:
# name: Lint
# caches:
# - gradle
# script:
# - ./gradlew lint
# artifacts:
# - app/build/reports/**
# - step:
# name: Debug Unit Test
# caches:
# - gradle
# script:
# - ./gradlew testDebugUnitTest
- step:
name: Installing node.js and npm appcenter-cli
image: node:12.22.9
script:
- npm install
- npm cache verify
- npm install -g appcenter-cli
- appcenter distribute release --group Collaborators --file "/app/build/outputs/apk/debug/app-debug.apk" --release-notes 'release' --app m.wahab-nextgeni.com/CICD --token "value_removed" --quiet

Can anyone help me with this issue I will be very thankful to you because I am stuck on this issue? I am using an android project with this pipeline and wanted to share the build with the testers group in the Microsoft app center

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 27, 2022

Hi @Abdull Wahab,

I noticed the following two things in your yml file:

 

1st. The path in the --file argument in your last command:

The command in the bitbucket-pipelines.yml file you posted here has as --file the following path:

/app/build/outputs/apk/debug/app-debug.apk

In the screenshot you posted above, the path is different

app/build/outputs/apk/debug/app-debug.apk

The first one will look for a directory named app in the root of the container, while the second one will look for the directory app in the clone directory.

Are you generating this file during the first step named "Android Debug Application"?

If so, is it generated in the path that you defined as an artifact in that first step, app/build/outputs/** ?

If so, you will need to use --file "app/build/outputs/apk/debug/app-debug.apk" without the slash in the beginning so that the file can be found.

 

2nd. I noticed the keyword parallel in your bitbucket-pipelines.yml file.

Do the first and the last step run in parallel?

If they do, and if the app-debug.apk file gets generated during the first step, it will not be available in the second step, because they are parallel. Parallel steps can only use artifacts produced by previous steps, not by steps in the same parallel set.

If the apk file gets generated during the first step, and the two steps are parallel, you will need to remove the parallel keyword so that the steps will no longer be parallel and the file will be available for the second step.


Also, just a heads up, I removed the value of the token from your post for security reasons (not sure if you posted the actual token or if you replaced the value with something else, but I removed it just in case).

Kind regards,
Theodora

Thanks @Theodora Boudale  for detail answer i will change the pipeline with your suggestions and then back to you thanks for help again really appreciate 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 28, 2022

Hi @Abdull Wahab,

You are very welcome! I will wait to hear your update then.

In case you still get errors, please let us know:

1) What is the content of the bitbucket-pipelines.yml now (please mask any secrets)

2) If the apk file is indeed generated during the first step

3) Copy-paste any errors from the Pipelines build log (please sanitize sensitive/private info, if any, prior to sharing)

Kind regards,
Theodora

Hi @Theodora Boudale ,

Hope you are doing great I made the changes you suggest in bitbucket-pipelines.yml but it still gives an error but this time new one. I also attach the content of  bitbucket-pipelines.yml, APK file is generated in the artifact section of the pipeline screen short also attach as evidence, Also attach the complete error of this step pipeline.

Here is the Complete bitbucket-pipelines.yml file

image: cimg/android:2022.09-node
pipelines:
default:
- step:
name: Android Debug Application
caches:
- gradle
script:
- ./gradlew assembleDebug
artifacts:
- app/build/outputs/**
- step:
name: Installing node.js and npm appcenter-cli
image: node:12.22.9
script:
- npm install
- npm cache verify
- npm install -g appcenter-cli
- appcenter distribute release --group Collaborators --file "app/build/outputs/apk/debug/app-debug.apk" --release-notes 'release' --app m.wahab-nextgeni.com/CICD --token "*********daa5220b4" --quiet

 

Here is the Artifact file directory in Android Debug Application Step

artificat.png

 

Here is the Error log screenshot and text

complete_error_bitbucket.png

npm ERR! code ENOLOCAL npm ERR! Could not install "app/build/outputs/apk/debug/app-debug.apk" as it is not a directory and is not a file with a name ending in .tgz.tar.gz or.tar
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 03, 2022

Hi @Abdull Wahab,

Thank you for the info.

Your latest build shows that the command expects either a directory or a file with a name ending in .tgz, .tar.gz or .tar

I am not familiar with Microsoft App center or appcenter-cli so I am unsure if you need to provide a different argument or if you simply need to provide a .tgz, .tar.gz or .tar file and what its contents should be.

I would suggest reaching out to the developers of appcenter-cli here: https://github.com/microsoft/appcenter-cli/issues?q=is%3Aissue+ with details about the issue and asking for more info regarding the configuration you need to make.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events