Недавно я обновил версию своего ионного приложения до последней. На самом деле, я использовал те же версии зависимостей для угловых пакетов из супер-шаблона Ionic, потому что у меня всегда возникают проблемы с зависимостями при попытке обновить Ionic.
Когда я запускаю эти команды, все в порядке:
ionic serve --watch
ionic cordova run android --consolelogs --livereload --device
ionic cordova build android --dev
Но если я бегу:
ionic cordova build android --prod --release
Я получаю эту ошибку:
Это мой package.json
:
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"ionic:copy": "ionic-app-scripts copy"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/app-minimize": "^4.8.0",
"@ionic-native/core": "4.7.0",
"@ionic-native/date-picker": "^4.8.0",
"@ionic-native/device": "^4.8.0",
"@ionic-native/facebook": "^4.8.0",
"@ionic-native/file": "^3.14.0",
"@ionic-native/http": "^3.12.1",
"@ionic-native/in-app-purchase": "^4.8.0",
"@ionic-native/insomnia": "^4.8.0",
"@ionic-native/keyboard": "^4.8.0",
"@ionic-native/local-notifications": "^4.8.0",
"@ionic-native/media": "^4.8.0",
"@ionic-native/network": "^4.8.0",
"@ionic-native/screenshot": "^4.8.0",
"@ionic-native/social-sharing": "^4.8.0",
"@ionic-native/splash-screen": "^4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic/storage": "^2.1.3",
"@ngx-translate/core": "^9.1.1",
"@ngx-translate/http-loader": "^2.0.1",
"angular2-uuid": "git+https://github.com/wulfsolter/angular2-uuid.git",
"autoprefixer": "^7.1.2",
"chart.js": "^2.7.0",
"com.darktalker.cordova.screenshot": "git+https://github.com/gitawego/cordova-screenshot.git",
"cordova-android": "^6.2.3",
"cordova-android-support-gradle-release": "0.0.2",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.4.0",
"cordova-plugin-advanced-http": "^1.11.1",
"cordova-plugin-app-event": "^1.2.1",
"cordova-plugin-appminimize": "^1.0.0",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.0.7",
"cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-facebook4": "^1.10.1",
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-http": "^1.2.0",
"cordova-plugin-inapppurchase": "^1.2.0",
"cordova-plugin-insomnia": "git+https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git",
"cordova-plugin-media": "^2.4.1",
"cordova-plugin-network-information": "^1.3.4",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.0",
"cordova-sqlite-storage": "^2.3.2",
"de.appplant.cordova.plugin.local-notification": "^0.8.5",
"es6-promise-plugin": "^4.2.2",
"firebase": "^5.1.0",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"jquery": "^3.3.1",
"jquery-ui": "^1.12.1",
"moment": "^2.19.1",
"ng2-charts": "^1.6.0",
"ngx-toastr": "^8.8.0",
"nl.x-services.plugins.backgroundaudio": "git+https://github.com/EddyVerbruggen/cordova-plugin-backgroundaudio.git",
"promise-polyfill": "^8.0.0",
"propagating-hammerjs": "^1.4.6",
"reflect-metadata": "^0.1.3",
"rxjs": "5.5.11",
"soundcloud": "^3.3.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.10",
"typescript": "~2.6.2"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "Mindfulness: An Ionic project",
"cordova": {
"platforms": [
"android",
"browser",
"ios"
],
"plugins": {
"cordova-plugin-file": {},
"cordova-plugin-http": {},
"cordova-plugin-media": {
"MICROPHONE_USAGE_DESCRIPTION": " "
},
"cordova-plugin-network-information": {},
"cordova-plugin-statusbar": {},
"cordova-sqlite-storage": {},
"de.appplant.cordova.plugin.local-notification": {},
"cordova-plugin-insomnia": {},
"cordova-plugin-facebook4": {
"APP_ID": "my app id",
"APP_NAME": "Pausa by AnimaEdu"
},
"cordova-plugin-inapppurchase": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-splashscreen": {},
"com.darktalker.cordova.screenshot": {},
"cordova-android-support-gradle-release": {},
"cordova-plugin-datepicker": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-appminimize": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-device": {},
"nl.x-services.plugins.backgroundaudio": {}
}
}
}
Вот мой app.module.ts
:
/**
* Native providers
*/
import {NgModule, ErrorHandler} from '@angular/core';
import {IonicApp, IonicModule, IonicErrorHandler} from 'ionic-angular';
import {BrowserModule} from '@angular/platform-browser';
import {HttpClientModule, HttpClient} from '@angular/common/http';
import { IonicStorageModule } from '@ionic/storage';
import {StatusBar} from '@ionic-native/status-bar';
import {SplashScreen} from '@ionic-native/splash-screen';
import {Facebook} from '@ionic-native/facebook';
import {Insomnia} from '@ionic-native/insomnia';
import {LocalNotifications} from '@ionic-native/local-notifications';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {DatePicker} from '@ionic-native/date-picker';
import {File} from '@ionic-native/file';
import {InAppPurchase} from "@ionic-native/in-app-purchase"
import {SocialSharing} from '@ionic-native/social-sharing';
import {Media} from '@ionic-native/media';
import {Keyboard} from "@ionic-native/keyboard";
import {AppMinimize} from "@ionic-native/app-minimize";
import { HTTP } from '@ionic-native/http';
/**
* Components
*/
import {MyApp} from './app.component';
import {BottomMenuComponent} from '../components/bottom-menu/bottom-menu';
import {AudioListComponent} from '../components/audio-list/audio-list';
/**
* Pages
*/
import {HomePage} from '../pages/home/home';
import {LoginPage} from '../pages/login/login';
import {StartPage} from '../pages/start/start';
import {RegisterPage} from '../pages/register/register';
import {SubscriptionPage} from '../pages/subscription/subscription';
import {PractisesPage} from '../pages/practises/practises';
import {ReminderPage} from '../pages/reminder/reminder';
import {AboutPage} from '../pages/about/about';
import {CreateAccountPage} from '../pages/create-account/create-account';
import {LoginOptionsPage} from '../pages/login-options/login-options';
import {PlayerPage} from '../pages/player/player';
import {ProfilePage} from '../pages/profile/profile';
import {TimerPage} from '../pages/timer/timer';
import {CreateIntermediateBreatheSoundPage} from '../pages/create-intermediate-breathe-sound/create-intermediate-breathe-sound';
import {RememberPage} from '../pages/remember/remember';
import {PractiseAudiosPage} from '../pages/practise-audios/practise-audios';
import {HowtoPage} from '../pages/howto/howto';
import {PlayerOfflinePage} from '../pages/player-offline/player-offline';
import {PrivacyPage} from '../pages/privacy/privacy';
import {TermsPage} from '../pages/terms/terms';
import {DownloadsPage} from '../pages/downloads/downloads';
import {BeginnerTrackPage} from '../pages/beginner-track/beginner-track';
import {FAQPage} from '../pages/faq/faq';
import {WeekDaysModalPage} from "../components/week-days-modal/week-days-modal";
import {TimerCompletionModalPage} from "../pages/timer-completion-modal/timer-completion-modal";
import {WelcomePage} from "../pages/welcome/welcome";
import {WalkthroughPage} from "../pages/walkthrough/walkthrough";
import {SubscriptionInfoPage} from "../pages/subscription-info/subscription-info";
/**
* Custom providers
*/
import {FacebookEvents} from '../providers/facebook-events';
import {CredentialsStorage} from '../providers/credentials-storage';
import {ToastNotifications} from '../providers/toast-notifications';
import {NetworkManager} from '../providers/network-manager';
import {TimeFormatter} from '../providers/time-formatter';
import {FirebaseCustomProvider} from '../providers/firebase-custom/firebase-custom';
import {LocalNotificationsProvider} from '../providers/local-notifications-provider';
import {TimerOptionsProvider} from '../providers/timer-options-provider';
import {DynamicStyles} from '../providers/dynamic-styles';
import {BottomMenuItemProvider} from '../providers/bottom-menu-item';
import {SideMenuProvider} from '../providers/sidemenu-provider';
import {ReminderProvider} from '../providers/reminder';
import {AlertsProvider} from '../providers/alerts';
import {IdGeneratorService} from '../providers/id-generator';
import {AudioProvider} from '../providers/audio';
import {DaysProvider} from '../providers/days';
import {MeditationsProvider} from "../providers/meditations";
import {SubscriptionProvider} from "../providers/subscription-provider";
import {TimerProvider} from '../providers/timer';
import {AuthProvider} from '../providers/auth-provider';
import {HomeProvider} from '../providers/home';
import {PractiseProvider} from '../providers/practise-provider';
import {DailySentenceProvider} from '../providers/daily-sentence-provider';
import {OfflinePhrase} from '../providers/offline-phrase';
import {FirebaseAuthProvider} from '../providers/firebase-custom/firebase-auth';
import {RememberProvider} from '../providers/remember';
import { BeginnerTrackWeekProvider } from '../providers/beginner-track-week';
/**
* Repositories
*/
import {ReminderRepository} from '../repositories/reminder';
import {AudioRepository} from '../repositories/audio';
import {DaysRepository} from '../repositories/day';
import {TimerConfigRepository} from '../repositories/timer-config';
import {SubscriptionRepository} from '../repositories/subscription';
import {BeginnerTrackWeekRepository} from '../repositories/beginner-track-week';
import {MeditationsRepository} from "../repositories/meditations";
import {WalkthroughStepsRepository} from "../repositories/walkthrough-steps";
/**
* Charts
*/
import {ChartsModule} from 'ng2-charts/charts/charts';
import '../../node_modules/chart.js/dist/Chart.bundle.min.js';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/lang/i18n/', '.json');
}
@NgModule({
declarations: [
MyApp,
HomePage,
LoginPage,
StartPage,
RegisterPage,
SubscriptionPage,
PractisesPage,
ReminderPage,
AboutPage,
CreateAccountPage,
LoginOptionsPage,
PlayerPage,
ProfilePage,
TimerPage,
CreateIntermediateBreatheSoundPage,
RememberPage,
PractiseAudiosPage,
BottomMenuComponent,
PlayerOfflinePage,
HowtoPage,
PrivacyPage,
TermsPage,
DownloadsPage,
AudioListComponent,
BeginnerTrackPage,
WeekDaysModalPage,
WelcomePage,
WalkthroughPage,
FAQPage,
TimerCompletionModalPage,
SubscriptionInfoPage
],
imports: [
BrowserModule,
HttpClientModule,
IonicModule.forRoot(MyApp, {
activator: 'highlight',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
menuType: 'overlay',
swipeBackEnabled: true,
scrollAssist: false,
autoFocusAssist: false
}),
TranslateModule.forRoot(
{
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
ChartsModule,
IonicStorageModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
LoginPage,
StartPage,
RegisterPage,
SubscriptionPage,
PractisesPage,
ReminderPage,
AboutPage,
CreateAccountPage,
LoginOptionsPage,
PlayerPage,
ProfilePage,
TimerPage,
CreateIntermediateBreatheSoundPage,
RememberPage,
PractiseAudiosPage,
PlayerOfflinePage,
HowtoPage,
PrivacyPage,
TermsPage,
DownloadsPage,
BeginnerTrackPage,
WeekDaysModalPage,
WelcomePage,
WalkthroughPage,
FAQPage,
TimerCompletionModalPage,
SubscriptionInfoPage
],
providers: [
Storage,
{
provide: ErrorHandler,
useClass: IonicErrorHandler
},
FacebookEvents,
ToastNotifications,
CredentialsStorage,
NetworkManager,
Insomnia,
StatusBar,
SplashScreen,
Facebook,
LocalNotifications,
TimeFormatter,
FirebaseCustomProvider,
LocalNotificationsProvider,
TimerOptionsProvider,
DynamicStyles,
BottomMenuItemProvider,
SideMenuProvider,
DatePicker,
ReminderProvider,
ReminderRepository,
AlertsProvider,
IdGeneratorService,
AudioRepository,
AudioProvider,
File,
InAppPurchase,
DaysProvider,
DaysRepository,
MeditationsProvider,
MeditationsRepository,
SubscriptionProvider,
TimerConfigRepository,
TimerProvider,
AuthProvider,
HomeProvider,
PractiseProvider,
DailySentenceProvider,
OfflinePhrase,
SocialSharing,
SubscriptionRepository,
FirebaseAuthProvider,
RememberProvider,
Media,
Keyboard,
BeginnerTrackWeekProvider,
BeginnerTrackWeekRepository,
AppMinimize,
WalkthroughStepsRepository,
HTTP
]
})
export class AppModule {
}
Дополнительная информация:
- У меня нет ленивой загрузки. (У меня нет @IonicPage decorator и .module.ts
файлов в компонентах).
Может быть, неправильная версия app-scripts
?
Спасибо заранее!