One Android Studio project contains a no-activity service, to be communicated with via IMyAidlInterface
(belonging to package com.example.tutorialspoint7.noactivity).
Another Android Studio project contains an activity-only application, for the sole purpose of testing the aforemention service (assume a different package, e.g. com.example.tutorialspoint7.aidlactivity)
Without any special configuration, the aidlactivity project does not know about the noactivity project and thus, any reference to IMyAidlInterface in aidlactivity gets "Cannot resolve symbol IMyAidlInterface".
I searched for a way to let the aidlactivity project to know about that AIDL file, but all "solutions" I found were actually workarounds duplicating the file and adding it as in this example: https://stackoverflow.com/a/16906355/5556250
So, I turned into manually tweaking the app's build.gradle by adding the following into it:
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.tutorialspoint7.aidlactivity"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += '../../NoActivity/app/src/main/aidl/com/example/tutorialspoint7/noactivity'
}
}
I then synced it and, how wonderful, it is now part of the aidlactivity project:
But... AIDLActivity still gets "Cannot resolve symbol IMyAidlInterface".
What do I need to do now to get it to recognize the file?