AOSP version is 8.1.0
.
I have an Android App named Settings
. I Develop with Android Studio and pushed it in packages/apps/MySettings
.
Directory like this
MySettings
├── AndroidManifest.xml
├── Android.mk
├── build.gradle
├── libs
├── res
└── src
Android.mk
like this
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PACKAGE_NAME := MySettings
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := false
LOCAL_STATIC_JAVA_LIBRARIES := appcompat-1.1.0
LOCAL_STATIC_JAVA_LIBRARIES += BaseRecyclerViewAdapterHelper-2.9.46
LOCAL_STATIC_JAVA_LIBRARIES += constraintlayout-1.1.3
LOCAL_STATIC_JAVA_LIBRARIES += material-1.1.0
LOCAL_STATIC_JAVA_LIBRARIES += ZTextView-v1.0.2
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_SRC_FILES := $(call all-java-files-under, src)
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := appcompat-1.1.0:/libs/appcompat-1.1.0.aar
LOCAL_AAPT_FLAGS += \
--auto-add-overlay \
--extra-packages androidx.appcompat
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += BaseRecyclerViewAdapterHelper-2.9.46:/libs/BaseRecyclerViewAdapterHelper-2.9.46.aar
LOCAL_AAPT_FLAGS += \
--auto-add-overlay \
--extra-packages com.chad.library
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += constraintlayout-1.1.3:/libs/constraintlayout-1.1.3.aar
LOCAL_AAPT_FLAGS += \
--auto-add-overlay \
--extra-packages androidx.constraintlayout.widget
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += material-1.1.0:/libs/material-1.1.0.aar
LOCAL_AAPT_FLAGS += \
--auto-add-overlay \
--extra-packages com.google.android.material
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += ZTextView-v1.0.2:/libs/ZTextView-v1.0.2.aar
LOCAL_AAPT_FLAGS += \
--auto-add-overlay \
--extra-packages cc.ibooker.ztextviewlib
LOCAL_MODULE_TAGS := optional
include $(BUILD_MULTI_PREBUILT)
build.gradle
like this
apply plugin: 'com.android.application'
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'
api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'
implementation 'com.github.zrunker:ZTextView:v1.0.2'
}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.setting"
minSdkVersion 27
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDirs = ['src']
main.aidl.srcDirs = ['src']
main.res.srcDirs = ['res']
}
}
I put the above 5 aar files in the libs directory.
When I make
it, if there is an Android.mk file present, I will get the error
error: No resource identifier found for attribute 'layout_constraintStart_toStartOf' in package 'com.example.setting'
If only build.gradle exists and Android.mk does not exist, make will not report an error, but the final generated ROM will not contain this APP.
I see a lot of APP source directories in the frameworks/support/samples
directory, they have build.gradle
but no Android.mk
.
How does make
find them?