Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70434 articles
Browse latest View live

Android cordova plugin

$
0
0

@mithunstoreking wrote:

am basically a android native app developer.now i need to work on android cordova plugin development.could you please assist me with how to get start with that.

Posts: 1

Participants: 1

Read full topic


No provider for Storage! IONIC 4

$
0
0

@ravo93 wrote:

I correctly installed Ionic Storage on my IONIC project , but everytime I run the project it return me this error


This i my App.module
import { LoginPageModule } from './login/login.module';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { IonicStorageModule } from '@ionic/storage';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule } from '@angular/common/http';
import { ConfigurationPageModule } from './configuration/configuration.module';


@NgModule({
 declarations: [AppComponent,
 ],
 entryComponents: [
 ],
 imports: [
   BrowserModule,
   HttpClientModule,
   IonicModule.forRoot(),
   IonicStorageModule.forRoot(),
   FontAwesomeModule,
   AppRoutingModule,
   ConfigurationPageModule,
   LoginPageModule
 ],
 providers: [
   StatusBar,
   SplashScreen,
   { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
 ],
 bootstrap: [AppComponent]
})
export class AppModule { }

package.json

{
  "name": "testApp",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/router": "^7.2.2",
    "@fortawesome/angular-fontawesome": "^0.3.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.13",
    "@fortawesome/free-solid-svg-icons": "^5.7.0",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.0.0",
    "@ionic/pro": "2.0.4",
    "@ionic/storage": "^2.2.0",
    "cordova-sqlite-storage": "2.6.0",
    "core-js": "^2.5.4",
    "rxjs": "~6.3.3",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.12.3",
    "@angular-devkit/build-angular": "~0.12.3",
    "@angular-devkit/core": "~7.2.3",
    "@angular-devkit/schematics": "~7.2.3",
    "@angular/cli": "~7.2.3",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.3.0",
    "@types/node": "~10.12.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~8.0.0",
    "tslint": "~5.12.0",
    "typescript": "~3.1.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-sqlite-storage": {}
    }
  }
}

Posts: 1

Participants: 1

Read full topic

Como aplicar o estilo do primeNG no ionic 3?

$
0
0

@Lucas098 wrote:

Como aplicar o estilo do primeNG no ionic 3?
Sou iniciante no ionic, estou em duvida onde(qual arquivo) colocar as dependencias e o style no ionic 3.
Os componentes primeNG aparecem na aplicação ionic 3, mas não aparece estilizados e aparece o seguinte erro:

Refused to apply style from ‘’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Posts: 2

Participants: 2

Read full topic

Deeplinking ionic NavController

$
0
0

@maximegouin wrote:

Hello,

I’m trying to use the deeplinking plugin with navcontroller in my app.component buy it doesn’t work.
In fact it’s always redirect me on the homepage.

What’s wrong with this code?

this.deeplinks.route({
          '/login': LoginPage,
          '/post/:postId': PostPage
        }).subscribe(match => {
          this.navCtrl.push(match.$route, match.$args)
        }, nomatch => {
          // nomatch.$link - the full link data
          console.error('Got a deeplink that didn\'t match', nomatch);
        });

Thanks
Maxime

Posts: 1

Participants: 1

Read full topic

Migrating an existing Ionic 2 app to Ionic 4.0

$
0
0

@stromwerk wrote:

Hello, I have an existing Ionic 2 app and have decided that it’s time to migrate it to Ionic 4. I have looked around and found various guides for migrating to 4, however most of them are either from Ionic 1 or Ionic 3. My question is would a Ionic 3 to 4 guide work well for me, or should I take a different approach to migrating?

Posts: 1

Participants: 1

Read full topic

Linker command failed with exit code 1 ios build problem

$
0
0

@a7mdFo2ad wrote:

my was getting problem and stuck in splash screen after that I open the console in xcode and getting an error that I have to upgrade my facebook
then I open facebook developer and I got a message to update my sdk by updating my podfile by these lines

        pod 'FacebookSDK'
	pod 'FacebookSDK/LoginKit'
	pod 'FacebookSDK/ShareKit'
	pod 'FacebookSDK/PlacesKit'

	pod 'FBSDKMessengerShareKit'

