Unable to use CLI Fastlane supply action with metadata for Android - android

I would like to use CLI Fastlane supply action to push an app-bundle to Play Store. Along side with other required options, i put a metadata path to declare release note so that it can be shown on the Play Store.
But it can't be executed instead it shows errors. Here's some tried CLI commands:
fastlane run supply aab:(path to aab) track:internal json_key:(path to json key) metadata_path:"path/to/metadata" package_name:(package name)
fastlane run supply aab:(path to aab) track:internal json_key:(path to json key) metadata_path:"path/to/metadata/android" package_name:(package name)
And this is how the metadata folder's described:
Finally, the error:
[11:06:54]: Preparing aab at path '/app-release.aab' for upload...
[11:07:19]: Updating track 'internal'...
[11:07:21]: Preparing to upload for language 'android'...
Looking for related GitHub issues on fastlane/fastlane...
➡️ http_command.rb:228:in `check_status': \e[31m[!] Invalid request\e[0m (Google::Apis::ClientError)
https://github.com/fastlane/fastlane/issues/18895 [open] 7 💬
2 days ago
➡️ Supply: Error 404 (Not Found) Google Api Error: Invalid request
https://github.com/fastlane/fastlane/issues/18896 [closed] 4 💬
16 Jun 2021
➡️ Swift: `scheme` value in Scanfile is ignored
https://github.com/fastlane/fastlane/issues/19196 [open] 1 💬
a week ago
and 424 more at: https://github.com/fastlane/fastlane/search?q=Invalid%20request&type=Issues&utf8=✓

Related

amplify init fails constantly

I don't know whats really wrong with my amplify. I run amplify init and get this error message. I have downloaded my amplify cli using npm and have successfully run 'amplify configure'.
init failed
InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/apps
host:amplify.ap-south-1.amazonaws.com
x-amz-content-sha256:79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29
x-amz-date:20210121T154050Z
host;x-amz-content-sha256;x-amz-date
79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210121T154050Z
20210121/ap-south-1/amplify/aws4_request
b150344845c2c575fd957d63172173a367f2bacf0e817764a02e5b20d03c3811'
Okay, so I finally found out what was bugging me for last three days. A whitespace ( ).
Yes!
I had my folder inside the user with a whitespace in it, as in "First Last". Instead what I should have done is changed my folder name inside my C:\Users\First Last to C:\Users\FirstLast before starting, and then try to install my amplify CLI using the command curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd and proceed as mentioned in the documentation here.
To change the name of the User folder in windows 10, I watched this great YT! video
On Mac:
I was also getting the same error while using the aws amplify CLI tool in my nodejs project.
Like #miraquee noted above about the issue being a white space. I suspected that I also had the same issue. What I did to start clean was:
Delete the local .aws folder in my home folder on mac to start clean
rm -rf ~/.aws/
Ran amplify init again. This time when reaching the step where it asks you to create an IAM user, which subsequently takes opens your web browser to finish the creation of the new IAM user, I was very careful about copying in the Access Key Id and Secret Access Key
This time when I went through the flow in the CLI it worked.
If you want to see a video of these steps, checkout this YouTube video built by one of the engineers on the AWS amplify team
Youtube video link: https://www.youtube.com/watch?v=fWbM5DLh25U

Release android application via azure pipeline

I create release pipeline on Azure DevOps and try publish android application in play google.
Now I use Google Play extension and when I start the process an error occurs
2020-09-09T03:43:27.0917248Z ##[section]Запускается: Release app.apk
2020-09-09T03:43:27.8780592Z ==============================================================================
2020-09-09T03:43:27.8781175Z Task : Google Play - Release Bundle
2020-09-09T03:43:27.8781808Z Description : Release an app bundle to the Google Play Store
2020-09-09T03:43:27.8782024Z Version : 3.174.0
2020-09-09T03:43:27.8782441Z Author : Microsoft Corporation
2020-09-09T03:43:27.8782859Z Help :
2020-09-09T03:43:27.8783075Z ==============================================================================
2020-09-09T03:43:35.1490887Z Found main bundle to upload: .../app.apk (version code %s)
2020-09-09T03:43:35.1776730Z (node:7588) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-09-09T03:43:56.1999306Z ##[error]FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect ETIMEDOUT 108.177.14.95:443
2020-09-09T03:43:56.2066653Z ##[section]Завершается: Release app.apk
My VSTS agent is installed on the windows server behind the proxy server. On proxy server have a white list with google address *.googleapis.com
Agent configuration
.\config.cmd --proxyurl http://... --proxyusername ... --proxypassword ... --url https://... --auth integrated --pool ... --agent vsts-agent-win-x64-2.169.1 --runAsService --windowsLogonAccount ... --windowsLogonPassword ...
And YAML configuration release step from pipeline
steps:
- task: ms-vsclient.google-play.google-play-release-bundle.GooglePlayReleaseBundle#3
displayName: 'Release app.apk'
inputs:
authType: JsonFile
serviceAccountKey: '....json'
applicationId: ...
bundleFile: '$(System.DefaultWorkingDirectory)/.../app.apk'
track: alpha
changeLogFile: '$(System.DefaultWorkingDirectory)/.../app.apk'
I thing this extension not work with proxy.
How fix this error?
To solve the problem with unloading we had to create additional environment variables
http_proxy=...
https_proxy=...
My proxy replaces the certificates with its own, so initially the system does not trust the CA of my organization, it was decided to ignore the validity of the certificate.
I created one more environment variable
NODE_TLS_REJECT_UNAUTHORIZED=0
and made adjustments to the npm setting
npm config set strict-ssl false
After that it was possible to connect to a google server and publish the application.

Flutter with FirebaseAppDistribution ignore "--target"

Updated (07 Nov 2019)
I've tried the following command and it works as expected
Assume that flavor=Staging and build=Release, Build_Variant=StagingRelease.
And based on Flutter entry point file (--target)=lib/main_stg.dart
./gradlew appDistributionUploadStagingRelease --project-prop target=lib/main_stg.dart
It seems like appDistributionUploadStagingRelease re-build apk even though assembleStagingRelease is not added in the command.
Issue
I've a project which contain the following flavors and targets
Flavors
- Dev
- Staging
- Production
Targets (<project_root/lib>)
- main_dev.dart (development)
- main_stg.dart (staging)
- main.dart (production)
I've been using this command
flutter build --release --target staging --t lib/main_stg.dart for building Staging.
However, when executing FirebaseAppDistribution using ./gradlew appDistributionStagingRelease, the uploaded APK ignore lib/main_stg.dart and use lib/main.dart.
Further check on the log indicate that it does not rebuild
> Task :app:appDistributionUploadStagingRelease
Found APK at <project_root>/build/app/outputs/apk/staging/release/app-staging-release.apk.
Uploading APK to Firebase App Distribution...
Getting appId from output of google services plugin
This APK has not been uploaded before.
Uploading the APK.
Uploaded APK successfully 202
No release notes passed in. Skipping this step.
Added testers/groups successfully 200
App Distribution upload finished successfully!
Does any Flutter dev encounter similar issue? Kindly guide me for this.
Thank You

package conflicts with an existing package by the same name

I have a problem where the upgrade to my apk will not install due to the above message.
I have read posts on SO that say this message happens when the app is signed with a different release key.
example post on different keys
.
In my logs as i try to upgrade the apk i get the following:
04-07 13:28:03.796 2072-2072/? W/InstallAppProgress: Replacing package:com.xxx.rr3
04-07 13:28:04.326 3675-3845/? W/PackageManager: verifying app can be installed or not
04-07 13:28:04.378 3675-3845/? W/PackageManager: Package com.xxx.rr3 signatures do not match the previously installed version; ignoring!
.
The orginal app was has been in production for over 4 years and was written using Eclipse, which is installed on my old hard drive.
6 months ago my boss bought me an SSD drive and i installed Android Studio. I migrated the old project and it builds fine and it will install on to a device that doesn't have the previous version installed.
I copied the keystore from my old hard drive to my new SSD and I use it to sign the new version of the app in Android Studio. So i have only ever used the one same keystore, with the same passwords and alias.
Can anyone tell me why Android is saying my upgrade is signed with a different key?
[UPDATE1]
I have extracted the CERT.RSA for both old and new apk. They both use the same keystore and keys but i noticed i was using the wrong release alias. Below is the fingerprints for both apks the top one is the old one the bottom, the new one.
C:\OpenSSL-Win64\bin>keytool -printcert -file CERT.RSA
Owner: CN=matthew womersley, OU=dev, O=carefreegroup, L=wakefield, ST=west yorkshire
Issuer: CN=matthew womersley, OU=dev, O=carefreegroup, L=wakefield, ST=west yorkshire
Serial number: 6144ad2c
Valid from: Fri Jan 11 08:55:29 GMT 2013 until: Thu May 14 09:55:29 BST 3012
Certificate fingerprints:
MD5: 50:63:5E:54:9D:D3:C4:71:A9:4E:3C:F4:27:9E:50:CA
SHA1: 7C:2C:DB:7E:92:D2:01:46:43:8D:D2:B9:A4:D2:B0:F4:85:E7:16:D9
SHA256: 38:64:89:4D:A2:37:72:AA:CE:90:5E:34:46:B9:D0:A4:CA:18:B7:07:7A:E2:DB:1D:7C:60:CD:70:F6:77:C5:FF
Signature algorithm name: SHA256withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 3F 95 E8 FA 36 5B 26 07 33 72 8B 09 37 0C 18 C5 ?...6[&.3r..7...
0010: 3B 5A 19 42 ;Z.B
]
]
C:\OpenSSL-Win64\bin>keytool -list -keystore .keystore
keytool error: java.lang.Exception: Keystore file does not exist: .keystore
C:\OpenSSL-Win64\bin>keytool -printcert -file CERT.RSA
Owner: CN=matthew womersley, OU=dev, O=carefreegroup, L=wakefield, ST=west yorkshire
Issuer: CN=matthew womersley, OU=dev, O=carefreegroup, L=wakefield, ST=west yorkshire
Serial number: 6144ad2c
Valid from: Fri Jan 11 08:55:29 GMT 2013 until: Thu May 14 09:55:29 BST 3012
Certificate fingerprints:
MD5: 50:63:5E:54:9D:D3:C4:71:A9:4E:3C:F4:27:9E:50:CA
SHA1: 7C:2C:DB:7E:92:D2:01:46:43:8D:D2:B9:A4:D2:B0:F4:85:E7:16:D9
SHA256: 38:64:89:4D:A2:37:72:AA:CE:90:5E:34:46:B9:D0:A4:CA:18:B7:07:7A:E2:DB:1D:7C:60:CD:70:F6:77:C5:FF
Signature algorithm name: SHA256withRSA
Version: 3
I specified the correct releasealias when clicking on 'Generate Signed Apk' but there is still an error albeit different.
The package conflicts with an existing package by the same name
.
I have tried to build the new apk manually, using the following link:
link
C:\Users\mattheww\StudioProjects\nfcscanner3>gradlew assembleRelease
Downloading https://services.gradle.org/distributions/gradle-2.14.1-all.zip
Unzipping C:\Users\mattheww\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv\gradle-2.14.1-all.zip to C:\Users\mattheww\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\mattheww\StudioProjects\nfcscanner3\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 29.982 secs
.
If the keystore and fingerprints match on both apps, can anyone explain why the new app still will not upgrade?
[UPDATE 2]
I have just remembered that when i imported the Eclipse project into Android Studio, it would not build correctly. There was a problem with the Appication Object. My Appication Object is called NfcScannerApplication and i have a class implemented by the same name (which is also described in the manifest).
Once imported into Android Studio, built and pushed on to a device, Android said it could not find the Application class. so i used the following code which seemed to solve the problem.
public static NfcScannerApplication getRealApplication (Context applicationContext)
{
Log.e(TAG, "inside NfcScannerApplication getRealApplication");
NfcScannerApplication application = null;
if (applicationContext instanceof NfcScannerApplication)
{
application = (NfcScannerApplication) applicationContext;
}
else
{
Application realApplication = null;
Field magicField = null;
try
{
magicField = applicationContext.getClass().getDeclaredField("realApplication");
magicField.setAccessible(true);
realApplication = (Application) magicField.get(applicationContext);
}
catch (NoSuchFieldException e)
{
Log.e(TAG, e.getMessage());
}
catch (IllegalAccessException e)
{
Log.e(TAG, e.getMessage());
}
application = (NfcScannerApplication) realApplication;
}
return application;
}
// the above method is commented out and this is used
//because the migration process from Eclipse to Android
//needed it. see below
//https://stackoverflow.com/questions/36495954/bootstrapapplication-cannot-be-cast-to-applicationclass
It uses reflection to get the Application class. Could this be the reason why even though i'm using the same keystore etc, Android thinks there is a different app on the device with the same name?
[UPDATE 3]
I seem to have found the problem. :) I have a ContentProvider that gets the Application Context when the app is first loaded. I call getContext and cast it into my Application class.
What i do now is call getContext.getApplicationContext() and it works fine now. Below is the code i use now and the old code iscommented out above.
//old code
//Context context = getContext();
//nfcAppObj = (NfcScannerApplication) getContext();
//new code
Context applicationContext = getContext().getApplicationContext();
nfcAppObj = getRealApplication(applicationContext);
If you have the old apk you can use this to get the details of the cert used to sign it. (Extract the CERT.RSA file from the apk -unziping it-, then running the openssl aplication on that file.)
unzip -p App.apk META-INF/CERT.RSA |openssl pkcs7 -inform DER -noout -print_certs -text
Then use keytool (that comes with java) to list the certificates from your key store, and see if you find a match, or if the certificate you think is the correct really matches.
For your reference:
Getting certificate details from an apk
How do I find out which keystore was used to sign an app?
Publish your signed apk to the play store in beta or alpha section if the play store refuse your apk that's mean your keystore is not the original key.
If play store accepted your apk then try to update your installed apk from play store.
If your app not listed on play store you can pull your previous apk from the device and compare both APKs signature SHA1
to get SHA1 of the apk
How do I find out which keystore was used to sign an app?
Unless you do something special, when you click the "Play" button in Android Studio it will use a temporary, AS specific debug key to sign the app and then it will install it to your device.
Eclipse did something very similar.
If you're talking about using Android Studios "Generate Signed APK" then try the following debug steps:
Install the apk through adb manually, see if the error still occurs.
Sign the apk yourself through gradle, see if the error still occurs.
If both of these steps don't work, I think it's reasonably safe to assume you're not using the same key you were previously.

CodePush - Releasing an iOS bundle breaks Android and vice versa

Using react-native-code-push.
Whenever I release an iOS version (using code-push release-react ... ios), it breaks my Android code push. Next time I try to get an update I get the following error:
You attempted to set the key isPending with the value true on an
object that is meant to be immutable and has been frozen.
Then, if I release an Android version, it breaks my iOS, getting this error:
Update is invalid - A JS bundle file named "main.jsbundle" could not
be found within the downloaded contents. Please ensure that your app
is syncing with the correct deployment and that you are releasing your
CodePush updates using the exact same JS bundle file name that was
shipped with your app's binary.
It's very strange and the documentation doesn't say anything about collisions between the two platforms.
You need to setup an app for each platform
code-push app add [name]-ios
code-push app add [name]-android
i think the code-push release-react [app-name] [platform] ... the platform argument only tells the react-native bundler what entry file to use (index.ios.js or index.android.js) it doesnt work as "install only on ios"

Categories

Resources