Skip to content
The Chat Archive
gpt-3.5-turbo-0301· OpenAI WildChat-4.8M (AI2)

Provider com.fasterxml.aalto.stax.EventFactoryImpl not found when use android:sharedUserId

  1. User

    Provider com.fasterxml.aalto.stax.EventFactoryImpl not found when use android:sharedUserId

  2. Assistant

    This error occurs because when android:sharedUserId is used, the context of the application changes, and the EventFactoryImpl class is not found in this new context.

    To resolve this issue, you can try the following solution:

    1. Add the following code to your app's build.gradle file:
    android {
        // ...
        defaultConfig {
            // ...
            multiDexEnabled true
        }
        // ...
    }
    dependencies {
        // ...
        implementation 'com.android.support:multidex:1.0.3'
        // ...
    }
    
    1. Add the following code to your Application class or create a new one if you haven't already:
    public class MyApplication extends Application {
    
        @Override
        protected void attachBaseContext(Context base) {
            super.attachBaseContext(base);
            MultiDex.install(this);
        }
    }
    
    1. Add the following code to your AndroidManifest.xml file within the application tag:
    <application
        android:name=".MyApplication"
        android:sharedUserId="com.example.sharedUserId"
        //...
        >
        //...
    </application>
    

    Note: Replace com.example.sharedUserId with your own sharedUserId value.

    This solution enables the use of multidex in your application, which solves the problem of class not found in the new application context.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.