then run `pod update’
after that, i opened the xocde to build and got this error and build failed

duplicate symbol _OBJC_IVAR_$_FBSDKLikeButton._likeActionController in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_CLASS_$_FBSDKLikeButton in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_METACLASS_$_FBSDKLikeButton in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_IVAR_$_FBSDKLikeButton._objectType in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_IVAR_$_FBSDKLikeButton._isExplicitlyDisabled in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_IVAR_$_FBSDKLikeButton._soundEnabled in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_IVAR_$_FBSDKLikeButton._objectID in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeButton.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeButton.o)
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._promotionText in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_CLASS_$_FBSDKAppInviteContent in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_METACLASS_$_FBSDKAppInviteContent in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._destination in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._promotionCode in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._appLinkURL in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
duplicate symbol _OBJC_IVAR_$_FBSDKAppInviteContent._appInvitePreviewImageURL in:
    /Users/anspireagency/Library/Developer/Xcode/DerivedData/Doctory-dumowpyuqkndphbakkgvmohbptmh/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKAppInviteContent.o)
    Doctory/Plugins/cordova-plugin-facebook4/FBSDKShareKit.framework/FBSDKShareKit(FBSDKAppInviteContent.o)
ld: 1192 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Posts: 3

Participants: 2

Read full topic

Ion-toast change background-color problem

$
0
0

@tynmas02 wrote:

Hello! I have created a component and inside it, I am using ion-toast. So I added cssClass to change the background-color of the toast. I have searched every topic regarding it, but nothing works. The docs are not helpful at all. What should I do in order to make it work? Basically I need two different classes based in post result. If I get an error, I want background-color: red and if I get a success, I want the .toast-message to have background-color: green. Any clues? Thank you.

Posts: 1

Participants: 1

Read full topic

Ionic native/core@5.0.0 error when compile

$
0
0

@JorchDeveloper wrote:

I update my component ionic native/core into 5.0.0 version because I need this version to work other plugin but when I compile with --prod give me a following error:

[16:42:09] typescript error
Error encountered resolving symbol values statically. Only initialized variables and constants can be
referenced because the value of this variable is needed by the template compiler (position 100:22 in the
original .ts file), resolving symbol Plugin in
C:/_programacion/node_modules/@ionic-native/core/decorators/interfaces.d.ts, resolving
symbol Plugin in C:/_programacion/node_modules/@ionic-native/core/index.d.ts, resolving
symbol StatusBar in C:/_programacion/node_modules/@ionic-native/status-bar/index.d.ts,
resolving symbol StatusBar in
C:/_programacion/node_modules/@ionic-native/status-bar/index.d.ts

[16:42:09] ionic-app-script task: “build”
[16:42:09] Error: The Angular AoT build failed. See the issues above
Error: The Angular AoT build failed. See the issues above
at C:_programacion\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
at step (C:_programacion\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
at Object.next (C:_programacion\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
at fulfilled (C:_programacion\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)
[ERROR] An error occurred while running subprocess ionic-app-scripts.

Posts: 1

Participants: 1

Read full topic


DateTime in the device's format

$
0
0

@radulung wrote:

How can i get the date and the time in the same format as the device format? When i change the device format i want to get the date in the new format.

Posts: 1

Participants: 1

Read full topic

Ionic select fill with dinamaical values of selected value?

$
0
0

@gaiapuffo wrote:

Hi,

I have a ionic select that i fill with for cycle

  <ion-select value="" ok-text="Ok" cancel-text="Annulla" formControlName="skill_level_id"
                       style="white-space: pre-line !important" value="7">
      <ion-select-option *ngFor="let skill_level of skill_levels" value="skill_level['id']">{{ skill_level['tcode'] }}</ion-select-option>
  </ion-select>

After I fill the select in my ts fill i make

this.skillForm.controls[“skill_level_id”].setValue(skill_level_id);

The problem is that if I open the select the value is selected but is not showing in the UI if I not open the select…
The are too many bugs…

Posts: 1

Participants: 1

Read full topic

Ionic 4 has no default styling?

$
0
0

@jfsoftwarellc wrote:

Does the Ionic 4 framework not include any default styling like the previous versions did? Started a default app and it looks like absolute shit. Buttons are just solid gray blocks instead of the bootstrap-esque style I’m used to. So far I’m REALLY not enjoying this upgrade. So much stuff changed for zero reason, so much stuff removed for zero reason, just making a whole lot more work I have to put in for zero gain. And the documentation so far is atrocious, either missing or flat-out wrong.

Posts: 1

Participants: 1

Read full topic

Ionic 4 background color isssues

Open detail page from tab tabs page and hide tabs

$
0
0

@Dubicki wrote:

I am using the tabs navigation and would like to open a detail page and not have the tabs at the bottom. I can achieve this by placing my detail rout in the app-routing.module.ts file but when I click the back button, I am redirected to the default route and not the route from which I came from. For example:

I have 2 tabs - Home and Messages. When in the Messages tab I can navigate to message detail, when I click back, I go to Home tab and not Messages tab.

Posts: 1

Participants: 1

Read full topic

How to split array of length 10 to 2 rows

$
0
0

@safaAlshaarri wrote:

hi everyone , i have issue where i have array where it’s 10 items i need each row have 5 items
where i need the first row to be
a b c d e

f g h i j

how i can do that
thank :slight_smile:

Posts: 1

Participants: 1

Read full topic

Ionic 3 and 4 folder structure

$
0
0

@RomanPuliyan wrote:

I got project, previous developer told, that used Ionic 3.
I don’t understand, what folder structure must to be.
Angular developer told, that all code must to be inside src/app folder.
But in my case, all code just inside /src folder - pages, providers, directives etc in one nesting level with “app” folder
My folder structure

src
  app
  directives
  providers
  pages

As my friend angular developer told, all code must be in src/app folder and structure must be like

src
  app
    directives
    providers
    pages

When I use in terminal command “ionic generate page|provider|directive” from different places (/src/, /src/app or even project root directory)
all this folders generates in src/ folder near app/ folder, but not inside it.
Is it right?
As I looked here https://github.com/ionic-team/ionic-conference-app/tree/master/src
all code places inside app/ folder.

I have Ionic CLI 4.8.0

IONIC 4
I tried to test. Created test empty project. CLI asked me, do I want to use Ionic 4?
I asked yes.
Generated page. It was created inside app/ directory, how I think must be

MacBook-Air-Roman:test roman$ ionic generate
? What would you like to generate? page
? Name/path of page: test-page
> ng generate page test-page
CREATE src/app/test-page/test-page.module.ts (554 bytes)
CREATE src/app/test-page/test-page.page.scss (0 bytes)
CREATE src/app/test-page/test-page.page.html (136 bytes)
CREATE src/app/test-page/test-page.page.spec.ts (706 bytes)
CREATE src/app/test-page/test-page.page.ts (267 bytes)
UPDATE src/app/app-routing.module.ts (462 bytes)
[OK] Generated page!

Directive also generated inside app/ folder

MacBook-Air-Roman:test roman$ ionic generate
? What would you like to generate? directive
? Name/path of directive: test-directive
> ng generate directive test-directive
CREATE src/app/test-directive.directive.spec.ts (253 bytes)
CREATE src/app/test-directive.directive.ts (155 bytes)
UPDATE src/app/app.module.ts (856 bytes)
[OK] Generated directive!

IONIC 3
After I created new test project, but on question to use Ionic 4 asked No.
Generated page from project root directory, in my case “test2”

MacBook-Air-Roman:test2 roman$ ionic generate
? What would you like to generate: page
? What should the name be? test-page
[OK] Generated a page named test-page!

Page created inside src/ folder, near app/folder

drwxr-xr-x  7 roman  staff   224 Jan 31 18:44 app
drwxr-xr-x  4 roman  staff   128 Jan 31 18:44 assets
-rw-r--r--  1 roman  staff  1655 Jan 31 17:41 index.html
-rw-r--r--  1 roman  staff   266 Jan 31 17:41 manifest.json
drwxr-xr-x  4 roman  staff   128 Jan 31 18:46 pages
-rw-r--r--  1 roman  staff   741 Jan 31 17:41 service-worker.js
drwxr-xr-x  3 roman  staff    96 Jan 31 18:44 theme

Also generated directive, placed near app/ directory, like before with page.

Main questions:

  1. Is it right with Ionic 3? Maybe if “ionic generate something” place all in src/ folder, don’t touch nothing and trust generator?
  2. Where from that generator knows which version of Ionic in current project? Because CLI version is 4.8.0, I through ionic version the same too.
  3. “ionic generate” can not generate validator (custom), so I must create it manually.
    Place “validators” folder in src/ folder, like “ionic generate” place folders like pages, directives etc?
    Or place inside src/app, like angular way?

Posts: 1

Participants: 1

Read full topic


Plugins not installed on iOS

$
0
0

@ISG wrote:

Hi there. I’m hoping there is help out there!

I’ve built my app for iOS and I’ve managed to push the app onto an iPhone. When I begin interacting with the app I’m getting errors telling me that I need to install plugins.

[Warning] Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open. (vendor.js, line 102520).

This is just one example, I have a few plugins and two of them are used on my login screen and both of these are failing in the same way. What am I missing?? Thank you.

Ionic:

ionic (Ionic CLI) : 4.7.1
Ionic Framework : @ionic/angular 4.0.0-beta.16
@angular-devkit/build-angular : 0.12.1
@angular-devkit/schematics : 0.8.8
@angular/cli : 6.2.8
@ionic/angular-toolkit : 1.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : none
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 19 other plugins)

System:

Android SDK Tools : 26.1.1 (/Users/travis.bradfield/Library/Android/sdk)
ios-deploy : 1.9.4
NodeJS : v10.15.0 (/usr/local/bin/node)
npm : 6.7.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic

Images on assets are not loaded when in --release/prod mode

$
0
0

@franzisk4sis wrote:

Hi guys,

Anyone could tell me why images on assets are not loaded when I run the app on Android device using release or prod command option?

As an example I have this simple list:
Running in debug mode:

ionic cordova run android -l -c --minifyjs --minifycss

Running in release/prod mode:
ionic cordova run android --release --minifyjs --minifycss

Template:

<ion-avatar item-start>
  <img src="../assets/img/group-icon.png" />
</ion-avatar>

Any thoughts?

Posts: 3

Participants: 2

Read full topic

How to display matched regex pattern?

$
0
0

@baattexx wrote:

i’m using regex to find a match from an array. then, if it finds a match, the matched string should be displayed
ts file

    this.vision.recognizeImageText(this.imageToProcess).subscribe(
      result => {
        this.ocrResult = lineSegementation(
          result["responses"][0].textAnnotations
        );
        console.log(result);
        console.log(this.ocrResult);
        spinner.dismiss();
      },
      err => {
        console.error(err);
        spinner.dismiss();
      }
    );
    this.ocrResult.foreach(line =>{
      let matched = new RegExp("[A-Z\s]+"); //match only capital letters, spaces 
      let merchant = matched.exec(line)
      if (merchant[0] !== "") {
        return merchant
      }
    });

home.html file

  <ion-card *ngIf="merchant">
    <ion-card-content>
      Result:
        <ion-label>Merchant {{ merchant }}</ion-label>
    </ion-card-content>

Posts: 3

Participants: 2

Read full topic

Ionic 4 fail to load index

$
0
0

@Breakdom wrote:

Hello everyone, I just went to Ionic 4 and tried to start a basic project. In the browser everything works correctly but as soon as I export the app for IOS or Android after the splash screen the app remains blocked and from the log I see that it can not load the index.html of the project.

Posts: 1

Participants: 1

Read full topic

Ionic FileTransfer not working on iOS - broken plugin?

$
0
0

@marie_fashion wrote:

Hey all! I am trying for two days now, to upload a file to my server. Here is my config:

Ionic: CLI 4.7.1
Cordova: 8.1.2 (cordova-lib@8.1.1)

I have added the following:

ionic cordova plugin add cordova-plugin-file-transfer
npm install @ionic-native/file-transfer

Afterwards I did put it within the app.module.ts like this:

import { FileTransfer} from '@ionic-native/file-transfer';

[... shorten ...]

  providers: [
    ....
    File,
    FileTransfer,
    Base64,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})

and within my page I added the following:

import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';

  constructor(public navCtrl: NavController, [..], private base64: Base64, public http: HttpClient, private transfer: FileTransfer) {

  }

I even did not implement code but when I try to run:

ionic Cordova build iOS

I do get the following error:

[18:55:27]  typescript: src/app/app.module.ts, line: 24 
            Argument of type '{ declarations: (typeof AboutPage | typeof ContactPage | typeof HomePage | typeof TabsPage 
            | type...' is not assignable to parameter of type 'NgModule'. Types of property 'providers' are 
            incompatible. Type '(typeof SplashScreen | typeof Camera | typeof Media | typeof File | typeof Base64 | 
            FileTransferO...' is not assignable to type 'Provider[]'. Type 'typeof SplashScreen | typeof Camera | typeof 
            Media | typeof File | typeof Base64 | FileTransferOr...' is not assignable to type 'Provider'. Type 
            'FileTransferOriginal' is not assignable to type 'Provider'. Type 'FileTransferOriginal' is not assignable 
            to type 'ClassProvider'. Property 'provide' is missing in type 'FileTransferOriginal'. 

      L24:  @NgModule({                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
      L25:    declarations: [


[ ,,, ]

[18:55:27]  ionic-app-script task: "build" 
[18:55:27]  Error: Failed to transpile program 
Error: Failed to transpile program
    at new BuildError (/Users/marie/playground/ionic/AppDevelopment/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at /Users/marie/playground/ionic/AppDevelopment/node_modules/@ionic/app-scripts/dist/transpile.js:159:20
    at new Promise (<anonymous>)
    at transpileWorker (/Users/marie/playground/ionic/AppDevelopment/node_modules/@ionic/app-scripts/dist/transpile.js:107:12)
    at Object.transpile (/Users/marie/playground/ionic/AppDevelopment/node_modules/@ionic/app-scripts/dist/transpile.js:64:12)
    at /Users/marie/playground/ionic/AppDevelopment/node_modules/@ionic/app-scripts/dist/build.js:109:82
[ERROR] An error occurred while running subprocess ionic-app-scripts.

This error seems to be common but no-one did post a solution yet. Most of the references I found on Stackoverflow say - it is due to a deprecated plugin? Is this FileTransfer Plugin deprecated?

https://stackoverflow.com/questions/46068697/ionic-fileuploadoptions-throw-error-when-add-to-app-module-ts (This did not work for me)

Thanks

Posts: 3

Participants: 2

Read full topic

Viewing all 70434 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>