solana-mobile/dapp-publishing

Improved error handling when a bad SDK build tools path is provided

Closed this issue · 3 comments

Right now, this is an example of the errors produced when an invalid build tools path is specified:

$ npx dapp-store validate -k keypair.json -b ~/Library/Android/sdk/platform-tools/adb


   ┌───────────────────────────── Publishing Tools Version 0.4.0 ──────────────────────────────┐
   │                                                                                           │
   │   - Bug fixes, including enforcing `short_description` maximum length of 50 characters.   │
   │                                                                                           │
   └───────────────────────────────────────────────────────────────────────────────────────────┘

Publisher JSON valid!
App JSON valid!

   ┌─────────────────────────── Error ───────────────────────────┐
   │                                                             │
   │   Cannot read properties of undefined (reading 'version')   │
   │                                                             │
   └─────────────────────────────────────────────────────────────┘

We should first check if the tools we expect/need are present at this path.

Command line should ask for a path to sdk nothing deeper

should be ~/Library/Android/sdk/ instead of ~/Library/Android/sdk/build-tools/33.0.0/

In addition, the invocation of aapt2 does not escape the input paths, so if the directory containing the APK includes spaces, the invocation will fail with an error.

Addressed in #206