EinfachHans / cordova-plugin-dfu-update

7 stars 20 forks source link

(bug): Could not find no.nordicsemi.android:dfu:1.11.0 with cordova-android version 10.0 #7

Closed jacywang closed 3 years ago

jacywang commented 3 years ago

Bug Report

Current Behavior: In building the Ionic Android app, the following error showed up in running ionic cordova build android. It seems the plugin is not compatible with cordova-android 10. Could not find no.nordicsemi.android:dfu:1.11.0.

Screen Shot 2021-08-22 at 4 42 58 PM

Environment

Expected Behavior: The plugin should be able to find dfu-1.11.0 and ionic cordova build androidshould run successfully.

EinfachHans commented 3 years ago

I'm building with cordova-android@10 myself without any problems. Also the error doesn't looks like a Cordova related one.

So i would research for general dependency installation problems 🤔

jacywang commented 3 years ago

Do you mind share your environment info? Such as java version, gradle version, cordova cli version, ionic version, etc. I have tried different things and this error keeps showing up.

import no.nordicsemi.android.dfu.DfuBaseService; is not found.

Screen Shot 2021-08-23 at 9 32 16 PM
EinfachHans commented 3 years ago
Ionic:

   Ionic CLI                     : 6.17.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.14
   @angular-devkit/build-angular : 12.2.2
   @angular-devkit/schematics    : 12.2.2
   @angular/cli                  : 12.2.2
   @ionic/angular-toolkit        : 4.0.0

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 10.1.0, ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 51 other plugins)

Utility:

   cordova-res (update available: 0.15.3) : 0.15.1
   native-run (update available: 1.4.0)   : 1.0.0

System:

   Android SDK Tools : 25.2.3 (/Users/hanskrywalsky/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v14.15.4 (/usr/local/bin/node)
   npm               : 7.17.0
   OS                : macOS Big Sur
   Xcode             : Xcode 12.5.1 Build version 12E507

I would try to reinstall everything, the dependency definitely exists

jacywang commented 3 years ago

Thanks, really appreciate it. I'm wondering if it's due to the gradle version. In transform-3 folder of gradle 7.2, it doesn't have the DfuBaseService while the lower version has a folder called transform-2 which has the DfuBaseService. I'm also resetting my android dev environment to verify. I will keep you posted.

jacywang commented 3 years ago

@EinfachHans I have tried with a blank new ionic project with cordova-android@10.1.0 and the android build failed with the same errors. Once I downgraded to codova-android@9.0.0, the build was created successfully. The errors: **> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

Could not find no.nordicsemi.android:dfu:1.11.0. Searched in the following locations:

cordova-android@9.0.0 is using grade 6.5 and cordova-android@10.1.0 is using grade 7.2 which doesn't have the Android DFU Library fetched and it led the errors before. That's my assumption.

Here is my enviroment, Ionic: Ionic CLI : 6.11.8 (/Users/jianwang/.nvm/versions/node/v12.16.2/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.6.14 @angular-devkit/build-angular : 12.1.4 @angular-devkit/schematics : 12.1.4 @angular/cli : 12.1.4 @ionic/angular-toolkit : 4.0.0

Cordova: Cordova CLI : 10.0.0 Cordova Platforms : android 10.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)

Utility: cordova-res (update available: 0.15.3) : 0.15.1 native-run (update available: 1.4.0) : 1.3.0

System: Android SDK Tools : 26.1.1 (/Users/jianwang/Library/Android/sdk) ios-deploy : 1.11.2 ios-sim : 6.1.2 NodeJS : v12.16.2 (/Users/jianwang/.nvm/versions/node/v12.16.2/bin/node) npm : 6.14.8 OS : macOS Big Sur Xcode : Xcode 12.3 Build version 12C33

jacywang commented 3 years ago

@EinfachHans I also posted the issue here and hopefully get some insights.

jacywang commented 3 years ago

@EinfachHans Puzzle is resolved. Upgrade ANDROID_NORDIC_VERSION from 1.11.0 to 1.11.1 resolved the issue.

"cordova-plugin-dfu-update": {
        "ANDROID_NORDIC_VERSION": "1.11.1"
}
timrach commented 2 years ago

@EinfachHans Puzzle is resolved. Upgrade ANDROID_NORDIC_VERSION from 1.11.0 to 1.11.1 resolved the issue.

"cordova-plugin-dfu-update": {
        "ANDROID_NORDIC_VERSION": "1.11.1"
}

@jacywang In which file do I have to put this?

Sebartus commented 1 year ago

@EinfachHans Puzzle is resolved. Upgrade ANDROID_NORDIC_VERSION from 1.11.0 to 1.11.1 resolved the issue.

"cordova-plugin-dfu-update": {
        "ANDROID_NORDIC_VERSION": "1.11.1"
}

How and where did you update this ? - the same problem occurs in the most recent cordova android@11.0.0

I update this in:

to the latest 2.2.0 but I still get the same error: Could not find no.nordicsemi.android:dfu:1.11.0.