I am trying to build my React Native Android app on Visual Studio App Center and I get this error:
Task : Shell script
Description : Run a shell script using Bash
Version : 2.165.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
==============================================================================
[command]/bin/bash /Users/runner/runners/2.165.2/scripts/android-postprocess.sh /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk
Removing all ABI or density dependent APKs…
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
Found 0 APK file(s)
Found 0 unaligned APK file(s)
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
/Users/runner/runners/2.165.2/scripts/android-postprocess.sh: line 36: pushd: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk/..: No such file or directory
/Users/runner/runners/2.165.2/scripts/android-postprocess.sh: line 43: popd: directory stack empty
##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Android Postprocess
##[section]Starting: Post Build Script
It's incorrectly looking for my APK in the app/app/build/... instead of app/build/...So I want to copy the files to app/app/build/.. so it finds them there.
I can't copy the files with a post-build script because it runs after the script that throws the error.
Is it possible to somehow achieve copying with Gradle? Or maybe have multiple build paths? Or some other solution?
The problem was that I had gradlew, gradlew.bat and gradle folder in my appmodule folder. I must have mistakenly opened the app folder alone in Android Studio and synced the project.
I solved it by creating a fresh React Native project.
Related
I've been setting up Azure App Center build pipelines and after some troubleshooting, I managed to make our debug build succeed. The issue is that, it seems to not be able to find any of the generated APKs in the expected directories. Any ideas on why that is?
Here's the specific part of the output log:
BUILD SUCCESSFUL in 4m 28s 130 actionable tasks: 124 executed, 6
up-to-date
##[section]Finishing: Gradle Task
##[section]Starting: Android Postprocess
============================================================================== Task : Shell script Description : Run a shell script using
Bash Version : 2.206.0 Author : Microsoft Corporation Help
:
https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
============================================================================== [command]/bin/bash
/Users/runner/runners/2.206.1/scripts/android-postprocess.sh
/Users/runner/work/1/s/build/outputs/apk Removing all ABI or density
dependent APKs… find: /Users/runner/work/1/s/build/outputs/apk: No
such file or directory find: /Users/runner/work/1/s/build/outputs/apk:
No such file or directory find:
/Users/runner/work/1/s/build/outputs/apk: No such file or directory
Found 0 APK file(s) Found 0 unaligned APK file(s) find:
/Users/runner/work/1/s/build/outputs/apk: No such file or directory
/Users/runner/runners/2.206.1/scripts/android-postprocess.sh: line 36:
pushd: /Users/runner/work/1/s/build/outputs/apk/..: No such file or
directory
/Users/runner/runners/2.206.1/scripts/android-postprocess.sh: line 43:
popd: directory stack empty
##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Android Postprocess
I also have a post-clone bash script for generating the local.properties file which contains some secrets, and it seems to work just fine since the build uses it and goes through with it.
Sadly, I can't infer much from the logs, I'm not a DevOps engineer and have practically 0 experience in this sector.
I'm building c++ application for android using Android Studio 2.3.3. Build fails with error:
Fatal error: can't create
CMakeFiles/kore.dir/C_/ab/android-native-build/Sources/src/banan/server/serverData/ServerCompound_banan_server_serverdata_ListValue_IdInt_banan_server_serverdata_ServerCompound_serverdata_ServerAchieve.cpp.o:
No such file or directory clang++.exe: error: assembler command failed
with exit code 1 (use -v to see invocation)
The directory in which this file should be created exists and some other files were successfully created there.
I think this is because of path is too long. I've seen such messages previously and moving project to another directory with shorter path have solved the issue. But now I've already done this.
shorter your project location because path maximum 256 char long is accepted.
I trying to build chromium android apk with this instruction
But on GN configuration step I have following problem after arguments file editing and saving
ERROR at //build/config/android/internal_rules.gni:1966:13: Script returned non-zero exit code.
exec_script("//build/android/gyp/find.py",
^----------
Current dir: /home/artem/chromium/src/out/Default/
Command: python -- /home/artem/chromium/src/build/android/gyp/find.py ../../third_party/android_tools/sdk/extras/google/google_play_services/libproject/google-play-services_lib/res
Returned 1.
stderr:
../../third_party/android_tools/sdk/extras/google/google_play_services/libproject/google-play-services_lib/res does not exist
See //build/config/android/rules.gni:634:3: whence it was called.
process_resources(process_resources_target_name) {
^-------------------------------------------------
See //third_party/android_tools/BUILD.gn:120:1: whence it was called.
android_resources("google_play_services_default_resources") {
^------------------------------------------------------------
See //base/BUILD.gn:1074:7: which caused the file to be included.
"//third_party/android_tools:cpu_features",
^-----------------------------------------
Then I try manually download google play services with command from this issue thread:
sudo ./build/android/play_services/update.py download
And get this warning:
Your version of the Google Play services library is not up to date. You might run into issues building or running the app. Please run `./build/android/play_services/update.py download` to retry downloading it.
After that I try to build full browser apk
ninja -C out/Default chrome_public_apk
and get error:
ninja: Entering directory `out/Default'
ninja: fatal: chdir to 'out/Default' - No such file or directory
Is there the way to fix this issue and build working apk file?
This works for me:
Run this command at chromium folder:
git rebase-update
gclient sync
Download google play services:
sudo ./build/android/play_services/update.py download
Configure GN: gn args opt/Full
Add this line to file: target_os="android"
Build apk with command: ninja -C opt/Full chrome_public_apk
I'm trying to rebuild Limbo Android. I'm on Linux Mint.
All I changed was android-config.mak NDK_ROOT, exported variables NDK_ROOT. I've also exported NDK_MODULE_PATH to /home/pathtoandroidndk/sources, as per README instructions.
From terminal I do cd limbo-android/jni and then make.
Building returns this error:
jni/glib/glib/./libcharset/localcharset.c:22:20: fatal error: config.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs-debug/glib-2.0/./libcharset/localcharset.o] Error 1
make: Leaving directory `/home/me/limbo-android'
I've tried modifing Android.mk following instructions from Android NDK - Additional Include Directories and Unable to find header files - Android NDK, without success.
I came to conclusion that each module inside limbo-android needs it's own config.h file, while libcharset does not have one.
How do I solve this error? Is there a generic config.h (the one from NDK maybe?)
NOTE: I can build it without any problems on Windows 8.1 using mingw.
I Want to build apk using commandline, I am using ant server by using it I am building apk with commandline but when I give this command ant debug it shows error BUILD FAILED Unable to locate tools.jar and then it gives error source resource doesnt exist
This might be because your JAVA_HOME is not set to your C:\Program Files\Java\jdk folder.
instead it might be set to C:\Program Files\Java\jre so it's not getting tools.jar.
just check out this.
You can do this in this way:
C:\>set JAVA_HOME=C:\Program Files\Java\jdk
C:\>ant debug
You need tools.jar file from your jdk/lib/ folder.