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

Unable to install 2.0.7 #267

Open
albertleao opened this issue Mar 26, 2023 · 12 comments
Open

Unable to install 2.0.7 #267

albertleao opened this issue Mar 26, 2023 · 12 comments

Comments

@albertleao
Copy link

albertleao commented Mar 26, 2023

So the latest dev version blows up with the error here: #183

And version 2.0.7 doesn't install after running cordova plugin add @spoonconsulting/cordova-plugin-background-upload@2.0.7 --save

  • Cordova version 11.1
  • Android cordova version 11
Failed to install '@spoonconsulting/cordova-plugin-background-upload': TypeError: Cannot read property 'id' of undefined
    at registerConflict (C:\Users\alber\Documents\Projects\test\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:253:43)
    at C:\Users\alber\Documents\Projects\test\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:278:34
    at Array.forEach (<anonymous>)
    at PlatformMunger._is_conflicting (C:\Users\alber\Documents\Projects\test\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:257:21)
    at PlatformMunger.add_plugin_changes (C:\Users\alber\Documents\Projects\test\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:106:59)
    at C:\Users\alber\Documents\Projects\test\node_modules\cordova-common\src\PluginManager.js:121:33
    at _fulfilled (C:\Users\alber\Documents\Projects\test\node_modules\q\q.js:854:54)
    at C:\Users\alber\Documents\Projects\test\node_modules\q\q.js:883:30
    at Promise.promise.promiseDispatch (C:\Users\alber\Documents\Projects\test\node_modules\q\q.js:816:13)
    at C:\Users\alber\Documents\Projects\test\node_modules\q\q.js:877:14

This is on a brand new cordova project with no other plugins. Issue doesn't happen if i revert android back to 10

@zfir
Copy link
Member

zfir commented Mar 27, 2023

Hello @albertleao,

What version of node and npm are you using?

Screenshot 2023-03-27 at 09 53 00

I was able to include it in these version as shown in the above screenshot.

@albertleao
Copy link
Author

Node 14.16.1
NPM 6.14.22

Will attempt with your version.

@albertleao
Copy link
Author

image

@albertleao
Copy link
Author

Also tried on a brand new cordova project and got the same error

@zfir
Copy link
Member

zfir commented Mar 28, 2023

Hello @albertleao,

Is it possible to send me your package.json? I am not able to reproduce it on my side.

@albertleao
Copy link
Author

issue is also happening on 10.1.1 now.

{
  "name": "app",
  "version": "5.0.0",
  "description": "native applications",
  "main": "www/index.html",
  "scripts": {
    "cordova": "cordova"
  },
  "repository": {
    "type": "git",
    "url": "scrubbed"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "scrubbed"
  },
  "homepage": "scrubbed",
  "dependencies": {
    "@ahovakimyan/cordova-plugin-wkwebviewxhrfix": "^1.0.0",
    "@gedysintraware/cordova-universal-links-plugin": "git+https://github.com/GEDYSIntraWare/cordova-universal-links-plugin.git",
    "@havesource/cordova-plugin-push": "4.0.0-dev.0",
    "@spoonconsulting/cordova-plugin-background-upload": "2.0.7",
    "@spoonconsulting/cordova-plugin-camera": "git+https://github.com/spoonconsulting/cordova-plugin-camera.git",
    "cordova-labs-notification-rebroadcast": "git+https://github.com/apache/cordova-plugins.git#notification-rebroadcast",
    "cordova-plugin-android-support-v4-jar": "^23.2.1",
    "cordova-plugin-androidx": "1.0.2",
    "cordova-plugin-androidx-adapter": "1.1.0",
    "cordova-plugin-file": "6.0.2",
    "cordova-plugin-local-notifications": "^1.0.0",
    "cordova-splash": "github:AlexDisler/cordova-splash",
    "file": "^0.2.2",
    "jetifier": "^2.0.0",
    "phonegap-plugin-multidex": "^1.0.0",
    "plugin": "^0.3.3",
    "properties-parser": "^0.3.1",
    "recursive-readdir": "^2.2.2",
    "rollbar": "^2.3.8"
  },
  "cordova": {
    "plugins": {
      "@havesource/cordova-plugin-push": {
        "ANDROIDX_CORE_VERSION": "1.6.+",
        "FCM_VERSION": "23.+"
      }
    },
    "platforms": []
  },
  "devDependencies": {
    "cordova-android": "^10.1.1",
    "eslint-plugin-vue": "^6.2.2"
  }
}

@albertleao
Copy link
Author

When you say it installs for you, is it actually working? Depending on my config, i can get it to install but I haven't gotten it to actually upload anything

@albertleao
Copy link
Author

What version of gradle are you using?

@zfir
Copy link
Member

zfir commented Mar 29, 2023

Hello @albertleao,

So you are were able to fixed the error Failed to install...? I have not not tested the upload as your error was on the installation process(when adding the plugin).

I have tested by copying all the plugins(in your package.json) in a new project and was not able to reproduce the error.

As for the Gradle version, I am using is 8.0.2. I have some other project that is running this plugin and is using version 7.1.1.

@albertleao
Copy link
Author

Are you adding via npm or using cordova plugin add?

Still 0 luck installing and using this plugin. Worked fine a few months ago.

@albertleao
Copy link
Author

After tweaking a bunch of settings I managed to get it to install but now running into this issue


E/PluginManager: Uncaught exception from plugin
    android.database.sqlite.SQLiteException: Can't downgrade database from version 4 to 1
        at android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:540)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:414)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
        at com.orm.SugarDb.getDB(SugarDb.java:38)
        at com.orm.SugarRecord.getSugarDataBase(SugarRecord.java:35)
        at com.orm.SugarRecord.find(SugarRecord.java:201)
        at com.orm.SugarRecord.listAll(SugarRecord.java:127)
        at com.spoon.backgroundfileupload.UploadEvent.all(UploadEvent.java:41)
        at com.spoon.backgroundfileupload.FileTransferBackground.initManager(FileTransferBackground.java:185)
        at com.spoon.backgroundfileupload.FileTransferBackground.execute(FileTransferBackground.java:129)
        at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
        at org.apache.cordova.PluginManager.exec(PluginManager.java:146)
        at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
        at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:335)
        at android.os.Looper.loopOnce(Looper.java:161)
        at android.os.Looper.loop(Looper.java:288)
        at android.os.HandlerThread.run(HandlerThread.java:67)

@zfir
Copy link
Member

zfir commented Mar 30, 2023

Hello @albertleao,

Have you installed another version of background upload before, the latest versions(4.0....)? If you have done that, try to clear data/cache on the device that you are testing.

Another possibility is that another plugin is using the SQLite Database. For that, I will recommend you to install the latest version 4.0.10 as we are already using version 4 for the database.

@Database(entities = {UploadEvent.class, PendingUpload.class}, version = 4)

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

2 participants