dpa99c/cordova-plugin-androidx

Not compatible with cordova-plugin-facebook4

Closed this issue · 3 comments

I'm submitting a ...

  • [x ] bug report
  • feature request
  • documentation issue

Current behavior:
When I use this plugin along with cordova-plugin-facebook4, I get below error during build:

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
error: resource style/Theme.AppCompat.NoActionBar (aka com.akasdigitalstudio.test:style/Theme.AppCompat.NoActionBar) not found.
error: resource style/Theme.AppCompat.Dialog (aka com.akasdigitalstudio.test:style/Theme.AppCompat.Dialog) not found.
error: failed linking references.

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.
23 actionable tasks: 21 executed, 2 up-to-date

Get more help at https://help.gradle.org
BUILD FAILED in 10s
D:\Freelancer\PhoneGap\test\platforms\android\gradlew: Command failed with exit
code 1 Error output:
FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
error: resource style/Theme.AppCompat.NoActionBar (aka com.akasdigitalstudio.test:style/Theme.AppCompat.NoActionBar) not found.
error: resource style/Theme.AppCompat.Dialog (aka com.akasdigitalstudio.test:style/Theme.AppCompat.Dialog) not found.
error: failed linking references.

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

Expected behavior:

Build should go successful

Steps to reproduce:

  1. Create a new cordova project
  2. Add platform Android
  3. Add cordova-plugin-androidx
  4. Add cordova-plugin-androidx-adapter
  5. Add cordova-plugin-facebook4
  6. Run cordova clean android
  7. Run cordova build android

Environment information

  • Cordova CLI version
    • 9.0.0
  • Cordova platform version
    • android 8.0.0
    • browser 6.0.0
  • Plugins & versions installed in project (including this plugin)
    • cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
    • cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
    • cordova-plugin-camera 4.1.0 "Camera"
    • cordova-plugin-customurlscheme 4.4.0 "Custom URL scheme"
    • cordova-plugin-device 2.0.3 "Device"
    • cordova-plugin-file 6.0.2 "File"
    • cordova-plugin-file-transfer 1.7.1 "File Transfer"
    • cordova-plugin-firebase-authentication 3.0.0 "cordova-plugin-firebase-authentication"
    • cordova-plugin-firebase-messaging 3.0.0 "FirebaseMessagingPlugin"
    • cordova-plugin-geolocation 4.0.2 "Geolocation"
    • cordova-plugin-googleplus 8.1.2 "Google SignIn"
    • cordova-plugin-inappbrowser 3.1.0 "InAppBrowser"
    • cordova-plugin-splashscreen 5.0.3 "Splashscreen"
    • cordova-plugin-whitelist 1.3.4 "Whitelist"
    • cordova-plugin-x-socialsharing 5.6.1 "SocialSharing"
    • cordova-support-android-plugin 1.0.1 "cordova-support-android-plugin"
    • cordova-support-google-services 1.3.1 "cordova-support-google-services"
    • es6-promise-plugin 4.2.2 "Promise"
  • Dev machine OS and version, e.g.
    • Windows 7

Android build issue:

  • Node JS version
    • 10.16.0
  • Gradle version
    • 3.3.0
  • Target Android SDK version
    • 28

Check your error again.
I was able to add both the plugins.

This plugin simply enables AndroidX in the native Android Studio project of a Cordova project.
If the build fails, it's likely because it contains native code (from other plugins) which reference the deprecated Android Support Library.
You may be able to use cordova-plugin-androidx-adapter to dynamically patch the source code of these plugins.

I verify that with cordova-plugin-androidx-adapter it was built fine.