How to build the Android SDK for Volt IRIS app?

I was curious to know the process of getting an SDK for a Volt IRIS project. Let me explain more about my query:

As I have already made a project on Iris & now I want to get the SDK of the application so that I can upload it onto the Google play store. So, when I click on the Build & Publish Native button, then I am prompted with a page that asks me to choose the Post Build Action (having 3 options: Publish to app store, run on my device, generate native app). First query: Does App Store means the Foundry Marketplace or Google Play Store?

And if I select the publish to app store option, then it prompts me the below warning:

"Please configure Andriod Signing details within your Android settings to build Android release mode binaries"

And in the Android signing settings, there are fields like Key Alias, Key Password, Store Password & Store file. As this is my first time working with Android apps, it may sound naive but I don't know what these things are used for and how I can provide these details.

I have read this article but nothing got clear. So, can anyone guide me on how to successfully generate a SDK that can be used to install the application on any Android device / deployed onto the Google play store?

Hi Vishal, to answer your first query, the Publish to App Store will publish the application information to the Foundry internal app store. This is a built-in feature of Volt Foundry that can be used to help distribute an app internally to your organization. It is not for the OEM app stores. You can read more about the feature here:

https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Foundry/voltmx_foundry_user_guide/Content/EnterpriseAppStore.html

In regard to the Key Alias and other fields in the Project Properties, those are required by Google to sign an app prior to submission to the Google Play Store for download by the public. There are some more details here in the Android docs here:

https://developer.android.com/studio/publish/app-signing

https://support.google.com/googleplay/android-developer/answer/9842756?hl=en&ref_topic=7072031&sjid=16296861462918604630-NA

Applications can be built in Debug mode, where it is intended to be distributed ad hoc or internally, tested, etc., without public access or additional security build features included (e.g. code obfuscation). If you wish to build your application to test on a device or to share internally, you can build in debug mode and these key and store values will not be used. These will only be required when trying to build in Release mode.

If you are new to Android development overall, I would suggest reading through the Android developer documentation to help familiarize yourself with concepts and process.

The Volt Iris build process for an Android app will use the underlying tooling of Android (SDK, Studio, Gradle) to generate the final APK/AAB files for an application. This is why Iris requires the Android SDK as a prerequisite. There are dependencies upon which OS version(s) you wish to support, which feature permissions you may wish to enable, and other adjustments you may wish to make in the project to configure how the build commences. You may need to use the Android SDK Manager to download and install the various SDK versions you wish to support for your application.

There is some additional information about Android configuration in our documentation. This does assume the user has some fundamental Android developer experience.

https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_user_guide/Content/Inputs_to_Android_Application_Developers.html

Hope this information helps provide some direction. It sounds like from your post you are relatively new to Android development, in which I would highly recommend starting with the Android documentation first.

Thanks for the reply @Gunndarr Dotter . Will be checking out the resources that you shared in a while and hopefully succeed in getting out an SDK. Thanks for the help

Hi @Gunndarr Dotter, I was going through your reply again. As I have already told that I am not into Android development, so it is far than easy to wrap my hands around the things that you mentioned. So, I am requesting the Volt MX team to make a video/article on how to deploy an app from Volt MX to Android Play Store. @Cerlina Aragon @Analyn Policarpio can you please help me in this? An article will be of great help because this is one of the functionalities of Volt MX!

Hi everyone. Today, I spent a lot of time on getting the android app bundle (.aab) file for my Volt MX project. But still, I am unable to get that built and seeking help.

For your reference, I am using Version 9 Service Pack 5 Fix Pack 20 (2023.12) which is the latest one as of now.

@Gunndarr Dotter I have read the Android Signing Configuration article many times and I am saying again that there is nowhere mentioned how to get the Store file and other stuff. I am baffled to see that and can't digest the fact that nothing is mentioned in the release mode signing process.

On the contrary, I found the iOS Provisioning and Certificate Creation article, and it has everything in detail. I guess it is high time that the core team updates the article so that it can act as a one-stop solution for new users.

