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.
When I try to run my Android project on Eclipse, these errors appear :
[2019-01-28 14:02:47 - Dex Loader] Failed to load C:\Program Files (x86)\Android\android-sdk\build-tools\28.0.1\lib\dx.jar
[2019-01-28 14:02:47 - RallisCensus] Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
Please help to resolve issue.
Android SDK Manager
Simply trying to get my android emulator to boot up. However, I keep getting the message ERROR: Resizing partition failed with exit code 1. I have completely uninstalled Androidstudio and reinstalled but nothing changed, still getting the same error. I have also used both Hardware - GLES 2.0 and Software - GLES 2.0 graphic settings in the AVD settings but get errors for both.
I am using a MacBook pro.
Here is the run error and also the errors caught by logCat.
ERROR: resizing partition failed with exit code 1
This is the error when using Hardware - GLES 2.0
08-09 14:21:07.461 1184-1184/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
08-09 14:21:07.652 1184-1184/? E/SurfaceFlinger: hwcomposer module not found
08-09 14:21:07.675 1184-1184/? E/cutils-trace: Error opening trace file: Permission denied (13)
08-09 14:21:08.169 1184-1241/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
08-09 14:21:08.700 1251-1254/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
08-09 14:21:08.755 1251-1254/? E/cutils-trace: Error opening trace file: Permission denied (13)
This is the error when changing to Software - GLES 2.0
08-09 16:07:50.886 1184-1184/? E/SurfaceFlinger: hwcomposer module not found
08-09 16:07:50.950 1184-1184/? E/cutils-trace: Error opening trace file: Permission denied (13)
08-09 16:07:51.226 1184-1243/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
08-09 16:07:51.890 1252-1254/? E/cutils-trace: Error opening trace file: Permission denied (13)
01-01 00:00:00.000 0-0/? E/Internal: Connection refused
Its your GPU settings in your avd setting..probably..is the USE host GPU box checked?
I am working on an android POS device running on version 4.2.2 i need to make use of the serialPort api to communicate with the printer i have configured the gradle to create the libs folder zipped with the generated .apk file
02-25 10:18:59.956 29180-29180/com.amedora.slrtcpos E/linker: load_library(linker.cpp:771): too small to be an ELF executable: /data/app-lib/com.amedora.slrtcpos-1/libserial_port.so
02-25 10:18:59.956 29180-29180/com.amedora.slrtcpos E/dalvikvm: dlopen("/data/app-lib/com.amedora.slrtcpos-1/libserial_port.so") failed: Cannot load library: load_library(linker.cpp:771): too small to be an ELF executable: /data/app-lib/com.amedora.slrtcpos-1/libserial_port.so
02-25 10:18:59.970 29180-29180/com.amedora.slrtcpos E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Cannot load library: load_library(linker.cpp:771): too small to be an ELF executable: /data/app-lib/com.amedora.slrtcpos-1/libserial_port.so
I need help can someone tell me why it is saying too small to be an ELF executable
too small to be an ELF executable: /data/app-lib/com.amedora.slrtcpos-1/libserial_port.so
means that you have a zero-length file with above path.
First of all this is not duplicate question and I have tried solutions from other similar threads but it looks like this case is different.
In my case I can successfully install and run other android project from the same emulator (x86 also tried arm) but this particular app project throws following error when installing also manually "adb install" from inside shell do not work either.
One of the error from log below is found (line number 232)
https://android.googlesource.com/platform/system/vold/+/froyo/Loop.cpp
However I do not know if the error "No content provider..." is related to the same error stack.
If it had the write-permission error (sdcard or file system permission like that) then other apps should also not install!
This problematic app is a NDK project with a custom content provider which I tried omitting but no avail. it seems like content provider error is related to apk installation from os and not really the content provider from within the app.
I am tired of testing with a real device, I am worried this would degrade my phones life because I had to do it very often.
--------- beginning of /dev/log/main
D/AndroidRuntime( 1977):
D/AndroidRuntime( 1977): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
W/linker ( 1977): libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
D/AndroidRuntime( 1977): CheckJNI is ON
D/dalvikvm( 1977): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 1977): Added shared lib libjavacore.so 0x0
D/dalvikvm( 1977): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 1977): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1977): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
D/dalvikvm( 1977): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
E/memtrack( 1977): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1977): failed to load memtrack module: -2
D/AndroidRuntime( 1977): Calling main entry com.android.commands.pm.Pm
E/PackageHelper( 1680): Failed to create secure container smdl2tmp1
--------- beginning of /dev/log/system
W/ActivityManager( 1149): No content provider found for permission revoke: file:///data/local/tmp/myapp.apk
E/Vold ( 932): Error creating imagefile (Read-only file system)
E/Vold ( 932): ASEC image file creation failed (Read-only file system)
W/Vold ( 932): Returning OperationFailed - no handler for errno 30
E/DefContainer( 1680): Failed to create container smdl2tmp1
W/ActivityManager( 1149): No content provider found for permission revoke: file:///data/local/tmp/myapp.apk
D/dalvikvm( 1149): GC_EXPLICIT freed 161K, 22% free 5442K/6948K, paused 1ms+1ms, total 8ms
D/AndroidRuntime( 1977): Shutting down VM
The problem might be either from:
an Android AOSP bug or a bug in the ROM you are using
(misconfiguration)
something has caused the partition where the apps installed on the SD Card (or an emulated internal card) are stored, to be read only
"Apps on SD card are stored in an encrypted container for platform security purposes -- so that other applications can not modify or corrupt them. When mounting the SD card, these containers are mounted so that they can be accessed in the same way as apps stored in internal storage."
On your stacktrace the problem is this:
E/Vold ( 932): Error creating imagefile (Read-only file system)
E/Vold ( 932): ASEC image file creation failed (Read-only file
system)
I've had a similar problem with an application that had defined in its AndroidManifest.xml the android:installLocation="preferExternal" and the following things worked for me (done independently of one another):
I/qtaguid ( 6299): Failed write_ctrl(u 40) res=-1 errno=22
I/qtaguid ( 6299): Untagging socket 40 failed errno=-22
W/NetworkManagementSocketTagger( 6299): untagSocket(40) failed with errno -22
D/Finsky ( 6299): [1] 2.onResponse: Verification id=29 response=0
D/Finsky ( 6299): [1] PackageVerificationReceiver.onReceive: Verification requested, id = 29
E/Vold ( 127): Error creating imagefile (Read-only file system)
E/Vold ( 127): ASEC image file creation failed (Read-only file system)
W/Vold ( 127): Returning OperationFailed - no handler for errno 30
E/PackageHelper( 6280): Failed to create secure container smdl733025106.tmp
W/DefContainer( 6280): Failed to copy package at /storage/emulated/0/myapp.apk
W/DefContainer( 6280): java.io.IOException: Failed to create container smdl733025106.tmp
W/DefContainer( 6280): at com.android.defcontainer.DefaultContainerService.copyPackageToContainerInner(DefaultContainerService.java:327)
W/DefContainer( 6280): at com.android.defcontainer.DefaultContainerService.access$000(DefaultContainerService.java:67)
W/DefContainer( 6280): at com.android.defcontainer.DefaultContainerService$1.copyPackageToContainer(DefaultContainerService.java:108)
W/DefContainer( 6280): at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:60)
W/DefContainer( 6280): at android.os.Binder.execTransact(Binder.java:446)
As per https://developer.android.com/guide/topics/data/install-location.html change to android:installLocation="auto"
As per http://forum.xda-developers.com/showpost.php?p=58409922&postcount=4845 If you want to install it to "internal device storage", regardless of what the manifest says or what the system decides.
Go to Settings > Apps > Open the menu > Preferred install location >
set it to "Internal device storage". I had this set to "Let the system
decide". This caused some of the APKs to fail the install, because
they were marked to prefer the SD card as their installation location
and thus they tried to install onto the SD and it just failed. Now
that everything installs on the device, it works just fine.
If you want to install it to the "external storage"
adb root
adb shell
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
pm install /mnt/sdcard/myapp.apk
mount -o ro,remount rootfs /
As per https://code.google.com/p/android/issues/detail?id=9593
&& http://www.androidpolice.com/2011/04/19/fixing-the-couldnt-install-on-usb-storage-or-sd-card-problem-on-android/
Only if you are able to find the smdl2tmp1.asec at the following paths
or you get error
smdl2tmp1 03-24 18:48:38.784: ERROR/Vold(86): ASEC file '/mnt/secure/asec/smdl2tmp1.asec' currently exists - destroy it first! (Address already in use)
adb root
adb shell rm /sdcard/.android_secure/smdl2tmp1.asec
adb shell rm /mnt/secure/asec/smdl2tmp1.asec
In my case I'm using a device with Android version 6, developing for Unity.
I am getting the same error when installing the app directly from the Unity Editor, this will not happen if i do upload the app to the android Game Play Developer console as a Beta version and then download and install it from there, in this case android will do needed encryption and install the app successfully.
My solution to do direct install was to set in the :
android build -> Player Settings > Install location -> to Force Internal
In addtion to #Mnemoinc's answer:
If you want to force the install to the "internal storage"
adb root
adb shell
pm install -f /sdcard/myapp.apk
This could be useful when using Cyanogenmod and having a secure storage.