Compiling CyanogenMod for lg g2 d802 - android

I'm trying to build CyanogenMod for intl G2 (the only change I've made is to add halo)
for the repo init I've done:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0 -g all,-notdefault,d802,lge
And then repo sync -j8
After that, like I've said, I've added halo.
And now I'm trying to build by doing:
$ source build/envsetup.sh
$ breakfast d802
but the only things I get is:
root#synnyg-PC:~/CM/G2# breakfast d802
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/lge/d802/cm.mk]]: "device/lge/g2-common/g2.mk" does not exist. ArrĂȘt.
Device d802 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Traceback (most recent call last):
File "build/tools/roomservice.py", line 76, in <module>
result = json.loads(urllib.request.urlopen(githubreq).read().decode())
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/lge/d802/cm.mk]]: "device/lge/g2-common/g2.mk" does not exist. ArrĂȘt.
** Don't have a product spec for: 'cm_d802'
** Do you have the right repo manifest?
I don't understand because when I take a look to device, there is no lge/d802 directory. By doing the init command, I would have to download specific files...
also lunch and breakfast command gave me the same error...
Do you have an idea where I'm wrong and what can I do ? I think I've to download the device specific files but how can I do this (if this is the error) ? I don't see...
Thanks in advance !

Related

Androidviewclient valueError while running

I have generated the template using command $ culebra -U -o mytest.py and using for com.csr.csrmeshdemo:id/powerSwitch to turn on and off the switch.
It worked fine for first time but after restarting system for another issue I am unable to run my python script. getting error like this:
*root#parameshwar:~/Desktop/monkey/adt-bundle-linux-x86_64-20131030/sdk/CSR_script# adb devices
List of devices attached
T00940ZEIM device
root#parameshwar:~/Desktop/monkey/adt-bundle-linux-x86_64-20131030/sdk/CSR_script# python t6.py
E
======================================================================
ERROR: testSomething (__main__.CulebraTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "t6.py", line 44, in testSomething
self.vc.dump(window='-1')
File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.6-py2.7.egg/com/dtmilano/android/viewclient.py", line 3270, in dump
self.setViewsFromUiAutomatorDump(received)
File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.6-py2.7.egg/com/dtmilano/android/viewclient.py", line 2927, in setViewsFromUiAutomatorDump
self.__parseTreeFromUiAutomatorDump(received)
File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.6-py2.7.egg/com/dtmilano/android/viewclient.py", line 3109, in __parseTreeFromUiAutomatorDump
raise ValueError("received does not contain valid XML data")
ValueError: received does not contain valid XML data
----------------------------------------------------------------------
Ran 1 test in 2.508s
FAILED (errors=1)*
Please help me with this..
Latest AndroidViewClient/culebra 11.5.7 adds more verbose information about the exception and would let you trace the root cause easily.

Move Android Sources to another Machine

So, Basically I've synced all the Cm-11.0 sources to my PC. Now I had move the sources to another PC. So i thought that copying just '.repo' folder and running repo sync -l to another PC will do the trick.
Now I have .repo folder and when I run repo sync it gives the following error
dkbhadeshiya#CrayJaguar:~/android/cm11$ repo sync -j1
Fetching project CyanogenMod/android_frameworks_webview
Traceback (most recent call last):
File "/home/dkbhadeshiya/android/cm11/.repo/repo/main.py", line 500, in <module>
_Main(sys.argv[1:])
File "/home/dkbhadeshiya/android/cm11/.repo/repo/main.py", line 476, in _Main
result = repo._Run(argv) or 0
File "/home/dkbhadeshiya/android/cm11/.repo/repo/main.py", line 155, in _Run
result = cmd.Execute(copts, cargs)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 635, in Execute
fetched = self._Fetch(to_fetch, opt)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 339, in _Fetch
self._FetchProjectList(**kwargs)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 234, in _FetchProjectList
success = self._FetchHelper(opt, project, *args, **kwargs)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 275, in _FetchHelper
no_tags=opt.no_tags, archive=self.manifest.IsArchive)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/project.py", line 1076, in Sync_NetworkHalf
self._UpdateHooks()
File "/home/dkbhadeshiya/android/cm11/.repo/repo/project.py", line 2098, in _UpdateHooks
self._InitHooks()
File "/home/dkbhadeshiya/android/cm11/.repo/repo/project.py", line 2126, in _InitHooks
os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
OSError: [Errno 20] Not a directory
and when I run Repo Sync -l It gives following error:
dkbhadeshiya#CrayJaguar:~/android/cm11$ repo sync -l
error: in `sync -l`: revision refs/heads/cm-11.0 in CyanogenMod/android_abi_cpp not found
Any Idea how to solve this??
Maybe you can try this command before you sync.
repo forall -vc "git reset --hard"

