archive artifacts for android apk jenkins - android

I have an .apk file in build/output/APK/debug/debug_app.apk. I am able
to generate built I want to Post-build Actions Archive and artifact
it for that I wrote one command to go Project directory and then in
artifact
I tried to add build/output/APK/debug/*.APK path but its not able to find path it say not found while .APK file is there. I want
to archive and artifact APK file when build is complete please
suggest me how to achieve this ?

Note that Archive the artifacts has an Advanced section there is a checkbox "Treat include and exclude patterns as case sensitive", as I see the "APK" vs "apk" would fail to match if you have that checked. Alternatively simply using build/output/APK/debug/. would get around that specific issue.
Please let me know if these suggestions help. :)

Related

Properties file on Travis CI

I am building an Github Android project using Travis-CI however I have some files which have secret data which I don't want to upload it to GitHub (As it is open and anyone can view it).
In my build.gradle I have written code to load the *.properties file and extract values from it and I have not uploaded these properties files onto GitHub but I want that my properties files should be received when Travis-CI build is being made.
Is there any way I can do this?
Thanks for your help.
Encrypt your file(s). The process is explained in https://docs.travis-ci.com/user/encrypting-files

Difficulties setting up Gradle to send ProGuard mapping files to Firebase

I am trying to follow this documentation tutorial by Firebase to setup Android Studio to automatically send my ProGuard mappings file when building a release APK for my Android application.
However, I couldn't seem to understand steps 4 and 5 in the "Uploading ProGuard mapping files with Gradle" part, mainly because I didn't find any gradle.properties file in my project root or home path and because I wish to automate the execution of the app:firebaseUploadReleaseProguardMapping task in Android Studio, which I don't know how to do.
This is the contents of the gradle.properties file I've created in my project root directory:
FirebaseServiceAccountFilePath = /app/firebase-crash-reporting.json
The firebase-crash-reporting.json file is my Firebase crash reporting private key. My mappings file is generated in the /app/build/outputs/mapping/release/ directory, if that helps.
Please assist me in completing those 2 steps and automatizing the process in Android Studio.
Just add
afterEvaluate {
assembleRelease.doLast {
firebaseUploadReleaseProguardMapping.execute()
}
}
In the android section of build.gradle file.
This will automatically upload the ProGuard mappings file to Firebase as well as run/deploy the APK to the device using ADB.
gradle.properties is owned and managed completely by you. You have to create it if it doesn't already exist. This means you should probably read the Gradle documentation on it to best understand how it provides properties to your builds, and which location is best for your properties.
You are not even obliged to use gradle.properties. You can also specify all the properties for the Crash Reporting plugin via the command line.
When you specify a path for the service account file, you should specify the full, unambiguous path to the file. In your example, it looks like you're assuming that it will look under the app directory in your project. If you want to do that, you still have to give the full path to the file.

Robospice jars for non maven mode

I'm trying to make a build of a sample project (core-basic), without maven, just by picking the jars located in repository/dependencies/1.4.9/robospice and copying them to Android project libs folder.
The jars that I am copying are specifically these:
commons-io-1.3.2
commons-lang3-3.1
robospice-1.4.9
robospice-cache-1.4.9
However, Eclipse shows this error:
robospice-sample-core/libs/commons-lang3-3.1.jar' in project 'robospice-sample-core' cannot be read or is not a valid ZIP file
Moreover, I cannot access into the contents of the jars, WinRar says that they are corrupted or invalid.
So, what am I doing wrong? Can I really use those jar just by copying them to libs folder or do I have to do something more? Why does eclipse say that they can not be read?
(Thanks in advance. In spite of I know that maven setup for Robospice is strongly advisable, I'd like to know why this happens)
Downloading jar by means of right click on its file name --> Save link returns corrupted jar files. Clicking on "Raw" in the file details, return the correct file.
You must have made a mistake while downloading the files. They can be opened pretty easily with zipinfo on my mac. Download them again from the repo branch or pick the artifacts from maven central.

Ant build Android project with dependency lib

I have two Android projects, one shared library and the app. Now I want to compile the app with dependency to the library. In Eclipse, it works very well. After that, I upload it via git to my repository and trigger Jenkins to build both projects.
My problem is, that the error occurs: "sdk/android-sdk-linux/tools/ant/build.xml:440: ../shared-lib resolve to a path with no project.properties file for project". That's clear, because in Jenkins the jobs are stored different than under Eclipse.
Another problem is, that Eclipse compiled the shared to ".jar" and Ant compiled it to "classes.jar" (is named in sdk/android-sdk-linux/tools/ant/build.xml).
Ant scripts should allow you to include whatever files you need. In your case I will suggest you move the reference to the shared-lib to local.properties file (this file should also be read by the ant script generated by update-project. Keep the adequate path for jenkins in the repository and modify the file locally for the local built. In the file in the repository you will need to have something like:
android.library.reference.1=../classes.jar
EDIT By the way the suggestion of the second properties file is just because this file is really meant to store location-specific properties.
I fixed it with copy files. The first project builds my shared-lib.jar. The other projects (phone and tablet) copy this file (shared-lib.jar) to there libs-folder and build correctly. But now I have different projects.propertieson the server and my dev-client. This one is not checked in into git.

Is there a tool to visualize make files like POM dependency graphs?

I am trying to understand AOSP makefiles, I am lost following the build structure. It's way too complex. Is there any tool that gives the build process for a target visually or atleast an editor that helps me navigate the build files by clicking on it (Ctrl + Click navigation)
Thanks
No, there are no tools for this. But there are some rules for Android.mk files. The Android build system start to look for Android.mk files recursively: starting from more "root" folders and proceeding to more far folders. Maybe this can help you to understand build files.

Categories

Resources