Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Integrating Persona SDK in Angular with Capacitor Plugin on Android #4

Open
anitamatyas opened this issue Dec 4, 2024 · 0 comments

Comments

@anitamatyas
Copy link

anitamatyas commented Dec 4, 2024

Hello,

I’m trying to integrate Persona SDK into an Angular project using the native Android SDK. My goal is to build a Capacitor plugin. However, after following the setup instructions in the documentation, I’m encountering a runtime error when including implementation 'com.withpersona.sdk2:inquiry:2.12.14' in the build.gradle dependencies.

Here is a snippet of my build.gradle file:


android {
  // ...
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
  }
}

repositories {
    flatDir{
        dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
    }
    google()
    mavenCentral()
    maven {
        url 'https://sdk.withpersona.com/android/releases'
    }
}

dependencies {
    implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
    implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation project(':capacitor-android')
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
    implementation project(':capacitor-cordova-android-plugins')
    implementation 'com.google.firebase:firebase-dynamic-links:21.0.0'
    implementation 'com.plaid.link:sdk-core:3.12.0'
    implementation 'com.google.android.gms:play-services-location:21.0.1'
    implementation 'com.withpersona.sdk2:inquiry:2.12.14'
}

When I add the Persona dependency, the app crashes at runtime with the following error message:

FATAL EXCEPTION: main Process: ..., PID: 9456 java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener; at android.app.ActivityThread.installProvider(ActivityThread.java:8297) at android.app.ActivityThread.installContentProviders(ActivityThread.java:7807) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7488) at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2416) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.app.ActivityThread.main(ActivityThread.java:8705) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886) Caused by: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener; at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) at android.content.ContentProvider.attachInfo(ContentProvider.java:2644) at android.content.ContentProvider.attachInfo(ContentProvider.java:2613) at android.app.ActivityThread.installProvider(ActivityThread.java:8292) at android.app.ActivityThread.installContentProviders(ActivityThread.java:7807)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7488)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2416)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loopOnce(Looper.java:232)  at android.os.Looper.loop(Looper.java:317)  at android.app.ActivityThread.main(ActivityThread.java:8705)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)  Caused by: androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener; at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)  at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)  at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2644)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2613)  at android.app.ActivityThread.installProvider(ActivityThread.java:8292)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:7807)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7488)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2416)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loopOnce(Looper.java:232)  at android.os.Looper.loop(Looper.java:317)  at android.app.ActivityThread.main(ActivityThread.java:8705)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)  Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener; at androidx.lifecycle.ProcessLifecycleInitializer.create(ProcessLifecycleInitializer.kt:37) at androidx.lifecycle.ProcessLifecycleInitializer.create(ProcessLifecycleInitializer.kt:25) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)  at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)  at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)  at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2644)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2613)  at android.app.ActivityThread.installProvider(ActivityThread.java:8292)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:7807)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7488)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2416)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loopOnce(Looper.java:232)  at android.os.Looper.loop(Looper.java:317)  at android.app.ActivityThread.main(ActivityThread.java:8705)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)  Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ReportFragment$ActivityInitializationListener" on path: DexPathList[[zip file at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259) at java.lang.ClassLoader.loadClass(ClassLoader.java:637) at java.lang.ClassLoader.loadClass(ClassLoader.java:573)

I suspect it could be related to a missing or conflicting dependency, but I’m unsure how to resolve it. Any insights or guidance would be greatly appreciated.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant