I encountered the following problem:
The app I implemented includes another project as a dependency (of type aar). Both projects share the same parent pom. The dependency includes resources, which the app is using. To access the resources within the library project, the resource id is fetched by calling context.getResources().getIdentifier(resourceKey, resourceType, packageName)
. I get the package name by calling getPackageName()
on the given context
object.
Before changing the package names of the projects by using
<renameManifestPackage>com.example.newpackagename</renameManifestPackage>
accessing the library resources worked fine. But after renaming the package name of the app I get a android.content.res.Resources$NotFoundException
because the getIdentifier()
call still expects the old package name of the app and calling getPackageName()
returns the new one (as expected).
Now I wonder if I'm missing something or if this a bug in the android maven plugin? https://github.com/simpligility/android-maven-plugin