Android – Move Android source into case-sensitive image

androidbuildmacos

I have downloaded the Android source to my Mac. When I went to build, I got this message:

$make -j4
Checking build tools versions…
build/core/main.mk:90: ************************************************************
build/core/main.mk:91: You are building on a case-insensitive filesystem.
build/core/main.mk:92: Please move your source tree to a case-sensitive filesystem.
build/core/main.mk:93: ************************************************************
build/core/main.mk:94: *** Case-insensitive filesystems not supported. Stop.

Then I realised I had missed creating a case-sensitive image. So I created a new one as mentioned on http://source.android.com/source/initializing.html, like this:

hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg

…but I can not create any folder in it, it says:

mkdir android
mkdir: android: Read-only file system

How can I move Android source code which was downloaded on my Mac OS to a newly created case-sensitive image?

Best Answer

I met the same problem. I found if you use sudo then the problem is gone.

Note the # character in Google's step by step guide:

# hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg

function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }

So you have to run the commands with sudo:

sudo hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg
sudo hdiutil attach ~/android.dmg -mountpoint /Volumes/android
Related Topic