sumup / sumup-android-sdk

Sample App for the SumUp Android SDK
Other
107 stars 28 forks source link

Build failed after adding the com.sumup:merchant-sdk dependency (net.openid.appauth.AuthorizationService could not be resolved) #233

Open petergoczan opened 5 days ago

petergoczan commented 5 days ago

Hi,

I want to integrate the API into my application, but as soon as I add implementation("com.sumup:merchant-sdk:5.0.3") to my app/build.gradle, I'm getting the following build error:

error: ComponentProcessingStep was unable to process 'com.myapp.MyApplication_HiltComponents.SingletonC' because 'net.openid.appauth.AuthorizationService' could not be resolved.

Dependency trace: => element (CLASS): com.sumup.identity.auth.implementation.di.HiltAuthModule.Companion => element (METHOD): provideAuthorizationService(android.content.Context) => type (EXECUTABLE method): (android.content.Context)net.openid.appauth.AuthorizationService => type (ERROR return type): net.openid.appauth.AuthorizationService

If type 'net.openid.appauth.AuthorizationService' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'net.openid.appauth.AuthorizationService' is on your classpath.

I have found that the reason might be that the net.openid.appauth.AuthorizationService class, which is a dependency of the SumUp SDK, is missing from my project. However if I add it as a dependency as well (implementation("net.openid:appauth:0.11.1")), I'm getting a different error: Caused by: java.lang.RuntimeException: Manifest merger failed : Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided. at com.android.build.gradle.internal.tasks.manifest.ManifestHelperKt.mergeManifests(ManifestHelper.kt:125) at com.android.build.gradle.internal.tasks.manifest.ManifestHelperKt.mergeManifests$default(ManifestHelper.kt:46) at com.android.build.gradle.tasks.ProcessApplicationManifest.doTaskAction(ProcessApplicationManifest.kt:162) at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:79) at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51) at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:78)

petergoczan commented 2 days ago

FYI I have "debugged" this by creating a new project and adding the dependencies and the code changes one by one, so I can now see where this is breaking. This is still not resolved, but if I remove the hilt implementation from the app (not the dependencies, just all the @Inject stuff, the @HiltAndroidApp and the @AndroidEntryPoint), the the code works again.

petergoczan commented 2 days ago

Checking this further, I can still use Hilt if I downgrade the SumUp SDK version to 4.3.0. Please check why it doesn't work with newer versions.

Details: