Search code examples
androidactivitynotfoundexception

Activity not found on some devices only


I am running into an issue where Android gives me the ActivityNotFoundException error.

The code is extremely straightforward and run on every devices so far. At least up until a couple of days ago where I had a dozen crashes ALL coming from the same phone (but different users!): the Galaxy XCover Pro (Android 12)

Here's the code:

  Intent intent = new Intent(context, CallActivity.class);
        intent.setAction(Intent.ACTION_SEND);
        intent.setFlags(0);
        intent.putExtra(KEY_IS_ANDROID_TO_ANDROID_CALL, isAppToAppCall);
        intent.putExtra(KEY_STARTED_FROM_NOTIFICATION, callStartedFromNotification);
        intent.putExtra(KEY_IS_INITIATOR, false);
        intent.setType("text/plain");
        startActivity(intent);

As you can see, it doesn't get any easier than this... Of course I declared the activity in my manifest:

 <activity
            android:name="arvuz.CallActivity"
            android:exported="false"
            android:configChanges="orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH"/>
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable"/>
        </activity>

This code has been running on production for years now, nothing has changed anywhere regarding this class or my manifest. It is stil running on production on every devices as far as I know, except for this one.

Here's the error report that I received from Crashlytics (confirmed by some clients also):

Fatal Exception: android.content.ActivityNotFoundException: Unable to find explicit activity class {arvuz.mobile/arvuz.CallActivity}; have you declared this activity in your AndroidManifest.xml?

I'd like to avoid buying this device just to fix that issue.

Does anyone know what could be the problem here? Thanks for the help.


Solution

  • Never mind, it turns out it came from an internal settings on all company phone blocking the camera access.