Now, let's focus on the issue:

  1. At the start of the day, I built the application in debug mode and even published it to my app store and that build was successful. I did that twice and I was able to download the apk file and install it on Android mobiles. But since those two builds, each test/debug build is failing in the final stage. I don't know why is that happening. I am attaching the build log for the same error, if someone can pinpoint the mistake, then it will be great.
  2. Now let's talk about building the application in Release mode. When I do so, then it prompts me to provide the Android Signing Details and for that, I need to provide 4 values (Key Alias, Key Password, Store Password, Store File). In the Android article (which I shared above), details of generating a certificate should be provided. So, after searching for a bit, I found out that the certificate can be built either by using keytool (Java tool) / Android Studio. I used both of the methods and generated the .jks file in which all 4 properties were defined. But whenever I edit those values on the Volt MX platform, then it always throws the error of Wrong Password. And I am 1000% sure that the password is always correct.
    • First of all, it should prompt which password it is referring to (store/key password).
    • In the above snippet, you can see that it says Check Logs For Details, but there are no logs built for this scenario. How can I access the logs if they are not being saved on the local machine?

I am using Android Studio to build the .jks file and the CLI command with which I am generating the same are as follows:

keytool -genkey -keyalg RSA -alias [alias] -keystore [keystorename].jks -storepass [storepassword] -validity [validity] -keypass [keypassword]

There is nothing wrong with both of the ways for generating the keystore file and I am truly clueless about how it can work. This is hampering in processing ahead because there are very few resources to aid development on the Volt MX platform and I am just seeking help from this official forum.

By the way, this makes me wonder whether anyone has ever built a released version of any Volt MX application. @Cerlina Aragon @Suhas Bhat @Analyn Policarpio @Marek Stepien @Prince Charles Mendoza @Venkata Raju Bankapalli can you help me!

For your reference (to prove that the jks files are correct or not) I am sharing this CLI output:

The Android Signing snippet is as follows:

Can anyone point out what is the mistake?

build logs.txt

Any update for this, @Suhas Bhat @Analyn Policarpio @Marek Stepien ! This post has been unanswered since 7 months

Hi Vishal, I'm sorry this process has been frustrating for you. I agree that Android development is not intuitive for folks new to the process.

We have had many production customers with apps on the Google Play Store, so we do know the tooling works. I personally have never submitted an app package to the actual Google Play Store, but I'm familiar with the build process between Android Studio and Volt Iris. I'll add some additional comments here to hopefully add some insight.

Regarding the log file you provided, it appears like you are using the cloud build service. I think there may be a bug in our cloud build tools since you do get a successful .aab build message here:

