Firebase Test Lab asks to upload two APKs:
App APK
Test APK
How to build test APK?
Run:
./gradlew assembleDebugAndroidTest
The Test APK will be built in:
app/build/outputs/apk/androidTest/<flavor>/debug/app-<flavor>-debug-androidTest.apk
Related
I would like to create a build pipeline of my Angular application.
In this one I want to do 5 jobs:
1- import the sources
2- install npm
3- build the application with npm build
4- Create an archive
5- And publish it in a folder.
but the task hangs at the npm install.
Can you explain the error?
This is the debug.log
How to generate gradlew file to Jenkins Android Project? My project is not Android Native. My project is Flutter.
I try to create CD with Jenkins and I got some errors.
this is my pipeline code (JenkinsFile)
stage('Build Release APK') {
sh "ls ./android"
sh "./android/gradlew clean assembleRelease"
}
ls output is,(There is not gradlew file)
ls ./android
app
build.gradle
gradle
gradle.properties
key.properties
settings.gradle
This is an error I got
./android/gradlew clean assembleRelease
/Users/donperera/.jenkins/workspace/demo#tmp/durable-b0592b49/script.sh: line 1: ./android/gradlew: No such file or directory
Is there any way to build apk/aap with Jenkins?
Is it possible to use this plugin? but I already added this one. But not in this my script. https://guides.gradle.org/executing-gradle-builds-on-jenkins/
gradlew or gradlew.bat is an executable of Gradle that can be used to execute gradle commands.
gradlew or gradlew.bat uses gradle/wrapper/gradle-wrapper.jar file for execution.
So there are 3 files in play:
gradlew for mac and linux
gradlew.bat for windows
gradle/wrapper/gradle-wrapper.jar
The thing here is, these files already exists when you create your flutter project. But these files are ignored by .gitignore of the project by default. so these files won't be available in your CI/CD server.
METHOD 1 [RECOMMENDED]
You don't need them to build your project when it is a flutter project. You need flutter SDK to be installed. You can use flutter SDK to build your project. Use following command for release build [you might need to set flutter SDK for your Jenkins server]:
flutter build apk --release
It will run assembleRelease internally and will generate your APK file.
METHOD 2 [NOT RECOMMENDED]
If you want to do it your way then you can add those 3 files to version control by removing their references from .gitignore file and push it to your repository. Then you'll have those file in your Jenkins workspace. You'll have to grant execution permissions to gradlew if you are on mac or linux which can be done by following command.
chmod +x ./gradlew
then you can use following command to build your app:
./gradlew clean assembleRelease
NOTICE: Method 2 is not recommended because when you run flutter commands, it sets some properties to gradle from pubspec.yaml file like version name, version code. So if you made changes to pubspec.yaml file and haven't run flutter command after that, then running gradlew directly won't include those changes. In this case, your apk might built with older version or might not even built as it reads version info from local.properties file which is auto-modified by flutter commands and it is excluded by default from version control. So, you'll also have to add local.properties file by removing its reference from .gitignore file which is very very dirty because it has location reference of android SDK and your server might not have android SDK on that location. Again you need to tackle that. so don't use this method.
You should not do that "on Jenkins". You should do that in your codebase. Execute the wrapper command (gradle wrapper), add wrapper files to Git, commit and push.
I'm trying to setup a build process that can run when our dev commits to the GitLab repository. I'm trying to get this thing to build the APK and the method that I'm using for this is suggested by this thread the error I'm getting is here which implies that the file aapt doesn't exist. Although investigating that path it most certainly exists so I have no idea what I'm doing wrong here.
The docker container that I'm using as a base is /runmymind/docker-android-sdk/:latest then I'm using this dockerfile at /chamunks/ReactNativeAndroid/
I'm not entirely certain how I'm failing at this as I've never compiled an android app before but this process being as crazy as it is makes me wonder how anyone ever builds an android app.
You can try deleting android/build and android/app/build directories and then call gradle to build and install the app.
For Debug you should call these in your project root directory;
(cd android/ && ./gradlew assembleDebug)
(cd android/ && ./gradlew installDebug)
For Release you should call these in your project root directory. This option needs a generated .keystore file. The produced .apk files are under android/app/build/outputs/apk path;
(cd android/ && ./gradlew assembleRelease)
(cd android/ && ./gradlew installRelease)
You might also try reinstalling your android-sdk. You might have a problem with version 23.0.3.
I have created an Android test project using Robotium. For my own android project, I build the project successfully using following commands :
android update test-project -m /home/jyoti/workspacetry/Puresms/ -p /home/jyoti/workspacetry/ExampleApplicationTesting/
ant clean debug
Next I have created project for a apk file whose project is not available. I changed package name and MainActivity name in both xml and java file of test project. I do want to compile the project in a script using ant. But android update command not working without complete project name to be tested.
So how can i create a test project of Robotium using ant when i only do have apk file of project to be tested.
Jenkins build with gradle does not produce a apk file into build artifacts, it returns specified files and folders in that folder in workspace but not generate apk file.
Here is console log, build artifacts and config.
Basically Build is successful but its not updating build artifacts with updated apk.
Problem is apk is not updated.