Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: File 'android/app/build/outputs/bundle/stagingRelease/APP_NAME.aab' is a directory. when running in CI #161

Open
honeycombharris opened this issue Oct 10, 2023 · 1 comment
Assignees

Comments

@honeycombharris
Copy link

Hi,

I'm trying to integrate flashlight within a github actions workflow and when trying to run the CLI, I get the following error:
CleanShot 2023-10-10 at 17 26 04@2x

I'm quite stumped by this. here is what the github actions steps look like:

      - name: Sign Android release
        uses: r0adkll/sign-android-release@v1
        id: sign_app
        with:
          signingKeyBase64: ${{ secrets.APPCENTER_ANDROID_KEY_PAYLOAD }}
          alias: ${{ secrets.APPCENTER_ANDROID_KEY_ALIAS }}
          keyStorePassword: ${{ secrets.APPCENTER_ANDROID_KEYSTORE_PASSWORD }}
          keyPassword: ${{ secrets.APPCENTER_ANDROID_KEY_PASSWORD }}
          releaseDirectory: android/app/build/outputs/bundle/stagingRelease

      - name: Make artifact
        id: make_artifact
        uses: actions/upload-artifact@v3
        with:
          name: app-release-signed
          path: ${{steps.sign_app.outputs.signedReleaseFile}}

      - uses: actions/checkout@v3
      - name: Download artifact
        uses: actions/download-artifact@v3
        with:
          name: app-release-signed
          path: ${{steps.sign_app.outputs.signedReleaseFile}}

      - name: Install Flashlight CLI
        run: |
          curl https://get.flashlight.dev/ | bash
          echo "$HOME/.flashlight/bin" >> $GITHUB_PATH

      - name: Print signedReleaseFile path
        run: echo ${{steps.sign_app.outputs.signedReleaseFile}}

      - name: Run Flashlight CLI
        env:
          FLASHLIGHT_API_KEY: ${{ secrets.FLASHLIGHT_API_KEY }}
        run: |
          flashlight cloud --app ${{steps.sign_app.outputs.signedReleaseFile}} --test ./e2e/tests/chats/community-chat.e2e.yml --beforeAll ./e2e/tests/login/login.e2e.yml --apiKey $FLASHLIGHT_API_KEY

Why would the signed release path be considered a directory and not a file?

[BT:1.14.0*** Error: File 'android/app/build/outputs/bundle/stagingRelease/app-staging-release.aab' is a directory.
java.lang.IllegalArgumentException: File 'android/app/build/outputs/bundle/stagingRelease/app-staging-release.aab' is a directory.
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:[22](https://github.com/stanforddesi/eclipse-rn/actions/runs/6471517780/job/17570120942#step:17:22)0)
	at com.android.tools.build.bundletool.model.utils.files.FilePreconditions.checkFileExistsAndReadable(FilePreconditions.java:37)
	at com.android.tools.build.bundletool.commands.BuildApksCommand.validateInput(BuildApksCommand.java:942)
	at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:888)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:83)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:55)
unzip:  cannot find or open myapp.apks, myapp.apks.zip or myapp.apks.ZIP.
/snapshot/flashlight-cloud/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Command failed: 
              keytool -genkey -v -dname OU=flashlight -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 -storepass azerty -keypass azerty

              curl https://github.com/google/bundletool/releases/download/1.14.0/bundletool-all-1.14.0.jar -L -o bundletool.jar

              java -jar bundletool.jar build-apks --bundle=android/app/build/outputs/bundle/stagingRelease/app-staging-release.aab                 --output=myapp.apks                 --mode=universal                 --ks=my-release-key.keystore                 --ks-key-alias=alias_name                 --ks-pass=pass:azerty

              unzip myapp.apks -d apks
            
Generating 2,048 bit RSA key pair and self-signed certificate (SHA[25](https://github.com/stanforddesi/eclipse-rn/actions/runs/6471517780/job/17570120942#step:17:25)6withRSA) with a validity of 10,000 days
	for: OU=flashlight
@harrisrobin
Copy link

this issue was resolved by simply genearting an APK instead of .aab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants