Open ircmgr opened 4 years ago
Hi,
I got exactly de same problem. Any updates?
i just used https://github.com/phonegap/phonegap-plugin-barcodescanner and fixed my issues. this project looks like deprecated/ unmaintained
Any updates on this? I have this exact problem with cordova-plugin-fcm-with-dependecy-updated and cordova-plugin-firebase-messaging. I'm surprised this hasn't been fixed yet.
Well that was a bust. I couldn't use phonegap-plugin-barcodescanner. That one has the same problem with building. I'm stuck.
Hi, I am also facing same issue. Any one having solution??
Niether qrscanner
nor barcodescanner
is working with fcm. The problem is that fcm is using the androidx package while both of those packages are still using the com.android.support
(old support libraries).
To solve it do the following, open the gradle.properties
file and add:
android.useAndroidX=true
android.enableJetifier=true
Then sync the project, its better if you do this on android studio and not vscode. Then open the QRScanner.java
file and remove the import android.support.v4.app.ActivityCompat
and instead add import androidx.core.app.ActivityCompat;
. Also in IonicWebViewEngine.java
file replace import android.support.annotation.RequiresApi;
with import androidx.annotation.RequiresApi;
and you will get build successful.
The above was done using cordova-andorid:8.0.0
. In cordova-android:9.0.0
I think ionic migrated to androidx, so all you have to do is change gradle.properties
and change in QrScanner.java
.
You can check the mapping of the old support libraries with androidx here:
https://developer.android.com/jetpack/androidx/migrate/class-mappings
what can possible conflict between these two ?
Reproduce : create a project and add both cordova-plugin-fcm-with-dependecy-updated and cordova-plugin-qrscanner
execute cordova run and it will fail with :
`
D8: Program type already present: android.support.v4.os.ResultReceiver
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 8s
`
if you now change what you import first or re install the android platform (8.1.0) it fails with `D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
Try:> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED 35 actionable tasks: 35 executed
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.`