Flutter with FirebaseAppDistribution ignore "--target" - android

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

Related

Fastlane appcenter upload not working, App not found

on a project I setup with fastlane a lane to build an android app and publish it on appcenter.
Here a snippet of the lane, where, for the sake of simplicity, I surround by curly brackets protected data:
lane :buildAndDeploy do
gradle(task: "clean assembleRelease")
appcenter_upload(
app_name: "{myappname}",
api_token: "{token}",
owner_name: "{ownername}",
owner_type: "user",
file: "{filePath}"
)
Everything worked like a charm till two weeks ago, when suddently it stops working. When the lane cruise to the appcenter upload step I receive this from the plugin.
------------------------------
--- Step: appcenter_upload ---
------------------------------
App with name {appname} not found, create one? (y/n)
as indicated in the documentation the app name and owner name are populated like this:
https://appcenter.ms/users/{ownername}/apps/{appname}
Any idea of what could have happened in the past two weeks? I didn't change anything both on the Fastfile and the Appcenter project.
Finally I discover where was the issue.
Running this command with appcenter cli
appcenter apps list --token <MY_TOKEN> --debug
I found out that the token I was using didn't belong to the owner of the project, instead it belonged to a different user who has been removed from the project.
Adding a new API token resolved the issue.

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.

Android - Cordova version code issue

This is quite a weird one.
Basically, I decided to switch from using trigger.io to using cordova to build and compile my app (using ionic framework).
Everything is fine if I build an unsigned and unaligned app, but for production I have to sign and align the apk in order to upload it on the play store.
I have signed and aligned the apk properly, but when I tried to upload the apk, I got this error:
Your APK version code needs to be greater than 1457108319
Now, I read a couple of answers here on stack overflow saying that I just need to add this line in my project config.xml file:
<widget id="com.***********" android-versionCode="1457108319" version="5.0.0"
but the problem is that if I had this line of code, then gradle fails and I get this error:
Error: Error code 1 for command: cmd with args:
/s,/c,"c:\src\app-v5\platforms\android\gradlew cdvBuildRelease -b
c:\src\app-v5\platforms\android\build.gradle -Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"
Hovewer, if I change the versionCode to a 6 digit code instead of 10, I get no error, but again, I can't upload it to the store because the versionCode number is less than the app already released.
How can I solve this? I really have no idea what to do.
Thanks a lot
I actually resolved this. I had to add to my config.xml file the following (in <widget>, right after version):
android-versionCode="{this needs to be replaced, in my case, by the
current timestamp "
The downside is that I have to remember to put the new timestamp everytime for now.
I will, at some point, write some kind of script to do this for me.
Hope this helps someone
I had the same problem since updating to latest Cordova CLI (6.3.1) and latest android platform for cordova (5.2.2).
My old build had the following:
versionCode: 69000
from the config.xml file:
My new buid:
versionCode: 7000
from the config.xml file:
so when I upload the signed APK to the PlayStore I get the same error you had:
the problem is that 7000 is < to 69000
The issue comes from the gradle script (in platforms/android/build.gradle) which from what I understand generates the versionCode from what he finds in your config.xml.
Looks like it is missing some multiplication by 100 somewhere:
so far here is what can be done:
1: instead of using 0.70 as version number use 0.700
2: specify the versionCode in the config.xml file :
it worked for me in both cases.
Hope it helps.

updating sencha touch 2 android app

I am trying to submit a update to the google play store for my sencha touch 2 app.
the following is my packager.json file.
{
"applicationName":"DBS",
"applicationId":"com.keshav.dbs",
"versionCode":"2",
"versionString":"1.0.1",
"iconName":"ic_launcher.png",
"inputPath":"./build/package/Android",
"outputPath":"./build/native/Android",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"/Developer/Android-Keystore/myAndroidKeyStore",
"certificateAlias":"myandroidkey",
"certificatePassword":"<password>",
"sdkPath":"/Developer/sdks/android-sdk-macosx",
"androidAPILevel":"16",
"orientations": [
"portrait"
]
}
I run the following command
sencha package run packager.json
this creates the apk file however when i try to upload the new apk i get a message saying the versonCode 1 is already in use.
The instruction of packaging on Senchas website dont include the "versionCode" property I added that my self
Does anyone know how to change the version code for sencha app?
I was able to edit platforms/cordova/android/AndroidManifest.xml and update the android:versionCode, then run sencha app build native
It built the new APK (signed, based on my config) and it was accepted by the Google Play store.
Much easier than un-packaging and repackaging.
well here it is ...
After looking around the internet i found this approach works....
After Sencah creates the package use apktool to un-package the apk then edit the AndroidManifest.xml and package it up again with apktool.
Note when you re-package the app tit will be unsigned so you will have to sign it again for it install on peoples devices

android ant build: debug and release targets

According to the 'help' target documentation:
debug: builds the applications and
signs it with a debug key
release; builds the application: the
generated APK file must be signed
before it is published
Here is what I found, which is a bit different than what I expected:
debug: ignores keystore definitions in build.properties whether you specify them or not. Which kesystore file is it using? The same as Eclipse: the default debug.keystore file in your Documents and Settings?
It creates two files:
-debug-unaligned.apk (signed, unaligned)
-debug.apk (signed, aligned)
release: 'help' says it doesn't sign it. It creates these files:
-unsigned.apk (unsigned, unaligned)
The next two are only if you have the values specified in build.properties:
-unaligned.apk (signed, unaligned)
-release.apk (signed, aligned)
Any helpful comments / verifications will be greatly appreciated.
Which kesystore file is it using? The same as Eclipse: the default debug.keystore file in your Documents and Settings?
Yes.
As far as the release target goes, you will get behaviour like this:
If you have lines like:
key.store=c:/users/me/my-release-key.keystore
key.alias=release_alias
key.store.password=myStorePassword
key.alias.password=myAliasPassword
in your build.properties, it will automatically build and sign your apk with no prompting for anything.
If you comment out the last two lines, then it will prompt you for the passwords, then complete a signed build if the passwords are OK.
If you don't have any of the above lines, then it will just build you an unsigned apk with no prompting for anything and end with:
-release-nosign:
[echo] No key.store and key.alias properties found in build.properties.
[echo] Please sign C:\dev\projects\AntBuilds\MyProject\bin\MyProject-unsigned.apk manually
[echo] and run zipalign from the Android SDK tools.
.
This answer works for me, I am using ant to auto-compile android app, it prompts and need password, I wrote one file named password, and using the command ---ant release < passwd,
However, it also prompts that I need input password.
Using the tips here
key.store=c:/users/me/my-release-key.keystore
key.alias=release_alias
key.store.password=myStorePassword
key.alias.password=myAliasPassword
I solved this problem.

Categories

Resources