r0adkll / sign-android-release

A GitHub action to sign an APK or AAB
MIT License
360 stars 135 forks source link

Path argument must be string #48

Open xcarlitos opened 3 years ago

xcarlitos commented 3 years ago

When I try to run this GitHub-Action I get following Error/Logs:

Run r0adkll/sign-android-release@v1
Preparing to sign key @ app/build/outputs/apk/release with signing key
Error: The "path" argument must be of type string. Received type undefined

What is the point here? My workflow is configured like that:

- name: Checkout Repo
         uses: actions/checkout@v2
         with:
           fetch-depth: 0
- name: Generate Release APK
         run: ./gradlew assembleRelease
- name: Sign APK
         uses: r0adkll/sign-android-release@v1
         # ID used to access action output
         id: sign_app
         with:
           releaseDirectory: app/build/outputs/apk/release
           signingKeyBase64: ${{ secrets.SIGNING_KEY }}
           alias: ${{ secrets.SIGNING_ALIAS }}
           keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
           keyPassword: ${{ secrets.KEY_PASSWORD }}
MY23 commented 3 years ago

Hey guys, i have the same problem but i only encounter this issue when I try to run the workflow on a self-hosted node. can anyone help ?

rafal1137 commented 3 years ago

I having same issue with it but I am not using self-hosted node.

cirion commented 3 years ago

I ran into this too. My action was working fine, then I moved to another self-hosted runner without any code changes and started seeing the following error:

Run r0adkll/sign-android-release@v1
Preparing to sign key @ app/build/outputs/apk/release with signing key
Found 1 release files.
Error: The "path" argument must be of type string. Received type undefined

After some digging, the problem turned out to be that I didn't have the environment variable ANDROID_HOME globally defined on my new runner. I then defined it in my .yml file and set it to the right path (in my case /usr/local/share/android-sdk) and it started working again.

MY23 commented 2 years ago

Hey guys, I have the same problem but i only encounter this issue when I try to run the workflow on a self-hosted node. can anyone help?

I fixed my problem using env variables adding ANDROID_HOME like this :

 - name: Sign APK with keystore
        uses: r0adkll/sign-android-release@v1
        id: sign_app
        with:
          releaseDirectory: app/build/outputs/apk/dev/release
          signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE64 }}
          alias: ${{ secrets.ALIAS }}
          keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
          keyPassword: ${{ secrets.KEY_PASSWORD }}
        env:
          ANDROID_HOME: $HOME/Android/Sdk
filippoLeporati93 commented 6 months ago

Hi @MY23 @cirion @rafal1137 @xcarlitos I have created a new repo trying to maintain the project, based on this solution.

My solution is based on Node.js 20.9 and I solved also this issue. Now it raises an error if ANDROID_HOME is missing, I remove the non-null assertion operator and checking if null.

https://github.com/filippoLeporati93/android-release-signer