apache / cordova-plugin-file

Apache Cordova File Plugin
https://cordova.apache.org/
Apache License 2.0
742 stars 759 forks source link

My Capacitor App stops at Splash Screen after installing cordova-plugin-file #478

Closed UsamaParkar closed 2 years ago

UsamaParkar commented 3 years ago

Bug Report

My App stops at splash screen and does not proceed further after installing the file plugin

Problem

I'm working on a capacitor 2.0 Application. I need to integrate the file plugin inside my project. I'm working with Windows and building in Android. Before Installation, my project builds and runs fine. I do not face any issues. But after performing the installation, it just stops at Splash Screen.

What is expected to happen?

The App should run normally, after installing the plugin, should not stop.

What does actually happen?

The App does not provide any errors, just halts at SplashScreen.

Information

I have followed the installation steps from Ionic docs: npm install cordova-plugin-file npm install @ionic-native/file ionic cap sync I had also added it in my providers. But the App halts at splash screen, does not proceed further. I checked the chrome debugger to watch for any errors, but it was clean. So I thought maybe it would break somewhere before calling SplashScreen.hide. I did a complete console.log of my entire component.ts file where I was hiding the splashscreen after start. But the constructor was never initiated. It did not get to that part, so there were no logs in the debugger as well. I also performed a production build of my application to see if it provides any errors, but it built successfully and took me to Android Studio. I tried installing some other basic native plugin from ionic docs to see if compatibility with native plugins is the issue or not, but the project worked fine with other native cordova plugins. I had also included the appropriate file permissions in my manifest.xml file. The issue is not specific to the plugin itself, as I tried the plugin on a fresh app, and it worked quite well. But after Installation on the existing project the app does not work. The only issue that I can think of is that, it might be having some compatibility issues with some other plugins, so I have posted my package.json below, to see if some one had experienced this issue with the packages that I have been using before or not.

Command or Code

Environment, Platform, Device

Platform: Android Device: Redmi Note 5 Pro/Emulator Pixel 2 XL API 30

Version information

