Android AOSP generate cpp files from AIDL files

  aidl, android, android-source, c++

I’m trying to generate cpp files from framework aidl files available in the AOSP tree.

I see in the framework Android.mk that the aidl files need to be added to LOCAL_SRC_FILES and that LOCAL_AIDL_INCLUDES needs to be set.

I’ve added a module to the tree and my Android.mk is as follows:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := aidltest
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := main.cpp
LOCAL_SHARED_LIBRARIES := 
LOCAL_CFLAGS += -Wno-error
include $(BUILD_EXECUTABLE)
LOCAL_SRC_FILES += media/java/android/media/IRingtonePlayer.aidl media/java/android/media/AudioAttributes.aidl

LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)

I run mm in my module dir and the build succeeds but the cpp file are not generated. What am I missing?

Source: Windows Questions C++

LEAVE A COMMENT