[Android Q&A, Help & Troubleshooting] Deleted member 5186178:
[INFO] How to fix warnings "find: ....No such file or directory" in android building

I saw many people get these errors at start when building lollipop (aosp, cm12, etc.):

find: `src': No such file or directory

See it in full:

============================================
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
"ebtables is disabled on this build"

It did happen to me too testing the recovery builds on lollipop, but I'm not sure if it will be the same for building a full ROM.

Anyway, the missing "src" errors are because of these:

/development/ndk/platforms/android-9/samples/native-activity/Android.mk

/development/testrunner/tests/Android_java.mk

/development/testrunner/tests/Android_native.mk

/cts/tests/systemAppTest/test/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/uB/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/uA/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/uAB/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/uNone/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/permDef/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/uAuB/Android.mk

/cts/hotsidetests/appsecurity/test-apps/keysets/permUse/Android.mk

/frameworks/base/tests/TileBenchmark/Android.mk

/frameworks/base/core/tests/overlaytests/OverlayAppFirst/Android.mk

/frameworks/base/core/tests/overlaytests/OverlayAppSecond/Android.mk

/frameworks/base/core/tests/overlaytests/OverlayTestOverlay/Android.mk

/frameworks/base/core/tests/overlaytests/OverlayAppFirst/Android.mk

All those Android.mk files have lines like this:

LOCAL_SRC_FILES := $(call all-java-files-under, [COLOR="Red"]src[/COLOR])

but there is no src folder to call for.

So, the solution is to delete the call java part, like this:

LOCAL_SRC_FILES :=

for all instances in those files, and you will never see that error again.

From what I saw, all are from tests applications and probably have no impact in working ROM, but I like a clean terminal.

Also, if you get this error too:

find: `dummy': No such file or directory

then go to

/frameworks/support/v17/leanback/Android.mk

find this line:

LOCAL_SRC_FILES := $(call all-java-files-under, dummy)

and change it to

LOCAL_SRC_FILES :=

In some sources (not cyanogenmod 12) you may get this error too:

find: `phone/java': No such file or directory

That is because of /build/core/pathmap.mk file, called in frameworks Android maker. Open the pathmap file, and find this lines:

#
# A list of all source roots under frameworks/base, which will be
# built into the android.jar.
#
FRAMEWORKS_BASE_SUBDIRS := \
$(addsuffix /java, \
core \
graphics \
location \
media \
media/mca/effect \
media/mca/filterfw \
media/mca/filterpacks \
drm \
opengl \
sax \
telecomm \
telephony \
[COLOR="Red"]phone[/COLOR] \
wifi \
keystore \
rs \
)

As you can see, there is "phone" folder listed there which probably is missing from /frameworks/base folder. Delete that line and you won't see the "phone/java" error again.

If you think this is a repo sync probelm, I can assure you I checked on github repos and those folders are missing there too.

UPDATE FOR CM 12-1

In cyanogenmod 12-1 they fixed some of those from above, but there are some others extra:

find: ‘../../../../../../external/hamcrest/src’: No such file or directory
find: ‘../../../../../../external/junit/src/org’: No such file or directory
find: ‘../../../../../../external/hamcrest/src’: No such file or directory

The reason is that in "/frameworks/testing/runner/src/main/Android.mk" file you have two java folder calls (actually 4, because those two are called twice depending on what test library is needed) and they look like this:

LOCAL_SRC_FILES := $(call all-java-files-under, java) \
$(call all-java-files-under, [COLOR="Red"]../[/COLOR]../../../../../external/junit/src/org) \
$(call all-java-files-under, [COLOR="Red"]../[/COLOR]../../../../../external/hamcrest/src)

What's the problem? There are too many folder levels in that path (one is extra) and you can fix it by deleting first two dots and a slash from every path, like the ones I marked in red.

Also someone asked about the "ebtables" error. That is not an error and the only reason you see it is because you are not building for a Qualcomm platform. You can silence that too if you open "/external/ebtables/Android.mk" and edit it like this:

#Avoid building ebtables for emulator
ifeq ($(call is-vendor-board-platform,QCOM),true)
include $(call all-subdir-makefiles)
[COLOR="Red"]#[/COLOR]else
[COLOR="Red"]#[/COLOR]$(info "ebtables is disabled on this build")
endif

adding the hashtag to comment out the info message.

******************

UPDATE FOR MARSHMALLOW (CM 13)

For marshmallow, in addition to some of those from above (some of them are fixed in cyanogenmod source), you will get a bunch of missing "dummy" errors:

find: ‘dummy’: No such file or directory
find: ‘dummy’: No such file or directory
find: ‘dummy’: No such file or directory
find: ‘dummy’: No such file or directory
find: ‘dummy’: No such file or directory
find: ‘dummy’: No such file or directory
find: ‘dummy’: No such file or directory

Ok, one was in lollipop too and you can check above, but the other six are these:

/frameworks/support/v17/preference-leanback/Android.mk
/frameworks/support/v7/recyclerview/Android.mk
/frameworks/support/v7/preference/Android.mk
/frameworks/support/design/Android.mk
/frameworks/support/percent/Android.mk
/frameworks/support/v14/preference/Android.mk

Check all, find this line:

LOCAL_SRC_FILES := $(call all-java-files-under, dummy)

and change it to

LOCAL_SRC_FILES :=

After that you will not see any other missing file or folder.

******************

UPDATE 2 FOR MARSHMALLOW (CM 13)

Lately a new

find: ‘dummy’: No such file or directory

appear in terminal.

Here it is its location

/vendor/cmsdk/Android.mk

Although, in comment they say it has to be defined I didn't notice any interference with building process:

# just need to define this, $(TOP)/dummy should not exist
LOCAL_SRC_FILES := $(call all-java-files-under, dummy)