2

Im working on building an android application to run in an AOSP project.Right now everything working as expected,Im able to load the android os in to the hardware and on launching the android application it opens and everything seems to be ok.

Android mk file used in the android application

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional samples


LOCAL_PACKAGE_NAME := MyApp
LOCAL_CERTIFICATE := platform
LOCAL_DEX_PREOPT := false
LOCAL_PRIVILEGED_MODULE := true
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_PROGUARD_ENABLED := disabled

LOCAL_PACKAGE_NAME := com.myapplication.myapp
LOCAL_MANIFEST_FILE := app/src/main/AndroidManifest.xml
LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/app/src/main/res/
LOCAL_SRC_FILES := $(call all-java-files-under, app/src/main/)

LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_DEX_PREOPT := false
LOCAL_ASSET_DIR := $(LOCAL_PATH)/app/src/main/assets/

LOCAL_AAPT_FLAGS := --auto-add-overlay\
LOCAL_PROGUARD_FLAG_FILES := app/proguard-rules.pro pylauncher/proguard-rules.pro

include $(BUILD_PACKAGE)
include $(call all-makefiles-under, $(LOCAL_PATH))

Now i want to show an image in android application from a url.Im planing to use the library picasso. I have added the following in to the applications's build.gradle

compile 'com.squareup.picasso:picasso:2.5.2'

I have tested the application in a mobile phone and it is working fine.But when i build the android application from AOSP project import files from the picasso library are not recognizing.

Can some one guide me to update the android.mk file to to mention the 3rd party library

PS: Im very new to this domain and please let me know if you want more input from my side

playmaker420
  • 1,527
  • 4
  • 27
  • 52
  • 1
    Why are you mixing ant and gradle? My tip is to make ur project use gradle instead, not only is ant considered deprecated but gradle uses CMake to build your native code. No need for an android.mk file, you just have a CMakeLists.txt file that builds your library as usual, gradle handles things like the toolchain file and NDK location variables. – Simon Hyll Nov 24 '17 at 05:48
  • Do you have to use .mk? AOSP handles gradle projects very smoothly. – miradham Nov 26 '17 at 16:35

1 Answers1

0

There is an alternate solution for this problem. You can add your pre-built apk into the build. here is the link on how to add apk into the build. How do I add APKs in an AOSP build?

Mushahid Gillani
  • 723
  • 7
  • 19