"dependencies": { "@aeins/salesappapi": "2.6.0-2104120704", "@aeins/shared": "1.1.3", "@angular/animations": "11.2.3", "@angular/cdk": "11.2.3", "@angular/common": "11.2.3", "@angular/core": "11.2.3", "@angular/flex-layout": "11.0.0-beta.33", "@angular/forms": "11.2.3", "@angular/localize": "11.2.3", "@angular/material": "11.2.3", "@angular/platform-browser": "11.2.3", "@angular/platform-browser-dynamic": "11.2.3", "@angular/router": "11.2.3", "@capacitor-community/sqlite": "2.9.15", "@capacitor/android": "2.4.7", "@capacitor/core": "2.4.6", "@capacitor/ios": "2.4.6", "@googlemaps/js-api-loader": "1.11.4", "@ionic-native/android-permissions": "5.32.1", "@ionic-native/app-version": "5.31.1", "@ionic-native/battery-status": "5.33.0", "@ionic-native/core": "5.31.1", "@ionic-native/device": "5.31.1", "@ionic-native/diagnostic": "5.31.1", "@ionic-native/file": "5.33.1", "@ionic-native/geolocation": "5.33.1", "@ionic-native/network": "5.33.0", "@ionic-native/sim": "5.33.0", "@ionic-native/splash-screen": "5.31.1", "@ionic-native/sqlite": "5.31.1", "@ionic-native/sqlite-db-copy": "5.32.0", "@ionic-native/sqlite-porter": "5.31.1", "@ionic-native/status-bar": "5.31.1", "@ionic-native/wifi-wizard-2": "5.33.0", "@ionic/angular": "5.5.4", "@ng-bootstrap/ng-bootstrap": "9.1.0", "@ngx-translate/core": "13.0.0", "@ngx-translate/http-loader": "6.0.0", "@types/crypto-js": "4.0.1", "@types/googlemaps": "3.43.3", "capacitor-blob-writer": "0.2.0", "capacitor-resources": "2.0.5", "cordova-plugin-android-permissions": "1.1.2", "cordova-plugin-app-version": "0.1.12", "cordova-plugin-battery-status": "2.0.3", "cordova-plugin-dbcopy": "2.1.2", "cordova-plugin-device": "2.0.3", "cordova-plugin-device-name": "1.3.5", "cordova-plugin-file": "6.0.2", "cordova-plugin-geolocation": "4.1.0", "cordova-plugin-network-information": "2.0.2", "cordova-plugin-sim": "1.3.3", "cordova-plugin-splashscreen": "6.0.0", "cordova-plugin-statusbar": "2.4.3", "cordova-plugin-wifiwizard2": "3.1.1", "cordova-sqlite-storage": "6.0.0", "cordova.plugins.diagnostic": "6.0.3", "crypto-es": "1.2.7", "es6-promise-plugin": "4.2.2", "linqts": "1.14.4", "lodash": "4.17.21", "md5-ts": "0.1.6", "moment": "2.29.1", "ng2-pdf-viewer": "6.4.1", "ngx-custom-validators": "11.0.1", "ngx-pagination": "5.0.0", "rxjs": "6.6.6", "semver": "7.3.4", "tslib": "2.1.0", "uk.co.workingedge.cordova.plugin.sqliteporter": "1.1.1", "webfontloader": "1.6.28", "wifiwizard": "0.2.11", "ws-capacitor-secure-storage": "1.0.3", "zone.js": "0.11.4" }, "devDependencies": { "@angular-devkit/build-angular": "0.1102.2", "@angular-eslint/builder": "2.0.2", "@angular-eslint/eslint-plugin": "2.0.2", "@angular-eslint/schematics": "2.0.2", "@angular-eslint/template-parser": "2.0.2", "@angular/cli": "11.2.2", "@angular/compiler": "11.2.3", "@angular/compiler-cli": "11.2.3", "@angular/language-service": "11.2.3", "@capacitor/cli": "2.4.6", "@ionic/angular-toolkit": "3.1.0", "@types/jasmine": "3.6.4", "@types/jasminewd2": "2.0.8", "@types/lodash": "4.14.168", "@types/node": "14.14.31", "@typescript-eslint/eslint-plugin": "4.21.0", "@typescript-eslint/parser": "4.21.0", "codelyzer": "6.0.1", "cordova-res": "0.15.3", "eslint": "7.23.0", "eslint-config-standard": "16.0.2", "eslint-plugin-import": "2.22.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "4.3.1", "jasmine-core": "3.6.0", "jasmine-spec-reporter": "~6.0.0", "karma": "6.1.1", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "2.0.3", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "4.0.1", "karma-jasmine-html-reporter": "^1.5.0", "ng-mocks": "11.10.1", "ng-packagr": "11.2.4", "protractor": "~7.0.0", "ts-node": "9.1.1", "tslint": "6.1.3", "tslint-consistent-codestyle": "1.16.0", "typescript": "4.0.5" }, "cordova": { "plugins": { "cordova-plugin-file-transfer": {} } }

Checklist

breautek commented 2 years ago

I checked the chrome debugger to watch for any errors, but it was clean.

If the JS console is clean, then it suggests that either the JS isn't loading (perhaps it's waiting on an event or something) or that something is happening on the native side where it creates the webview, but fails to actually load the web assets (in this case, the webview should be in a about:blank context.)

It's not clear but it sounds like you're having the issue in the android platform. I'd advise opening up your project in android studio and run/debug your app from there, where you have easier access to the native console. Alternatively you can use the adb logcat command to watch the native console, but it produces a lot of excess noise and the filtering flags are kinda complicated to use.

This is the kind of issue where you'll need to provide a minimum production app. If you can't reproduce the issue without third-party frameworks such as ionic / capacitor, then that suggests that the issue doesn't actually rely in the Cordova codebase.

breautek commented 2 years ago

Closing as stale.