Android 11 Compilation error: ninja: unknown target 'MODULES-IN-.'

116 views
Skip to first unread message

hey sunny

unread,
May 9, 2022, 11:36:07 AMMay 9
to Android Building
Hi all,

I want to build a static library module outside android-11 root directory.  I've made changes below to include the android.mk which recorded in the file "out/.module_paths/Android.mk.list'. 
But still, I met error ninja: unknown target 'MODULES-IN. 
The same way works on android-9 project. Anyone has idea how to fix the issue?  Also, I noticed that from android-11, kati project no longer exists, does anyone know why?

--- a/ui/build/finder.go
+++ b/ui/build/finder.go
@@ -55,7 +55,7 @@ func NewSourceFinder(ctx Context, config Config) (f *finder.Finder) {
 
        cacheParams := finder.CacheParams{
                WorkingDirectory: dir,
-               RootDirs:         []string{"."},
+               RootDirs:         []string{".", "../test/module"},
                ExcludeDirs:      []string{".git", ".repo"},
                PruneFiles:       pruneFiles,
                IncludeFiles: []string{
@@ -86,6 +86,7 @@ func FindSources(ctx Context, config Config, f *finder.Finder) {
        os.MkdirAll(dumpDir, 0777)
 
        androidMks := f.FindFirstNamedAt(".", "Android.mk")
+       androidMks = append(androidMks, f.FindNamedAt(" ../test/module ", "Android.mk")...)



============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=android
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT= arm64
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT= arm64
HOST_ARCH= arm64
HOST_2ND_ARCH=arm
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.4.0-148-generic-x86_64-Ubuntu-14.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=arm
HOST_CROSS_2ND_ARCH= arm64
HOST_BUILD_TYPE=release
BUILD_ID=RD2A.211001.002
OUT_DIR=out
============================================
10:05:22 AllowBuildBrokenUsesNetwork: true
10:05:22 BuildBrokenUsesNetwork: true
FAILED: ninja: unknown target 'MODULES-IN-..-test-module'
10:05:25 ninja failed with: exit status 1
Reply all
Reply to author
Forward
0 new messages