Nu3001 / xdAuto

Primary repository to hold documentation
6 stars 1 forks source link

Document how to build and push to the device on linux, windows and mac? #1

Open h3n3b0sch opened 9 years ago

h3n3b0sch commented 9 years ago

Could someone make a full documentation about building from the repository and then push it to a stock unit in a way that any noob could understand it?

StarChildDK commented 9 years ago

Read http://forum.xda-developers.com/wiki/Newsmy_CarPad_NU3001#Update_ROM ;)

Zaphod-Beeblebrox commented 9 years ago

It's difficult, but possible (I think) to build from source on a MAC. Many tutorials exists on XDA and others on how to build android. The steps necessary to build an .img file are listed in the readme of the platform_manifest repo.
Building Android from Windows is not possible. Use a Virtual Machine (It's what I develop in :))

h3n3b0sch commented 9 years ago

So, that's a no to my question? I thought this repository was for documentation...

Zaphod-Beeblebrox commented 9 years ago

If you or someone else wants to write up a tutorial, and submit it as a pull request, We'd certainly merge it. I personally have no time to do it, and I doubt James does either.

jamesgol commented 9 years ago

It would be great if someone could grab the docs from the multiple places and put them here. I don't have enough time for it, or the other 5 projects I volunteer on. I say we leave this open and can point someone here if they are looking for some way to contribute.

jhansche commented 8 years ago

For Mac OS X:

  1. http://source.android.com/source/initializing.html provides a lot of good information to start with, including setting up a virtual disk image with a case-sensitive filesystem (this is important).
  2. If you have modern versions of XCode, you likely do not have the old Mac OS X SDKs anymore. You can edit the build/core/combo/HOST_darwin-x86.mk file to add whatever version of the SDK you do have installed:

    $ ls -ld /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.*.sdk
    drwxr-xr-x  5 root  wheel  170 May  9 11:10 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

    this means you have "10.11" installed, so update the mk file to allow supporting that:

    diff --git core/combo/HOST_darwin-x86.mk core/combo/HOST_darwin-x86.mk
    index ba61cbf..c4be5c4 100644
    --- core/combo/HOST_darwin-x86.mk
    +++ core/combo/HOST_darwin-x86.mk
    @@ -36,7 +36,7 @@ endif # BUILD_HOST_static
    
    build_mac_version := $(shell sw_vers -productVersion)
    
    -mac_sdk_versions_supported :=  10.6 10.7 10.8
    +mac_sdk_versions_supported :=  10.6 10.7 10.8 10.11
    ifneq ($(strip $(MAC_SDK_VERSION)),)
    mac_sdk_version := $(MAC_SDK_VERSION)
    ifeq ($(filter $(mac_sdk_version),$(mac_sdk_versions_supported)),)

    However, see the note below item (4), which mentions that you can't even build with a modern Xcode anyway, so this change probably isn't necessary. The requirements spelled out at https://source.android.com/source/requirements.html#operating-system indicate that you need to use Xcode 4.2. I'm going to try it with 5.0.2 and see what happens.

  3. Again since you probably have a recent version of OS X, you likely do not have the required version of Java that KitKat was designed to be built with (1.6; while current version of Java/JDK is 8). You can download the JDK-6 from Apple at: https://support.apple.com/kb/dl1572 NOTE: at time of writing, the Download button does not appear -- but viewing the source you can find the "metaUrl" for the download, which points to: http://support.apple.com/downloads/DL1572/en_US/javaforosx.dmg
  4. Now you can start building. Use this as a starting point: http://s.android.com/source/building.html When running lunch, you'll be choosing the rk3188 combo type.

If you got this far (and again assuming you are running any software at all from the past 3 fscking years !!), you'll probably hit yet another set of issues, related to:

make: *** [out/target/product/rk3188/obj/GYP/shared_intermediates/ui/jni/DeviceDisplayInfo_jni.h] Error 1
Traceback (most recent call last):
  File "../base/android/jni_generator/jni_generator.py", line 1065, in <module>
    sys.exit(main(sys.argv))
  File "../base/android/jni_generator/jni_generator.py", line 1061, in main
    options.optimize_generation)
  File "../base/android/jni_generator/jni_generator.py", line 999, in GenerateJNIHeader
    jni_from_java_source = JNIFromJavaSource.CreateFromFile(input_file)
  File "../base/android/jni_generator/jni_generator.py", line 556, in CreateFromFile
    return JNIFromJavaSource(contents, fully_qualified_class)
  File "../base/android/jni_generator/jni_generator.py", line 525, in __init__
    fully_qualified_class)
SyntaxError: Unable to find any JNI methods for org/chromium/ui/LocalizationUtils.

The actual "JNI methods for ___" will probably be different, and might even print multiple times, especially for parallel builds. Google points us to https://groups.google.com/forum/#!topic/android-building/FPCSo1xKJ4U which says you have to downgrade Xcode to 5.0.x (!!):

I found 5.0.2 here: http://adcdownload.apple.com/Developer_Tools/xcode_5.0.2/xcode_5.0.2.dmg But this link probably will not work, so you'll have to sign into your own Apple account in order to get it: https://developer.apple.com/download/more/ and search for "5.0", which should show 5.0.1 and 5.0.2.

Just download that and switch it, as mentioned in the google groups forum:

xcode-select --switch /Applications/Xcode-5.0.2.app/Contents/Developer

Fun note: now that we're forced to downgrade Xcode anyway, that change made above to allow building with with Mac 10.11 SDK is no longer required, because Xcode 5.0.2 will have one of the earlier SDKs that are already supported out of the box! Note that if you have a modern version of OS X, you will not be able to run that Xcode 5.0.2 app, but you can still run the xcode-select command, and it will still be able to build the code.


That's as far as I've gotten so far, and I'm still pushing forward. I'll report back once I get farther