Closed chenop closed 4 years ago
What version of apkup
and Node are you using? Also, what shell?
Does it work if you use double quotes?
Thanks for checking this out. Updated versions in the question.
It does not work for double quotes well.
Okay. Try again but first run:
export DEBUG=apkup:*
Then paste the full output here. Make sure you redact any sensitive info, though.
/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/yargs.js:1132 throw err; ^
AssertionError [ERR_ASSERTION]: Unable to parse release notes
at Object.handler (/path/to/project/node_modules/apkup/dist/cli/upload.js:52:34)
at Object.runCommand (/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/command.js:196:48)
at Object.parseArgs [as _parseArgs] (/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/yargs.js:1053:51)
at Object.get [as argv] (/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/yargs.js:986:25)
at Object.
There are two strictEqual
checks on the release notes. One checks to make sure that there is an =
in the string and then the other splits the string on the =
and makes sure that there are two strings as a result. I can't tell which is failing because one check is on line 51 and the other is on line 53 whereas your error message says line 52.
But neither of them should fail and neither should having spaces or not be any different. I'm guessing that it isn't getting the string correctly.
Open node_modules/apkup/dist/cli/upload.js
and at about line 50 add a console.log
:
var change = _a[_i]; // right after this
console.log(change); // add this
Then run it again. I bet that it will be null
or undefined
.
Tl;Dr - was not apkup fault, I apologize for wasting your time and appreciate your support.
How do I use apkup?
I have a bash script that deploys my app to the play store.
It receive the following parameters:
./deployAndroidToPlayStore.sh -c [version code] -n [version name] -r [release notes]
Example:
./deployAndroidToPlayStore.sh -c 57 -n "1.20.3" -r 'Fixing Floating Button'
I use the first 2 parameters for building:
./gradlew bundleRelease -PversionCode=$c -PversionName=$n
and here is the wrong way of how I invoked apkup with the release notes:
apkup --key key.json --track beta --apk /path/to/app-release.aab --release-notes $r
It turns out its not the right way to do it inside a bash script, after trial and error I came to this:
cmd="apkup --key key.json --track beta --apk /path/to/app-release.aab --release-notes ${r}"
echo $cmd
eval $cmd
This way the release parameter are being passed fine to apkup. So in the end it was a bash issue - leaving this cause maybe it will help someone in the future. Your last comment helped me to debug it - Thanks!
Awesome, I'm glad you figured it out! I was starting to wonder if it was some sort of quote evaluation issue with bash. I've run into similar problems before... It can be quite difficult to debug.
apkup: v1.3.0 node: v13.13.0 shell: zsh
Trying use the following option
--release-notes 'en-US=Fixing Floating Button'
Got: " Unable to parse release notes"Trying:
--release-notes 'en-US=Fixing_Floating_Button'
Works!