1

I am trying to program my own system service, and it requires a .aar library to be included.

I tried it by adding these lines into the Android.mk file in frameworks/base:

LOCAL_MODULE := geth
LOCAL_SRC_FILES := geth_android.aar
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE_SUFFIX := .aar

In my .java file for the service I just want to be able to import it using:

import geth.*;

But when I try to compile it, it throws this error:

frameworks/base/services/java/com/android/server/GethService.java:1: error: package geth does not exist
Markusbug
  • 31
  • 6
  • You should use `LOCAL_STATIC_JAVA_AAR_LIBRARIES`, see https://stackoverflow.com/a/34535361/1028256 – Mixaz Dec 27 '21 at 22:12

0 Answers0