I have a library(LIB2) project that depends on another library(LIB1) project that I compiled as AAR and uploaded on Archiva.
When I try to start a LIB1 Activity from LIB2 by using:
startActivity(new Intent(HelperActivity.this, xx.company.blabla.package.login.LoginActivity.class));
I get:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
So I did some research and I tried the solutions found here: Error calling Android activity from .aar library. and here: Using an Android library project Activity within another project.
Now, if I do, as suggested by the solutions that I've found,
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setComponent(new ComponentName("xx.company.blabla.package.login",
"xx.company.blabla.package.login.LoginActivity"));
startActivity(intent);
and in AndroidManifest.xml
<activity android:name="xx.company.blabla.package.login.LoginActivity"/>
I get error ActivityNotFoundException
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {xx.company.blabla.package.login/xx.company.blabla.package.login.LoginActivity}; have you declared this activity in your AndroidManifest.xml?
The fact is that I indeed declared the Activity in the Manifest so I can't understand why it does not see it.
Any solutions? Thanks.