I am trying to add a VPN app as System App in AOSP. I have added all code of VPN app in AOSP_source/packages/app/securevpn. I have created an Android.mk file in this folder. I wrote my LOCAL_PACKAGE_NAME
in PRODUCT_PACKAGES
of /device/google/mydevice/aosp_mydevice.mk
. Now When I compile AOSP i am getting some errors. Am i missing some thing Android.mk
? or some other mistake ?
Note:This app is working fine in Android Studio.
Following are errors
packages/apps/securevpn/res/layout/activity_content.xml:22: error: attribute cardCornerRadius (aka com.technoupdate.securevpn:cardCornerRadius) not found.
packages/apps/securevpn/res/layout/activity_content.xml:22: error: attribute cardPreventCornerOverlap (aka com.technoupdate.securevpn:cardPreventCornerOverlap) not found.
packages/apps/securevpn/res/layout/activity_current_status.xml:18: error: resource drawable/md_nav_back (aka com.technoupdate.securevpn:drawable/md_nav_back) not found.
packages/apps/securevpn/res/layout/activity_current_status.xml:162: error: attribute adSize (aka com.technoupdate.securevpn:adSize) not found.
packages/apps/securevpn/res/layout/activity_current_status.xml:162: error: attribute adUnitId (aka com.technoupdate.securevpn:adUnitId) not found.
packages/apps/securevpn/res/layout/activity_details.xml:53: error: resource drawable/md_nav_back (aka com.technoupdate.securevpn:drawable/md_nav_back) not found.
packages/apps/securevpn/res/layout/activity_details.xml:310: error: attribute adSize (aka com.technoupdate.securevpn:adSize) not found.
packages/apps/securevpn/res/layout/activity_details.xml:310: error: attribute adUnitId (aka com.technoupdate.securevpn:adUnitId) not found.
packages/apps/securevpn/res/layout/motion_drawerlayout_content.xml:2: error: attribute layoutDescription (aka com.technoupdate.securevpn:layoutDescription) not found.
packages/apps/securevpn/res/layout/motion_drawerlayout_menu.xml:2: error: attribute layoutDescription (aka com.technoupdate.securevpn:layoutDescription) not found.
packages/apps/securevpn/res/xml/scene_content.xml:18: error: attribute constraintSetEnd (aka com.technoupdate.securevpn:constraintSetEnd) not found.
packages/apps/securevpn/res/xml/scene_content.xml:18: error: attribute constraintSetStart (aka com.technoupdate.securevpn:constraintSetStart) not found.
packages/apps/securevpn/res/xml/scene_content.xml:18: error: attribute duration (aka com.technoupdate.securevpn:duration) not found.
packages/apps/securevpn/res/xml/scene_content.xml:18: error: attribute motionInterpolator (aka com.technoupdate.securevpn:motionInterpolator) not found.
packages/apps/securevpn/res/xml/scene_main_content.xml:312: error: attribute constraintSetEnd (aka com.technoupdate.securevpn:constraintSetEnd) not found.
packages/apps/securevpn/res/xml/scene_main_content.xml:312: error: attribute constraintSetStart (aka com.technoupdate.securevpn:constraintSetStart) not found.
packages/apps/securevpn/res/xml/scene_main_content.xml:312: error: attribute duration (aka com.technoupdate.securevpn:duration) not found.
packages/apps/securevpn/res/xml/scene_main_content.xml:312: error: attribute motionInterpolator (aka com.technoupdate.securevpn:motionInterpolator) not found.
packages/apps/securevpn/res/xml/scene_main_content.xml:318: error: attribute dragDirection (aka com.technoupdate.securevpn:dragDirection) not found.
15:22:33 ninja failed with: exit status 1
#### failed to build some targets (01:35 (mm:ss)) ####
Here is my Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := securevpn
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PRIVILEGED_MODULE := true
LOCAL_USE_AAPT2 := true
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_DEX_PREOPT := false
LOCAL_STATIC_ANDROID_LIBRARIES += \
androidx.appcompat_appcompat \
androidx-constraintlayout_constraintlayout \
include $(BUILD_PACKAGE)
endif
and Here are my gradle dependencies
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifeCycleVersion"
implementation "com.google.android.material:material:$rootProject.materialVersion"
implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation "android.arch.work:work-runtime-ktx:1.0.1"
implementation 'com.google.android.gms:play-services-ads:19.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.github.AppIntro:AppIntro:5.1.0'
I have resolved all gradle dependencies by adding jar,aar files through make file but now I am facing another errors
New errors below
packages/apps/securevpn/src/main/Android.mk: error: "securevpn (APPS android-arm64) missing libmaterial (JAVA_LIBRARIES android-arm64)"
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
packages/apps/securevpn/src/main/Android.mk: error: "securevpn (APPS android-arm64) missing libcore (JAVA_LIBRARIES android-arm64)"
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
packages/apps/securevpn/src/main/Android.mk: error: "securevpn (APPS android-arm64) missing libwork-runtime-ktx (JAVA_LIBRARIES android-arm64)"
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
packages/apps/securevpn/src/main/Android.mk: error: "securevpn (APPS android-arm64) missing libmultidex (JAVA_LIBRARIES android-arm64)"
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
packages/apps/securevpn/src/main/Android.mk: error: "securevpn (APPS android-arm64) missing android-arm64 (JAVA_LIBRARIES android-arm64)"
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:948: error: exiting from previous errors.
16:15:46 ckati failed with: exit status 1
#### failed to build some targets (01:21 (mm:ss)) ####