sl4a python make a Toast for android phone

I wrote only this 3 lines in python using SL4A:
import android
droid = android.Android()
droid.makeToast(u"ascc4r")
When this code runs, I get the following error:
pydev debugger: starting
Traceback (most recent call last):
File "C:\Users\Tibi\Desktop\adt-bundle-windows-x86_64-20130917\eclipse\plugins \org.python.pydev_2.8.2.2013090511\pysrc\pydevd.py", line 1446, in <module>
debugger.run(setup['file'], None, None)
File "C:\Users\Tibi\Desktop\adt-bundle-windows-x86_64-20130917\eclipse\plugins org.python.pydev_2.8.2.2013090511\pysrc\pydevd.py", line 1092, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "C:\Users\Tibi\workspace\26\src\26module.py", line 7, in <module>
droid = android.Android()
File "C:\Python26\lib\android.py", line 34, in __init__
self.conn = socket.create_connection(addr)
File "C:\Python26\lib\socket.py", line 547, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11001] getaddrinfo failed
Environment setup:
- Python 2.6.6
- set ap_port=9999
- adb forward tcp:9999 tcp:xxxx (xxxx where I started the server on the phone)
My android.py is in the Python/Lib folder.
Update:
I tried this 3 instruction in CMD and it's work, making a Toast. So I think the fault is in the ADT bundle, or Eclipse Python plugin.
What is this Errno 11001?
What is this Errno 11001?
I don't know about that error, but I suggest to use the correct syntax which is
import android
droid = android.Android()
droid.makeToast('my text to print should be inside the quotes')
see also the API Overview

Forge / Trigger.io cannot find adb even

Trying to run forge run android command and getting this error even though file is present (Ubuntu 12.04). Even if I do not specify the sdk path and allow forge to download it on its own, I am still getting the same error.
2012-07-04 15:08:36,414 [ DEBUG] Exception running detached command:
/home/rockyj/Apps/android-sdk-linux/platform-tools/adb start-server:
[Errno 2] No such file or directory while running
run_android(('/home/rockyj/Workspace/Projects/greeter/development',
u'/home/rockyj/Apps/android-sdk-linux', None, True, None), {})
2012-07-04 15:08:36,417 [ ERROR] Something went wrong that we didn't expect:
2012-07-04 15:08:36,417 [ ERROR] Exception running detached command:
/home/rockyj/Apps/android-sdk-linux/platform-tools/adb start-server:
[Errno 2] No such file or directory
2012-07-04 15:08:36,417 [ DEBUG] Traceback (most recent call last):
File "/home/rockyj/Apps/forge-tools/forge/async.py", line 87, in run
result = self._target(*self._args, **self._kwargs)
File "/home/rockyj/Apps/forge-tools/forge/main.py", line 388, in run
build_to_run=build_to_run,
File "/home/rockyj/Workspace/Projects/greeter/.template/generate_dynamic/customer_goals.py",
line 120, in run_app
build_to_run.run()
File "/home/rockyj/Workspace/Projects/greeter/.template/generate_dynamic/build.py",
line 338, in run
self._run_task(func_name, args, kw)
File "/home/rockyj/Workspace/Projects/greeter/.template/generate_dynamic/build.py",
line 293, in _run_task
self.tasks[func_name](self, *args, **kw)
File "/home/rockyj/Workspace/Projects/greeter/.template/generate_dynamic/android_tasks.py",
line 588, in run_android
run_detached([path_info.adb, 'start-server'], wait=True)
File "/home/rockyj/Workspace/Projects/greeter/.template/generate_dynamic/android_tasks.py",
line 377, in run_detached
raise ShellError(message="Exception running detached command: %s"
% full_command, output=str(output))
ShellError: Exception running detached command:
/home/rockyj/Apps/android-sdk-linux/platform-tools/adb start-server:
[Errno 2] No such file or directory
Please help.
Thanks.
Per the comments, this issue was fixed by installing ia32 libs on Ubuntu.

How to download google source code for android

