airgap-it / airgap-vault

The AirGap Vault is installed on a spare smartphone that has no connection to any network, thus it is air gapped. This app handles the private key.
MIT License
380 stars 107 forks source link

Error when build android Dockerfile #149

Closed henryviana closed 1 year ago

henryviana commented 2 years ago

Hey guys,

I try build a container executing the below command:

docker build -t airgap-vault/android -f ./build/android/Dockerfile .

but I get the error:

#14 339.4 > Task :app:compileAppiumKotlin FAILED
#14 339.4 e: /app/android/app/src/main/java/it/airgap/vault/plugin/appinfo/AppInfo.kt: (20, 49): Unresolved reference: VERSION_NAME
#14 339.4 e: /app/android/app/src/main/java/it/airgap/vault/plugin/appinfo/AppInfo.kt: (21, 49): Unresolved reference: VERSION_CODE
#14 339.4
#14 339.4 FAILURE: Build failed with an exception.
#14 339.4
#14 339.4 * What went wrong:
#14 339.4 Execution failed for task ':app:compileAppiumKotlin'.
#14 339.4 > Compilation error. See log for more details
#14 339.4
#14 339.4 * Try:
#14 339.4 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
#14 339.4
#14 339.4 * Get more help at https://help.gradle.org
#14 339.4
#14 339.4 BUILD FAILED in 1m 19s
#14 339.4
#14 339.4 Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
#14 339.4
#14 339.4 You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
#14 339.4
#14 339.4 See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
#14 339.4 153 actionable tasks: 153 executed
#14 339.4 Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)
------
executor failed running [/bin/sh -c yarn configure-mangle     && yarn apply-diagnostic-modules     && yarn jetifier     && ionic build --prod     && cap sync android     && echo y | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --update     && /app/android/gradlew --project-dir /app/android clean     && /app/android/gradlew --project-dir /app/android build     && cp /app/android/app/build/outputs/apk/release/app-release-unsigned.apk android-release-unsigned.apk     && cp android-release-unsigned.apk android-debug.apk     && cp /app/android/app/build/outputs/apk/appium/app-appium-unsigned.apk android-appium-unsigned.apk     && cp android-appium-unsigned.apk android-appium.apk     && zipalign -p -f -v 4 android-debug.apk android-debug-aligned.apk     && apksigner sign --ks ./build/android/debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android --key-pass pass:android android-debug-aligned.apk     && zipalign -p -f -v 4 android-appium.apk android-appium-aligned.apk     && apksigner sign 

Someone help me please?

AndreasGassmann commented 2 years ago

It looks like the VERSION_NAME and VERSION_CODE variables are not set.

I'm currently on the road and cannot look into this right now, but maybe you can compare it to our build script that we use in our gitlab: https://github.com/airgap-it/airgap-vault/blob/master/.gitlab-ci.yml#L50-L51, or the script that walletscrutiny.com uses to reproduce our app: https://gitlab.com/walletscrutiny/walletScrutinyCom/-/blob/master/scripts/test/android/it.airgap.vault.sh

Let me know if that helps, otherwise I'll look into it again.

henryviana commented 1 year ago

It looks like the VERSION_NAME and VERSION_CODE variables are not set.

I'm currently on the road and cannot look into this right now, but maybe you can compare it to our build script that we use in our gitlab: https://github.com/airgap-it/airgap-vault/blob/master/.gitlab-ci.yml#L50-L51, or the script that walletscrutiny.com uses to reproduce our app: https://gitlab.com/walletscrutiny/walletScrutinyCom/-/blob/master/scripts/test/android/it.airgap.vault.sh

Let me know if that helps, otherwise I'll look into it again.

Hi, now it worked! Just add the BUILD_NR argument (docker build -f build/android/Dockerfile --build-arg BUILD_NR="1" .). But another error happens next in gradle build. If I can't solve it, I'll open another issue. Thanks!

AndreasGassmann commented 1 year ago

Good to hear you are making progress. Please let us know what the other issue was and how you fixed it so we can update the documentation (or create a PR :) )