Closed leonardosalles closed 5 years ago
Are you trying to set client
to your own instance of the Google APIs client?
Can you add an example of what you are running?
I am trying to using publish method as showed in example, but it throws the error inside lib files.
Here is my code:
const { Apkup } = require('apkup'),
playstorePrivate = require('./playstore-private.json'),
co = require('co'),
prompt = require('co-prompt'),
confirm = prompt.confirm,
fs = require('fs');
co(function*(){
const releaseNotes = fs.readFileSync(__dirname + '/RELEASE-NOTES.md', 'utf-8');
console.log('---------- RELEASE NOTES ----------\n\n')
console.log(releaseNotes + '\n\n');
console.log('---------- END RELEASE NOTES ----------\n\n')
var ok = yield confirm('Está tudo correto? Confirma a publicação(y ou n)? ');
if (ok) {
const apkup = Apkup({
client_email: playstorePrivate.client_email,
private_key: playstorePrivate.private_key
});
console.log('Publicando...');
apkup.upload('./QueroQueroEcm.apk', {
releaseNotes: [
{
language: 'pt-BR',
text: releaseNotes
}
]
}).then(data => {
console.log(` > ${data.packageName} Versão ${data.versionCode} publicada!`);
}).finally(function() {
process.stdin.pause();
}).catch(function(err) {
console.log(err);
});
}
if (!ok) {
process.stdin.pause();
}
})();
@leonardosalles Aha, that took a while to find. You forgot the new
in front of Apkup
.
For example:
// correct
const apkup = new Apkup({})
// incorrect
const apkup = Apkup({})
Let me know if that solves your problem! 😃
Oh, I just noticed that the README shows the incorrect example.
Nice did bro! Thanks for the support, it is working fine now!
:tada: This issue has been resolved in version 1.3.0-beta.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This issue has been resolved in version 1.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
By some reason "this" is undefined in Apkup class and when this.client = new googleapis_1... is used it breaks and throw an error:
Cannot set property 'client' of undefined
Anyone is experiencing this issue too? I am using the latest version(1.2.0).