Android Common Errors: Difference between revisions

From Variscite Wiki
Line 42: Line 42:


How to fix them:
How to fix them:
* Make sure you are not behind the firewall. Ask your IT infrastructure/administrator to unblock or to use propery proxy settings system wide.  
* Make sure you are not behind the firewall. Ask your IT infrastructure/administrator to unblock or to use propery proxy settings system wide.  
Troubleshooting network issues
Troubleshooting network issues
When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by Repo:
When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by Repo:
Line 54: Line 54:




* Make sure you have sufficient free space available on your machine before you start any repo sync
* Make sure you have sufficient free space available on your machine before you start any repo sync
* Make sure you have initialized the host machine build environment is initialized correctly.
* Make sure you have initialized the host machine build environment is initialized correctly.


== Build Errors ==
== Build Errors ==

Revision as of 02:37, 23 October 2018

VAR-SOM-MX6 - Android Nougat N7.1.1 Android Common Errors

Code Fetch Errors

Code fetch errors, are common across developers when repo sync command unable to fetch the code from the manifest you choose from which you are trying to checkout the source code.


Fetching project platform/external/linux-tools-perf
remote: Finding sources: 100% (1812/1812)
error: RPC failed; result=56, HTTP code = 200 625.00 KiB/s      
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: early EOF
fatal: index-pack failed
fatal: index-pack failed
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly
remote: Counting objects: 194, done
remote: Finding sources: 100% (194/194)
remote: Total 194 (delta 5), reused 171 (delta 5)
Receiving objects: 100% (194/194), 2.47 MiB | 1.79 MiB/s, done.
Resolving deltas: 100% (5/5), done.

And Fetching projects:  99% (450/454)  Fetching project platform/packages/wallpapers/MagicSmoke
remote: Counting objects: 192, done
remote: Finding sources: 100% (192/192)
error: Cannot fetch platform/external/libeditMiB | 1.67 MiB/s   
warn: --force-broken, continuing to sync
remote: Total 192 (delta 33), reused 138 (delta 33)
Receiving objects: 100% (192/192), 282.68 KiB | 53.00 KiB/s, done.
Resolving deltas: 100% (33/33), done.

How to fix them:

  • Make sure you are not behind the firewall. Ask your IT infrastructure/administrator to unblock or to use propery proxy settings system wide.

Troubleshooting network issues When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by Repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting:

$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
$ repo sync -j1


  • Make sure you have sufficient free space available on your machine before you start any repo sync
  • Make sure you have initialized the host machine build environment is initialized correctly.

Build Errors

Jack Server Errors

Usually, jack server errors are common starting from Android 7.1.1 onwards, if not sufficient RAM memory or ownership of the jack server is controlled by other users/jack server use.
Refer to https://source.android.com/setup/build/jack#using_jack to jack documentation to understand why JACK server exists.


Common jack errors

FAILED: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex 
/bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.3-rc7 'Douarn' (445000 d7be3910514558d6715ce455ce0861ae2f56925a by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
[ 83% 53958/64361] //external/llvm/lib/Transforms/Vectorize:libLLVMVectorize clang++ Vectorize.cpp
[ 83% 53959/64361] //external/llvm/lib/Transforms/Vectorize:libLLVMVectorize clang++ LoadStoreVectorizer.cpp
external/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:527:56: warning: lambda capture 'LI' is not used [-Wunused-lambda-capture]
      if (isa<VectorType>(Ty) && !all_of(LI->users(), [LI](const User *U) {
                                                       ^
external/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:560:56: warning: lambda capture 'SI' is not used [-Wunused-lambda-capture]
      if (isa<VectorType>(Ty) && !all_of(SI->users(), [SI](const User *U) {
                                                       ^
2 warnings generated.
[ 83% 53960/64361] //external/llvm/lib/Transforms/Vectorize:libLLVMVectorize clang++ BBVectorize.cpp
ninja: build stopped: subcommand failed.
13:31:48 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

Fix : Try increasing your swap space or increase your maximum RAM available in your system keeping 1 GB for your system to work properly. We recommend you have at least 16GB and 32 GB swap space. Otherwise, you will end up in such a situation. https://stackoverflow.com/questions/35579646/android-source-code-compile-error-try-increasing-heap-size-with-java-option

Assuming you have 16 GB of RAM below are the commands you can run before starting compilation. Please don't clean the system, it will take more time again to compile it.

$export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx15000m"
$out/host/linux-x86/bin/jack-admin kill-server
$out/host/linux-x86/bin/jack-admin start-server

Flashing Errors

Permission Denied Errors