I am running linux mint 17.2, I have repo installed and the path to repo is added to my .bashrc. I have previously initiated my repo.
I have followed the instructions on the Android Source Downloading and How to Build CyanogenMod pages.
The problem is: I have written a bash script to automate a number of the commands I would like to use to start a build. My script in a simple form is the following:
#!/bin/bash
cd ~/Android/Cyanogenmod/cm12_1/android/system
source build/envsetup.sh
repo sync --force-sync -j8
exec $SHELL
When I run this, it reports:
/home/username/Desktop/Cyanogenmod_cm12_1_Grouper_Build : line 4 repo: command not found
If I copy and paste each line into a fresh terminal instance (or by just running a script of #!/bin/bash exec $SHELL to open a terminal) it works perfectly.
What I have tried: I have tried including a sleep 10 before the repo sync --force-sync -j8 but that made no difference. I have also tried explicitly initiating the repo and force adding it to my PATH for the current terminal session directly before attempting the repo sync --force-sync -j8. The code for that test was the following:
#!/bin/bash
mkdir -p ~/Android/Cyanogenmod/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/Android/Cyanogenmod/bin/repo
chmod a+x ~/Android/Cyanogenmod/bin/repo
cd ~/Android/Cyanogenmod/cm12_1/android/system/
source build/envsetup.sh
PATH=~/Android/Cyanogenmod/bin/repo:$PATH
repo sync --force-sync -j8
exec $SHELL
The following 2 questions have a similar title, but neither are my question, this and this.
Any help or suggestions would be great, thank you!
To summarize, there turned out to be 2 problems. The first, was in my attempted solution of manually setting the path in the script as PATH=~/Android/Cyanogenmod/bin/repo:$PATH should have been just PATH=~/Android/Cyanogenmod/bin:$PATH.
The second, and overall larger problem, was an incorrectly added PATH variable (to repo) in my .bashrc. This was fixed by adding the line export PATH=$PATH:$HOME/Android/Cyanogenmod/bin to the end of my .profile, followed by logging out/in.
Related
I'm on ubuntu 16.04 and try to install on my lollipop 5.1 tablet, native api webrtc example (AppRtcMobile example).
I successfully installed chromium on my lollipop device. Now after removing the folders used to install chromium on the lollipop device from the ubuntu pc I'm trying to compile an example project about webrtc using the grandle system or adb at the command line. But the compilation always stops at the same point.
Unfortunately, I'm new to git, ninja, fetch and gn, so I do not understand where the error is.
I follow the procedure that I describe below (as I understand that the commands work) and create 3 different installation directories so as to install even on devices other than "arm".
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/my-path/to/depot_tools
mkdir ~/webrTEST && cd ~/webrtcTEST
fetch --nohooks webrtc_android
gclient sync
./build/install-build-deps.sh
gn gen out/DebugArm --args='target_os="android" target_cpu="arm"'
gn gen out/DebugArm64 --args='target_os="android" target_cpu="arm64"'
gn gen out/DebugX64 --args='target_os="android" target_cpu="x64"'
ninja -C out/DebugArm
ninja -C out/DebugArm64
ninja -C out/DebugX64
. build/android/envsetup.sh
ninja -C out/DebugX64 AppRTCMobile
I try to study more than one "tutorial" and the offial guide too, but ninja retur everytime the same result:
myuser#mymachine:~~/webrtcTEST/src$ ninja -C out/DebugX64 AppRTCMobile
ninja: Entering directory `out/DebugX64'
ninja: no work to do.
Anyone can suggest my where is/sre my error?
regards
bkt
UPDATE:
using ls command not find AppRTCMobile but other app example or other ...
the command:
ninja -C out/DebugX64 :xxxx/xxxx/xxxx
work great ... so at these point the question change into:
where is the old AppRTCMobile example located or which is the new name of the example that allows me to android lollipop to use the server google appr.tc ??
Any how if in my manner of install the webrtc-android git there are some error please help my to find it.
regards
bkt
I did not understand the reason, but by deleting everything and re executing the procedure written in the application I got the desired result and I compiled AppRTCMobile.
I have started my AOSP download with lot of hiccups.
I followed the google official site instructions.
$ mkdir ~/aosp/bin
$ PATH=~/aosp/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/aosp/bin/repo
$ chmod a+x ~/aosp/bin/repo
$ mkdir zero
$ cd zero
$ git config --global user.name "Your Name"
$ git config --global user.email "you#example.com
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r1
$ repo sync -j2 -f
As of now my .repo folder is 40GB and sync is still on its been 2 days. Please can anybody help me, all I need is KitKat OS.
Also could anyone enlighten me about project-object and project directories in repo directory.
Thanks in advance
When you do:
repo sync -j2 -f
You are synchronizing everything, which is huge. Give this a try:
repo sync -j8 -c
This will only synch the initialized manifest, which is not as big. When you don't specify a manifest name with -m option, if falls to look for default.xml, which as I can see in https://android.googlesource.com/platform/manifest/+/refs/heads/android-4.4.2_r1 that's the manifest file for the branch you want.
Also -j specifies the threads used, nowadays you can give -j8 at least a try.
With -f you force the download, this does not affect on the size of what you download, nor the speed. You can drop it if desired.
Hope it helps!
After a week's struggle completed the repo sync of KITKAT OS from google. even though you select only a particular OS, It will go upto 58 GB. Out of that 58 GB your KITKAT OS will be only of 9.5 GB. Rest is your .repo in your WORKING DIRECTORY. After sync is complete you will find your OS source in your WORKING DIRECTORY along side .repo.
STEPS:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ git config --global user.name "Your Name"
$ git config --global user.email "you#example.com"
$ repo init -u https://android.googlesource.com/platform/manifest -b OS version
check with google's "source code tags and build" page to select your OS version.
$ repo sync -j18 -c
flags that can be used with repo sync
sync-j - The value for this will be the number of threads to use when syncing the system. Parallelization helps get the job done quicker, but could also get the computer or the network stuck. Using 4 threads is what commonly used for syncing.
sync-c - syncing only the current branch/tag from git. This will checkout for each project only the current branch/tag that we specify for it, and not any other branches that exists on the repository. This will help save some space and bandwidth (and also time), but if you’ll need to switch between branches on a specific project later on - you’ll need to fetch it manually.
it took 8 days for me to get this done as my internet speed is slow (100kbps).
Thank you #Olaia for all the help. hope this helps for anyone out there.
I am starting to work on Android source code in Ubuntu and even if I am expert in Android App development, this part of Android is quite new to me so apologize for any stupid questions.
I started by creating my master branch locally with the following commands:
$ mkdir master
$ cd master
$ wget http://git.[myandroidrom]/repo
$ chmod +x repo
All working as expected, I end up with a folder called master and a file called repo inside it.
Second step I started the synchronization of my source code:
$ ./repo init -u http://git.[myandroidrom]/manifest -b [my specific rom branch]
$ ./repo sync
It took a while (few hours) after I got the folder master populated with all the folders mentioned into the Android source code documentation but they are all .git folders. So quite useless because in order to compile Android I need the real source code which is somehow packed into those .git folders.
What should be the next step to extract the content of this repository?
So actually the command repo sync create a folder .repo which contains the .git structure of android. If in the repo init you don't specify with -b a branch it will download the master branch.
After that, in order to have the real code you need to git clone the folder.
Example, I run the following command:
$ repo sync build
where build is the name of my project folder and in the root working directory I have now the source code for the folder build.
More info can be found at this URL:
https://source.android.com/source/developing.html
I'm having problems updating my Android source tree on Mac OS X (10.7.3), x64 Intel. The code was installed per Downloading the Source Tree, and SE Android was applied per How do I get the SE Android code?.
According to Version Control with Repo and Git, I issued repo sync, which resulted in:
error: '.../.repo/repo/.git/clone.bundle' does not look like a v2 bundle file
I also tried to use git pull, which resulted in:
fatal: Not a git repository (or any of the parent directories): .git
Both commands were executed from the root of the source tree.
Any ideas?
Jeff
I got the same error too.
You might want to try getting the repo again and retrying.
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
There could be problems with checksums, which is probably why pulling the latest repo helps.
Redo repo init and repo sync.
I am new to git and repo. I am in window 7 so I use cygwin. I have installed git from cygwin setup. After that I try to repo with the following command in cygwin.
$ repo init-u git://android.git.kernel.org/platform/manifest.git
I get an error like these:
bash: repo: command not found
I think I need to setup cygwin for repo. What do I need next to get repo?
Case 1: Not installed google repo yet?
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Use the following checksums when required:
For version 1.25 it is
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220
For version 1.26, it is 0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b
Case 2: Already have google repo Installed, still wondering what went wrong ?
Add
PATH=~/bin:$PATH to the end of file ~/.bashrc
and then run
source ~/.bashrc
You still need to install repo. repo is a third party tool built on top of git. See:
http://source.android.com/source/downloading.html
for how to install
I have the same problem and I have to do:
$ PATH=~/bin:$PATH every time I repo sync but at least it works.
add line
export PATH=~/bin:$PATH in file ~/.bashrc
edit .bash_profile and uncomment these fields. (any text editor will do)
# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
# PATH="${HOME}/bin:${PATH}"
# fi
Restart CYGWIN.
Check and see if you have both .profile & .bash_profile in the working directory.
If you do, it's possible that the export command in both is actually conflicting in your shell. Making the output look something like this in Windows...
PATH="C:/Windows/path/to/repo/Windows/path/to/repo:$PATH"
export PATH
That's what happened to my bash shell anyway. It is correct that the 2 files interact with Bash or Cygwin differently, however if you have redundant inputs, they will compile together...
This answer for android build system error
For Python 3
If you get a "/usr/bin/env 'python' no such file or directory" error message, use one of the following solutions:
If your Ubuntu 20.04.2 LTS is a newly installed (vs. upgraded) Linux version:
sudo ln -s /usr/bin/python3 /usr/bin/python
f using Git version 2.19 or greater, you can specify --partial-clone when performing repo init. This makes use of Git's partial clone capability to only download Git objects when needed, instead of downloading everything. Because using partial clones means that many operations must communicate with the server, use the following if you're a developer and you're using a network with low latency:
repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M
you can see document in
Downloading the Source