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

Build error after installing (Program type already present: android.support.v4.os.ResultReceiver$1) #52

Closed
ajuanjojjj opened this issue Apr 20, 2020 · 6 comments

Comments

@ajuanjojjj
Copy link

Hi, I'm not getting to build the app after installing the plugin, gradle fails with D8: Program type already present: android.support.v4.os.ResultReceiver$1 exception

  • What went wrong:
    Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Program type already present: android.support.v4.os.ResultReceiver$1
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

@ajuanjojjj
Copy link
Author

ajuanjojjj commented Apr 20, 2020

Im assuming this will also be needed:

(trimmed) project.json before installing (build works)

"dependencies": {
"cordova-android": "^8.1.0",
"cordova-browser": "^6.0.0",
"cordova-plugin-bluetooth": "^2.0.4",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-request-location-accuracy": "^2.3.0",
"cordova-plugin-screen-orientation": "^3.0.2",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-wifiwizard2": "git+https://github.com/tripflex/wifiwizard2.git",
"cordova-plugin-x-socialsharing": "^5.6.0",
"cordova-plugin-x-toast": "^2.7.2",
"cordova-wheel-selector-plugin": "^1.1.3",
"cordova.plugins.diagnostic": "^5.0.1",
"es6-promise-plugin": "^4.2.2",
"jquery-validation": "^1.19.1",
"skwas-cordova-plugin-datetimepicker": "file:../skwas-cordova-plugin-datetimepicker"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-vibration": {},
"cordova-wheel-selector-plugin": {},
"skwas-cordova-plugin-datetimepicker": {},
"cordova-plugin-dialogs": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
"cordova-plugin-x-toast": {},
"cordova-plugin-bluetooth": {},
"wifiwizard2": {},
"cordova-plugin-request-location-accuracy": {
"PLAY_SERVICES_LOCATION_VERSION": "16.+"
},
"cordova.plugins.diagnostic": {
"ANDROID_SUPPORT_VERSION": "24.1.1+"
}
},
"platforms": [
"browser",
"android"
]
},

installing the plugin adds "cordova-plugin-fcm-with-dependecy-updated": "^6.0.0", to dependencies and
"cordova-plugin-fcm-with-dependecy-updated": { "FCM_VERSION": "19.0.0", "GRADLE_TOOLS_VERSION": "3.5.3", "GOOGLE_SERVICES_VERSION": "4.3.3", "SUPPORT_LIBRARY_VERSION": "28.0.0", "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher" } to cordova.plugins.

Changing SUPPORT_LIBRARY_VERSION to "24.1.1+" doesnt seem to affect the issue.

@QuentinChaumont
Copy link

Same problem with 6.0.1 version

@andrehtissot
Copy link
Owner

The v6.0.1 was specific to fix an iOS on ionic issue.

The issue, at a glance, is that there should be not android.support.v4 anymore in androidx.
I recommend to try to install:

cordova plugin add cordova-plugin-androidx
cordova plugin add cordova-plugin-androidx-adapter

That should handle the migration on build.
I could be useful if you tried and followed up with the results.

@QuentinChaumont
Copy link

QuentinChaumont commented Apr 20, 2020

Thank you !!
That fix my build problem.

@ajuanjojjj
Copy link
Author

Working on my end too, thank you very much!

@samit-s3752136
Copy link

The issue I seem to be getting is
D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub

> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: android.support.v4.app.INotificationSideChannel$Stub

When I do as suggested by @andrehtissot, I get it to build successfully however I am using cordova-plugin-googleplus and that then has issues and fails to work. From my emulator I see the error in logcat as follows:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
2020-05-08 16:33:42.236 8397-8522/ W/System.err:     at com.google.android.gms.auth.api.Auth.<clinit>(Unknown Source:0)
2020-05-08 16:33:42.236 8397-8522/ W/System.err:     at nl.xservices.plugins.GooglePlus.buildGoogleApiClient(GooglePlus.java:181)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at nl.xservices.plugins.GooglePlus.execute(GooglePlus.java:97)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:117)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at android.os.MessageQueue.nativePollOnce(Native Method)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at android.os.MessageQueue.next(MessageQueue.java:336)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at android.os.Looper.loop(Looper.java:174)
2020-05-08 16:33:42.237 8397-8522/ W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:67)
2020-05-08 16:33:42.237 8397-8522/ W/System.err: Caused by: java.lang.ClassNotFoundException: com.google.android.gms.common.api.Api$zzf

My Ionic Info:

Ionic:

   Ionic CLI                     : 6.8.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 11 other plugins)

Utility:

   cordova-res (update available: 0.14.0) : 0.11.0
   native-run                             : 1.0.0

System:

   Android SDK Tools : 26.1.1 (/Users/user/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v12.14.1 (/usr/local/bin/node)
   npm               : 6.14.4
   OS                : macOS Catalina
   Xcode             : Xcode 11.4.1 Build version 11E503a

my package.json

"dependencies": {
    "@angular/common": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/fire": "^6.0.0",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@babel/compat-data": "^7.8.0",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/fcm": "^5.25.0",
    "@ionic-native/google-plus": "^5.23.0",
    "@ionic-native/in-app-browser": "^5.24.0",
    "@ionic-native/photo-viewer": "^5.24.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^5.0.0",
    "com-sarriaroman-photoviewer": "git+https://github.com/TdoubleG/photoviewer.git",
    "cordova-android": "^8.1.0",
    "cordova-ios": "5.1.1",
    "cordova-plugin-fcm-with-dependecy-updated": "^6.3.1",
    "cordova-plugin-googleplus": "^7.0.2",
    "cordova-plugin-inappbrowser": "^3.2.0",
    "cordova-res": "^0.11.0",
    "cordova-support-android-plugin": "^1.0.2",
    "cordova-support-google-services": "^1.4.0",
    "core-js": "^2.5.4",
    "firebase": "^7.13.2",
    "ngx-ionic-image-viewer": "^0.7.0",
    "rxjs": "~6.5.1",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.20",
    "@angular/cli": "8.3.26",
    "@angular/compiler": "~8.2.14",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@ionic/angular-toolkit": "^2.1.1",
    "@ionic/lab": "3.1.3",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "npm-force-resolutions": "0.0.3",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "com-sarriaroman-photoviewer": {},
      "cordova-plugin-googleplus": {
        "PLAY_SERVICES_VERSION": "11.8.0"
      },
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-fcm-with-dependecy-updated": {
        "FCM_VERSION": "19.0.0",
        "GRADLE_TOOLS_VERSION": "3.5.3",
        "GOOGLE_SERVICES_VERSION": "4.3.3",
        "SUPPORT_LIBRARY_VERSION": "28.0.0",
        "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }

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

No branches or pull requests

4 participants