FinanzRitter / nativescript-share-file

Send and share files to other apps in NativeScript using native OS APIs.
Apache License 2.0
5 stars 4 forks source link

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[ShareFile -> ShareFile]: #7

Open AAlex-11 opened 3 months ago

AAlex-11 commented 3 months ago

If the demo apps cannot help and there is no issue for your problem, tell us about it

I use Angular with last version of NS and Angular

     import { ShareFile } from '@finanzritter/nativescript-share-file';
     constructor(
              private shareFile: ShareFile
      ){}
     share(){
                this.shareFile.open({
                path: outfile.path,
                intentTitle: 'Send myVault to:'
               })
      }

Which platform(s) does your issue occur on?

Android

Please, provide the following version numbers that your issue occurs with:

webpack 5.88.2 compiled successfully in 634 ms Webpack compilation complete. Watching for file changes. Successfully synced application org.nativescript.MyVaultStart on device emulator-5554. Successfully transferred runtime.js on device emulator-5554. Successfully transferred bundle.js on device emulator-5554. Successfully transferred runtime.dc1630561d5fb35ef2ed.hot-update.js on device emulator-5554. Successfully transferred bundle.dc1630561d5fb35ef2ed.hot-update.js on device emulator-5554. Successfully transferred runtime.dc1630561d5fb35ef2ed.hot-update.json on device emulator-5554. Refreshing application on device emulator-5554... Angular is running in development mode. ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[ShareFile -> ShareFile]: NullInjectorError: No provider for ShareFile! NullInjectorError: R3InjectorError(AppModule)[ShareFile -> ShareFile]: NullInjectorError: No provider for ShareFile! at NullInjector.get (file: src\webpack:\myvaultstart\node_modules\@angular\core\fesm2022\core.mjs:8890:26) at R3Injector.get (file: src\webpack:\myvaultstart\node_modules\@angular\core\fesm2022\core.mjs:9334:32) at R3Injector.get (file: src\webpack:\myvaultstart\node_modules\@angular\core\fesm2022\core.mjs:9334:32) at ChainedInjector.get (file: src\webpack:\myvaultstart\node_modules\@angular\core\fesm2022\core.mjs:14018:35) at lookupTokenUsingModuleInjector (file: src\webpack:\myvaultstart\node_modules\@angular\core\fesm2022\core.mjs:4608:38) at getOrCreateInjectable (file: src\webpack:\myvaultstart\node_modules\@angular\core\fesm2022\core.mjs:4656:11) at Module.ɵɵdirectiveInject (file:///data/data/org.nativescript.MyVaultStart/files/ap... [HMR][dc1630561d5fb35ef2ed] success | Successfully applied update. device: emulator-5554 debug port: 40000

Please, tell us how to recreate the issue in as much detail as possible.

I have configured provider

ShareFileProvider-05302024_234740_1

And I use Angular - I inject module and try to use it

ShareFileProvider-05302024_235604_1

and than just white screen what is my mistake?

sc85 commented 3 months ago

@AAlex-11 I never used Angular and haven't touched NativeScript in more than 2 years. Nevertheless, I had a look at the demo app of the project and it did no longer work without some changes. Please have a look if this changes anything for you at all. Please note that the plugin does not fully work within an emulator but at least it should start.