solana-mobile / dapp-publishing

Apache License 2.0
59 stars 17 forks source link

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

Closed sdlaver closed 1 year ago

sdlaver commented 1 year ago

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.

ankur2136 commented 1 year ago

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/

sdlaver commented 1 year ago

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.

creativedrewy commented 1 year ago

Addressed in #206