As you know, there is a list of several hundred projects in https://android.googlesource.com/. I'd like to download them all in windows machine. According to Google's document,
To install, initialize, and configure Repo:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
To clone the entire platform, install repo, and run:
mkdir mydroid
cd mydroid
repo init -u https://android.googlesource.com/platform/manifest
repo sync
In my machine, however, I cannot "repo init" in Git Bash because it says it does not have python. I have python installed but git bash does not recognize it. Note that I set the python directory to the system path too. If anybody can give a tip, I would appreciate it. Thanks
UPDATE: I believe it's problem with new version of Git Bash for Windows. System path is not applied to Git Bash at all - I could easily test if system path worked with command prompt. Anyway, I tried this instead and it actually ran with error of course.
/c/python27/python.exe ../bin/repo init -u https://android.googlesource.com/platform/manifest
The error message is
$ /c/python27/python.exe ../bin/repo init -u https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "../bin/repo", line 91, in <module>
import readline
ImportError: No module named readline
OK. I passed this error by installing pyreadline in windows:
easy_install pyreadline
If you got an error, you must install setuptools from
http://pypi.python.org/pypi/setuptools#files
And finally ran the command again to get this:
$ repo init -u https://android.googlesource.com/platform/manifest
fatal: unable to start d:\mywork\dev\GoogleAndroid\working_dir\.repo\repo/main.py
fatal: [Errno 8] Exec format error
With one click, download the latest code as .tar.gz file, from here
https://android.googlesource.com/platform/frameworks/base/+archive/master.tar.gz, the android could be found under core folder
Edit
Alternative here:
http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
Just select the version then a download options within.
If you consider, as an example, this other program "sympy" which also needs git bash and python, it is only a matter to add python to your PATH prior to launching the git bash session.
Install Python from:
http://python.org/download/
by downloading the "Python 2.7 Windows installer" (or Python 2.6 or 2.5) and running it.
Add python directory to your system environment path variable
(My Computer -> Advanced -> Environment Variables -> Path -> Edit).
Note that the repo script itself must be in the path, as mentioned in the Version Control page of android:
Repo is a repository management tool that we built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system, and automates parts of the Android development workflow.
Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android.
The repo command is an executable Python script that you can put anywhere in your path.
This answer explains how to fix this error:
fatal: unable to start c:\path\.repo\repo/main.py
fatal: [Errno 8] Exec format error
Summary: I finally used the python packaged by Cygwin.
Details: Below is the full story.
The tip from the repo bug tracking is to add '/c/app/Python27/python ':
line 136 in v1.20
REPO_MAIN = '/c/app/Python27/python ' + S_repo + '/main.py'
line 735 in v1.20 (beginning of function main)
wrapper_path = '/c/app/Python27/python ' + os.path.abspath(__file__)
But we get the error TypeError: coercing to Unicode: need string or buffer, NoneType found
Therefore I reverted these changes above and performed the other changes below (on version 1.20):
line 136, replaced single slash by double back-slash:
REPO_MAIN = S_repo + '\\main.py'
line 766, added python absolute path as first element of me:
me = ['C:\\app\\Python27\\python.exe', repo_main,
'--repo-dir=%s' % rel_repo_dir,
'--wrapper-version=%s' % ver_str,
'--wrapper-path=%s' % wrapper_path,
'--']
line 776, replaced os.execv(repo_main, me) by
os.execv('C:\\app\\Python27\\python.exe', me)
However we get still an error:
$ Traceback (most recent call last):
File "c:\path\.repo\repo\main.py", line 39, in <module>
from subcmds.version import Version
File "c:\path\.repo\repo\subcmds\__init__.py", line 36, in <module>
['%s' % name])
File "c:\path\.repo\repo\subcmds\forall.py", line 17, in <module>
import fcntl
ImportError: No module named fcntl
The Python v2.7 fcntl documentation says fcntl is available for platform Unix only.
I finally reverted again all changes in repo script and installed Cygwin including its python and git packages: it succeeded as a charm.
But, as the symlinks simulated by Cygwin are not recognized by the MSysGit, we have to use the Cygwin git. And GUIs on top of git are not fully compliant with Cygwin git...
(see also my other post)
Edit:
Cygwin can use native NTFS symlinks (just set CYGWIN=winsymlinks:native and be Admin). Therefore MSysGit can be used and any other GUI based on it :-)

Categories

Resources