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

Android build not working #27

Open
swapnaliDeveloper opened this issue Jul 5, 2023 · 4 comments
Open

Android build not working #27

swapnaliDeveloper opened this issue Jul 5, 2023 · 4 comments

Comments

@swapnaliDeveloper
Copy link

plugin version - https://www.npmjs.com/package/@idpass/smartscanner-capacitor
capacitor version - 5 (https://capacitorjs.com/docs/)

getting error in android studio as follows ,
image

@ManthanBhatt
Copy link

Hi
I'm also facing the same error for capacitor 5

Below I'm adding the error image, and version details for Ionic and Android Studio
image
image
image

@feldiazp
Copy link

the same problem here :(

@ManthanBhatt
Copy link

ManthanBhatt commented Sep 18, 2024

@feldiazp
I was able to fix this by making changes in the build of the files below
build.gradle - node_modules@idpass\smartscanner-capacitor\android\build.gradle
image
image

proguard-rules.pro - node_modules@idpass\smartscanner-capacitor\android\proguard-rules.pro
Add these lines at the end of the file
-dontwarn java.lang.invoke.StringConcatFactory -dontwarn org.idpass.lite.IDPassReader
image

This works for capacitor versions 5 and 6.

@feldiazp
Copy link

feldiazp commented Sep 18, 2024

Hi @ManthanBhatt, thanks for the help.
I made the changes you told me and I no longer get the same error, now I get errors that it does not find some dependencies of the smartscanner and another, they are these errors:
Failed to resolve: :smartscannerlib-debug
Failed to resolve: :smartscanner-mrz-parser

Captura de pantalla 2024-09-18 a la(s) 13 09 26
Captura de pantalla 2024-09-18 a la(s) 13 09 35
Captura de pantalla 2024-09-18 a la(s) 13 09 40

Do any of those appear to you?

UPDATE:
I downloaded those .aar files from Android/aar (https://github.com/newlogic/smartscanner-capacitor/tree/master/android/aar) and copied them to /app/libs and it stopped giving me that error.
Captura de pantalla 2024-09-18 a la(s) 13 55 25

Now I get this one:
Error:
android:exported needs to be explicitly specified for element <activity#org.idpass.smartscanner.lib.SmartScannerActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

UPDATE 2

You must edit the AndroidManifest.xml of 'smartscannerlib-debug' by adding 'android:exported="true"' inside the activities.
Captura de pantalla 2024-09-18 a la(s) 14 01 27

I managed to compile it but when opening the camera, after granting the permissions, the app crashes :(
This is the error on debug
Captura de pantalla 2024-09-18 a la(s) 14 28 58

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

3 participants