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

Building an android react native app on bitbucket pipeline

Ali Osman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 9, 2024

Hello, I am trying to build a react native application on the bitbucket pipeline then send it to the downloads section of the repo to be available for others, However I am facing an error I can't get around/understand why it happens

Here's my pipeline


image: node:lts

clone:
  depth: full

definitions:
  services:
    docker:
      memory: 2048
  steps:
    - step: &build-debug-apk
        name: Install Dependencies
        image: reactnativecommunity/react-native-android
        size: 2x
        script:
          - bash ./env-loader.sh
          - echo loaded all env variables
          - yarn install
          - yarn expo prebuild
          - ls
          - cd ./android
          - chmod +x gradlew
          - ./gradlew assembleDebug
          - curl -X POST "https://${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"./app/build/outputs/apk/debug/app-debug.apk"
   
pipelines:
  custom:
    release-test:
      - step:
          <<: *build-debug-apk
          name: build-debug-apk
          deployment: test
The error happens in the gradlew assembleDebug stage

* Where:
Script '/opt/atlassian/pipelines/agent/build/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 435
* What went wrong:
A problem occurred evaluating script.
> React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
[root:/opt/atlassian/pipelines/agent/build, reactNativePath:/opt/atlassian/pipelines/agent/build/node_modules/react-native, reactNativeVersion:0.73, dependencies:[:], commands:[], healthChecks:[], platforms:[:], project:[:]]

any ideas ?

1 answer

1 accepted

1 vote
Answer accepted
Ali Osman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 9, 2024

If this holds up anyone later down the line I found the answer to it,

 

I had these dependencies in my package.json

"resolutions": {

    "wrap-ansi": "9.0.0",
    "string-width": "7.0.0"
},
And I downgraded them to 

"resolutions": {
    "wrap-ansi": "7.0.0",
    "string-width": "4.1.0"
},
That solved the building issue on the pipelines

Suggest an answer

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

Atlassian Community Events