13:45:32 [32m[2024-01-20T08:45:31.880] [INFO] ci - [39mBinary successfully copied to CloudBuildService/vis_ws/wishy/binaries/android/wishy-debug.aab

but then the cloud build service appears to be looking for an APK instead:
13:45:35 Running in CloudBuildService/vis_ws/temp/wishy/build/luaandroid/dist/wishy/build/outputs/apk
[Pipeline] {
[Pipeline] findFiles
[Pipeline] }
[Pipeline] // dir
[Pipeline] echo
13:45:36 [0;31m [ERROR] CloudBuildService/vis_ws/temp/wishy/build/luaandroid/dist/wishy/build/outputs/apk does not exist. [0m
[Pipeline] echo
13:45:36 [0;31m [ERROR] Failed to search build artifacts! [0m
[Pipeline] echo
13:45:36 [0;31m [ERROR] Build artifacts for ANDROID_MOBILE_NATIVE were not found!! [0m

I would suggest re-verifying that this is the case when trying to cloud build an AAB vs. an APK, and if still unsuccessful to log a Support ticket. In the meantime, I'll try to add some additional info to try to help you to build locally as a workaround.

Your approaches to generating the release mode keystore file are correct. You can use the command-line keytool or you can use Android Studio, it's developer preference (I prefer Android Studio). To set the context, I currently have my local Windows 10 desktop configured to build for Android 13 as my minimum/target OS, I have not yet updated anything for Android 14.

The correlation between the Android Studio keystore fields and Volt Iris are as follows for an APK:

For an AAB:

You mentioned getting an incorrect password error. If you have verified and re-verified that the above values are entered correctly (I have mistyped this many times, I think it's easy to do), then I would suggest logging a support ticket to request a screen share session.

I am able to successfully build for 9.5 Fix Pack 21, and was also able to build for FP20. I have not gone through the process to submit to the Google Play Store so I am not intricately familiar with those steps but I have not had any issues generating debug or release APKs.

My current setup for reference is:
Windows 10
Volt Iris 9.5.21 (works on 9.5.20 also)

It is not required to upgrade to Fix Pack 21 to resolve your situation, if you choose to please note that Fix Pack 21 requires Java 11. To keep it simple while you troubleshoot I would suggest staying on FP20 for now.

For my current OS 13 builds I use Android Build Tools version 33.0.2. Specifying an exact version of the build tools can be done via a file named androidbuild.properties placed in your Volt Iris project folder. Please refer to this KB article for the history of how and why I do this:
https://support.hcltechsw.com/community?id=community_question&sys_id=7c49647b1b629110534c4159cc4bcbf3&view_source=searchResult

I will monitor this thread in the meantime, please update back with any new information.

Thanks, @Gunndarr Dotter for the reply. By the way, I have even upgraded to Fix Pack 21. Here are the replies to your follow-up questions: (I am building for Android only, as of now)

1. Build & Publish Native: When I click on this option, then no matter what I choose in the Post Build Action (Generate Native App, Publish to my App Store), there are two fixed error replies:

  • Whenever I opt-in for Debug/Test build, then it always throws the build process failure error (whose logs I have already provided)/
  • Whenever I opt-in for Release/Protected build, then it says "Android App Signing Certificates validation failed. Check logs for details". As I have stated earlier, I have tried and tested the jks file multiple times and the values that I am entering are 100% correct. I don't know why it is throwing this error and it never saves the log file so that I can have a look at it. (It's the same whether I try to build an abb/apk)

2. Build Native Local: It asks me to provide Java Home and Android Home directories and for that, I have installed Java, JDK, Android Studio and even Bundletool. I guess I have everything installed but I am confused with what directories I should provide in there!

The reason why I installed JDK is because then only I can use keytool. I am sure I am giving the correct bundletool location (I can get the bundletool version and run commands from the terminal), and Android Home location (got it from the Android Studio) and the only error is coming from the Java side.

In the above screenshot, you can see that the Java version is 1.8 (which is the latest) the JDK version is 21 and Volt MX requires the version to be 11. So, is it asking for JDK v 21?

By the way, you provided separate screenshots for getting the certificates for an apk/abb. But I am unable to point out the difference between the two! Can you point out the differences for me?

Also, as you have mentioned about the support ticket, how can I do that? I will wait for your response.

Hi @Gunnar Berg, I switched from JDK v21 to JDK v11 and now I can use the Build Native Local function. I got the .abb file and even uploaded it to the Google Play Console. But while doing that, it prompted this message. What does that mean?

Through this step, I got the .abb file. But how can I get the .apk file through this step? I know that if I use Build & Publish Native, then on successful completion I get the apk in my email. Can't I get the apk through this option?

Also, still I want to know why the certificate signing part is not working for me I guess the Android Article should be updated thoroughly first of all, it should mention that JDK v11, Android Studio and Buildtool are necessary for building the APK/ABB. Even installing and setting up these takes quite a lot of time and effort. I can even help in framing that page 😉

Hi Vishal, it sounds like you're making some progress in your configuration, good to see. Hopefully this follow-up will also be helpful.

To log a support ticket, from this page you can navigate to the "Customer Support" link at the top of the page:

For building an APK vs. AAB, you can set this in the Iris Project Settings under Native -> Android Mobile/Tablet -> Build Format

I would also suggest focusing on building locally for now vs. using the cloud build service. You said you provided the logs, but those were from the cloud build service vs. the local desktop Iris logs. The local desktop Iris log is stored in Windows in the C:\Users\[username]\Iris\irisdata\logs folder as iris.log and is rolled over every 5MB (you'll see the other files in this folder as well). This can help you in your troubleshooting.

For configuring the prerequisites for Android, we have that documented here, though it sounds like you have done everything required so far:
https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_user_guide/Content/Platform_SDKs.html

https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_user_guide/Content/SUG_Android.html

https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_user_guide/Content/SUG_Android.html#configure-volt-mx-iris-to-build-for-the-android-platform

Also I think there may be some misunderstanding around our option "Publish to App Store" - to be clear, this does not publish to the Google Play Store or the Apple App Store. This publishes to an internal enterprise app store (EAS) managed in Volt Foundry. Whenever you select the "Build and Publish Native" option, Iris will use the cloud build service to generate the AAB/APK file and then publish it to the Enterprise App Store in Foundry. Whenever you select the "Build Native Local" then Iris will use the local SDK tooling (Android Studio/Xcode) to generate the application binary. You can also publish this to the Enterprise App Store during this step if you desire by selecting "Publish to my App Store" for the Post Build Action.

For more information on the EAS feature, please see our documentation here:
https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Foundry/voltmx_foundry_user_guide/Content/EnterpriseAppStore.html

Your screencap above regarding the minimum target version is being enforced by the cloud build service for a Release version of the app. This is because we have our cloud build tools configured to enforce this. For a Debug version this is not enforced. With a local build you have more flexibility in the minimum OS configuration. If you do intend to put this on the Google Play Store, please refer to Google's guidelines regarding minimum OS here:
https://support.google.com/googleplay/android-developer/answer/11926878?hl=en#:~:text=New%20apps%20must%20target%20Android,your%20app's%20target%20API%20level.

Regarding the different build configurations (Debug, Test, Release, Protected), the key differences are explained here:
https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_user_guide/Content/Cloud_Build_in_VoltMX_Iris.html#build-and-publish-a-native-app

Now, let's get back to the build. When you select Debug, the binary will be signed but with an auto-generated debug.keystore created by the Android SDK. This debug keystore and the other supporting files are typically stored in Windows in the C:\Users\[username]\.android folder and are managed by the Android SDK and tools. When you build in Release mode, this will require a user-generated keystore containing the other information you have been working with, created using keytool or Android Studio. To answer your question about the Android Studio wizard screen to generate the keystore, there is a slight difference in the layout of the second form for AAB vs. APK as illustrated above, but you are correct the key four fields required by Iris are not different between the two.

When you select Protected mode, Iris bundles in some additional protections (e.g. jailbreak/root detection and others) into the binary generation and it requires some additional keys and requires interaction with our security team. This specific configuration is explained here:
https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_user_guide/Content/ApplicationSecurity.html#protect-the-application-binaries

Keeping with just a debug build for now, I would select Build -> Build Native Local to help alleviate any issues the cloud build process may cause. To ensure your app will work on the OS version of your device or emulator, you will need to set the Minimum SDK and Target SDK versions accordingly in the Iris Project Settings just below the Build Format setting.

Try a local debug build first. If this succeeds, then I would move to a local release build. Once you have that working, then you may want to do a protected build, but it is not necessary if you wish to submit the app to the Google Play Store.

We have a couple of KB articles regarding common issues you may run into when building for Android. If you see a message like "target API is out of range" or "Build Tools corrupted" please query for these in the Forum and you'll find the KB articles to help.

Hope this helps you move forward.

Cheers,
Gunndarr

Thanks for the elaborative reply @Gunndarr Dotter . It will take some time to wrap my head around it. By the way, I have successfully uploaded the abb file to the Google Play Console and am still filling out the other required fields (privacy policy, data safety and other things). (I have successfully rolled out the app to the internal testers 😊)

In the meantime, I want to bring a small thing to your notice. As I have created this question thread, for the direct replies I get the email notification but for replies of the direct replies (like the one you sent above) I don't get the email notifications and that is why I can't reply as soon as someone replies. I don't know why this happens, but if that can be corrected then the essence of the communication will be increased a lot

@Gunndarr Dotter, I am seeing this warning in the Google Play Console.

Can you please help me in how to resolve this? And also I want to know why Volt IRIS is still using JDK 11. I know it comes under the Long-Term Support version, but is there any downside of using it because JDK 21 is the latest one around?

Hi Vishal, our Android plug-in creates the gradle entries based upon a baseline configuration that is hard-coded in the Iris Android plug-in. Over time this will be updated with our plug-in updates, but we also provide the opportunity for a developer to customize it as needed. References to specific Android library versions can be entered in the build.gradle entries to Suffix in the Native -> Android Mobile/Tablet settings of the project:

Create a section called dependencies and create an implementation entry with the exact version of the library and version the app requires (one per line). Yours could resemble:

dependencies {
implementation 'androidx.annotation:annotation:1.0.2'
implementation 'androidx.fragment:fragment:1.1.0'
}

For some background information on Android uses Gradle, please see this link:
https://developer.android.com/build

For a list of the various Android libraries and their versions, please see this link:
https://maven.google.com/web/index.html

Regarding our support for Java 11 vs. Java 21, that is a product decision that we have made at this time. I do not have a timeline for when a later version of Java will be supported. Typically we will maintain minimum version support that the OEM vendors allow so that our customers have a better opportunity to support older devices and OS versions as needed.

Thanks for the reply, @Gunndarr Dotter. I did the same as you told in the above post and post doing that I am getting Package failed error when I am trying to Build Native Local (aab/apk) for the project. By the way, I have to add the dependencies in the build .gradle entries to suffix textarea, right?

The logs for the same can be found in the attached dependencies error.txt file

Before adding the dependencies, I was able to build aab/apk through the Build Native Local button. Post getting the above error, even if I remove the dependencies, then even I am getting error! That is weird. I guess some files may not be able to remove the effect of adding the dependencies and thus I am not able to build the project again.

The post debugging error logs can be found in the attached post debugging error.txt file.

Sorry for disturbing you a lot this week, but I am really facing some issues on my side.

dependencies error.txtpost debugging error.txt

I have only added the following code to the build gradle entries to Suffix :

dependencies {
implementation 'androidx.annotation:annotation:1.0.2'
implementation 'androidx.fragment:fragment:1.1.0'
}


Is that correct because I am unsure why the errors are coming?

Hi Vishal, looking at the dependencies error.txt file, I see these messages:

[exec-shell] FAILURE: Build failed with an exception.
[exec-shell]
[exec-shell] * What went wrong:
[exec-shell] Execution failed for task ':mergeReleaseResources'.
[exec-shell] > A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
[exec-shell] > Android resource compilation failed
INFO [exec-shell] ERROR:A:\wishy\res\drawable\wishy_icon.png: AAPT: error: file failed to compile.

There is something not right about this particular .png file. Perhaps the file is actually a JPEG and was simply named with a PNG extension? Perhaps the file is corrupted? Try opening the image in an image editor and re-save the file as a PNG.

Btw, Stack Overflow offers information on many of these error messages, because we use the Android tooling, often these errors are not unique to our platform:

https://stackoverflow.com/questions/63997710/android-studio-aapt-error-file-failed-to-compile-with-png-images

I saved that image as a PNG and that solved the issue. Thanks for helping again @Gunndarr Dotter

@Gunndarr Dotter I guess I have again got a roadblock in this aab process building 😔 A week ago I remembered that I built the aab file successfully by clicking on the Build Native Local button and thus I got the aab file. But now, when I click on the same, it gives this error:


I have no clue why this is happening and I am still waiting for you to inspect why the build process is failing when I click on Build & Publish Native. Inside that button, there are three selections (Publish to App Store, Run on my device, Generate Native app) and no matter what I select, the build process fails every time. When I try to get Debug and Test mode (then it does everything successfully, but throws the error at the end, I shared the logs for this in the initial post also), and when I try to get Release, Protected mode then it always throws the CERTIFICATE PASSWORD mismatch.

Can you please help me!! There are many unsolved queries still !!

I just deleted the project and copied a new version of the same. That solved the problem and now I am getting the binary file. However, there are queries regarding the Build & Publish Native. I will wait for its resolution

Hi Vishal, as I mentioned in my previous replies:

"Regarding the log file you provided, it appears like you are using the cloud build service. I think there may be a bug in our cloud build tools since you do get a successful .aab build message here:

13:45:32 [32m[2024-01-20T08:45:31.880] [INFO] ci - [39mBinary successfully copied to CloudBuildService/vis_ws/wishy/binaries/android/wishy-debug.aab

but then the cloud build service appears to be looking for an APK instead:
13:45:35 Running in CloudBuildService/vis_ws/temp/wishy/build/luaandroid/dist/wishy/build/outputs/apk
[Pipeline] {
[Pipeline] findFiles
[Pipeline] }
[Pipeline] // dir
[Pipeline] echo
13:45:36 [0;31m [ERROR] CloudBuildService/vis_ws/temp/wishy/build/luaandroid/dist/wishy/build/outputs/apk does not exist. [0m
[Pipeline] echo
13:45:36 [0;31m [ERROR] Failed to search build artifacts! [0m
[Pipeline] echo
13:45:36 [0;31m [ERROR] Build artifacts for ANDROID_MOBILE_NATIVE were not found!! [0m

I would suggest re-verifying that this is the case when trying to cloud build an AAB vs. an APK, and if still unsuccessful to log a Support ticket."

Please try building an APK using the Build and Publish step to re-verify if the process completes for an APK vs. an AAB.

In my previous reply I also mentioned the location of the local Iris log file:

"You said you provided the logs, but those were from the cloud build service vs. the local desktop Iris logs. The local desktop Iris log is stored in Windows in the C:\Users\[username]\Iris\irisdata\logs folder as iris.log and is rolled over every 5MB (you'll see the other files in this folder as well). This can help you in your troubleshooting."

Without that log file, it is not possible to troubleshoot your error you encounter when you choose Run on my Device or Generate Native App.

I also mentioned in my previous reply regarding Release builds:
"You mentioned getting an incorrect password error. If you have verified and re-verified that the above values are entered correctly (I have mistyped this many times, I think it's easy to do), then I would suggest logging a support ticket to request a screen share session."

If when you build in Release mode you continue to run into the password error and you have verified and re-verified the information is entered correctly then please open a Support ticket.