0

Não sei o que é.
Já dei recompensa sem resposta certa numa questão anterior. Estou quase largando o projeto.

O que eu já fiz:

  1. Tive que formatar o PC, até então funcionando bem.
  2. Quando crio um projeto novo, em branco, roda.
  3. Quando copio minha pasta SRC para o novo projeto (o antigo dá o mesmo erro), instalo todos os plugins que estão no app.module, já que o VSCode avisa, roda no Browser ok. Mas quando mando vou emular ou dou um ionic cordova resource não sai deste erro.

Segue minha configuração:

ionic info
√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)  : 4.1.1 (C:\Users\Ramos\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 6 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\Ramos\AppData\Local\Android\Sdk)
   NodeJS            : v10.8.0 (C:\Users\Ramos\AppData\Roaming\npm\node_modules\node\bin\node.exe)
   npm               : 6.4.0
   OS                : Windows 10

Segue o erro ao fazer build, run, ou resource:

cp: copyFileSync: could not write to dest file (code=ENOENT):C:\projetos\wellfit\platforms\android\res\xml\config.xml

Parsing C:\projetos\wellfit\platforms\android\res\xml\config.xml failed
(node:10572) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\projetos\wellfit\platforms\android\res\xml\config.xml'
    at Object.openSync (fs.js:434:3)
    at Object.readFileSync (fs.js:339:35)
    at Object.parseElementtreeSync (C:\projetos\wellfit\platforms\android\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
    at new ConfigParser (C:\projetos\wellfit\platforms\android\cordova\node_modules\cordova-common\src\ConfigParser\ConfigParser.js:30:24)
    at updateConfigFilesFrom (C:\projetos\wellfit\platforms\android\cordova\lib\prepare.js:106:18)
    at Api.module.exports.prepare (C:\projetos\wellfit\platforms\android\cordova\lib\prepare.js:42:20)
    at Api.prepare (C:\projetos\wellfit\platforms\android\cordova\Api.js:192:45)
    at C:\Users\Ramos\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:106:36
    at _fulfilled (C:\Users\Ramos\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
    at C:\Users\Ramos\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:816:30
(node:10572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10572) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Meu Package.json:

{
  "name": "wellfit",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "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/core": "~4.11.0",
    "@ionic-native/social-sharing": "^4.12.0",
    "@ionic-native/splash-screen": "~4.11.0",
    "@ionic-native/status-bar": "~4.11.0",
    "@ionic-native/toast": "^4.12.0",
    "@ionic-native/youtube-video-player": "^4.12.0",
    "@ionic/pro": "2.0.3",
    "@ionic/storage": "2.1.3",
    "angular2-text-mask": "^9.0.0",
    "cordova-android": "^7.1.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.2",
    "cordova-plugin-ionic-webview": "^2.1.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "^5.4.1",
    "cordova-plugin-x-toast": "^2.7.0",
    "cordova-plugin-youtube-video-player": "^1.0.6",
    "es6-promise-plugin": "^4.2.2",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "wp-api-angular": "^3.0.0-beta8",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.11",
    "@ionic/lab": "1.0.8",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-x-toast": {},
      "cordova-plugin-x-socialsharing": {},
      "cordova-plugin-youtube-video-player": {}
    },
    "platforms": [
      "android"
    ]
  }
}

Meu app.module.ts:

import { LoginProvider } from './../providers/login/login';
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp,    IonicModule,    IonicErrorHandler} from 'ionic-angular';
import { FormsModule } from "@angular/forms";
import { MyApp } from './app.component';
import { WellFitPage } from '../pages/well-fit/well-fit';
import { EditarPage } from '../pages/editar/editar';
import { EdiODoMeuPerfilPage } from '../pages/edi-odo-meu-perfil/edi-odo-meu-perfil';
import { AWellFitPage } from '../pages/a-well-fit/a-well-fit';
import { MaisPage } from '../pages/mais/mais';
import { PresenAPage } from '../pages/presen-a/presen-a';
import { EntrarPage } from '../pages/entrar/entrar';
import { CriarContaPage } from '../pages/criar-conta/criar-conta';
import { MovimentosPage } from '../pages/movimentos/movimentos';
import { MarcadoresDeTempoPage } from '../pages/marcadores-de-tempo/marcadores-de-tempo';
import { ComoFazerPage } from '../pages/como-fazer/como-fazer';
import { WellFitNewsPage } from '../pages/well-fit-news/well-fit-news';
import { ConfiguraEsPage } from '../pages/configura-es/configura-es';
import { RanksPage } from '../pages/ranks/ranks';
import { FaleConoscoPage } from '../pages/fale-conosco/fale-conosco';
import { MensagensRecebidasPage } from '../pages/mensagens-recebidas/mensagens-recebidas';
import { MensagemPage } from '../pages/mensagem/mensagem';
import { WorkoutDoDiaPage } from '../pages/workout-do-dia/workout-do-dia';
import { Box10TopAtletasPage } from '../pages/box10top-atletas/box10top-atletas';
import { RankingDeFrequNciaPage } from '../pages/ranking-de-frequ-ncia/ranking-de-frequ-ncia';
import { WellFitVocPage } from '../pages/well-fit-voc/well-fit-voc';
import { AgendamentoCrossfitPage } from '../pages/agendamento-crossfit/agendamento-crossfit';
import { MovimentoTiposPage } from '../pages/movimento-tipos/movimento-tipos';
import { MovimentoTipoEditPage } from '../pages/movimento-tipo-edit/movimento-tipo-edit';
import { SessionListPage } from '../pages/session-list/session-list';
import { SessaoAddPage } from '../pages/sessao-add/sessao-add';
import { EsqueciSenhaPage } from '../pages/esqueci-senha/esqueci-senha';

import { HttpClientModule } from '@angular/common/http';


import { StatusBar } from '@ionic-native/status-bar';


import { Toast } from '@ionic-native/toast';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';

import { HttpModule } from '@angular/http';
import { Http } from '@angular/http';

import { TextMaskModule } from 'angular2-text-mask';

import { SocialSharing } from '@ionic-native/social-sharing';


import { YtProvider } from '../providers/yt/yt';
import { YoutubeVideoPlayer } from '@ionic-native/youtube-video-player';



import {
  WpApiModule,
  WpApiStaticLoader,
  WpApiLoader
} from 'wp-api-angular'
import { MensagemProvider } from '../providers/mensagem/mensagem';


export function WpApiLoaderFactory(http) {
  return new WpApiStaticLoader(http, 'http://www.ramosdainformatica.com.br//wp-json/');
}


@NgModule({
  declarations: [
    MyApp,
    WellFitPage,
    EditarPage,
    EdiODoMeuPerfilPage,
    AWellFitPage,
    MaisPage,
    PresenAPage,
    EntrarPage,
    CriarContaPage,
    MovimentosPage,
    MarcadoresDeTempoPage,
    ComoFazerPage,
    WellFitNewsPage,
    ConfiguraEsPage,
    RanksPage,
    FaleConoscoPage,
    MensagensRecebidasPage,
    MensagemPage,
    WorkoutDoDiaPage,
    Box10TopAtletasPage,
    RankingDeFrequNciaPage,
    WellFitVocPage,
    AgendamentoCrossfitPage,
    MovimentoTiposPage,
    MovimentoTipoEditPage,
    SessionListPage,
    SessaoAddPage,
    EsqueciSenhaPage
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    FormsModule,
    IonicModule.forRoot(MyApp),
    HttpModule,
    TextMaskModule,
        WpApiModule.forRoot({
      provide: WpApiLoader,
      useFactory: (WpApiLoaderFactory),
      deps: [Http]
    }),

  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    WellFitPage,
    EditarPage,
    EdiODoMeuPerfilPage,
    AWellFitPage,
    MaisPage,
    PresenAPage,
    EntrarPage,
    CriarContaPage,
    MovimentosPage,
    MarcadoresDeTempoPage,
    ComoFazerPage,
    WellFitNewsPage,
    ConfiguraEsPage,
    RanksPage,
    FaleConoscoPage,
    MensagensRecebidasPage,
    MensagemPage,
    WorkoutDoDiaPage,
    Box10TopAtletasPage,
    RankingDeFrequNciaPage,
    WellFitVocPage,
    AgendamentoCrossfitPage,
    MovimentoTiposPage,
    MovimentoTipoEditPage,
    SessionListPage,
    SessaoAddPage,
    EsqueciSenhaPage
  ],
  providers: [
    StatusBar,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    Toast,
    SocialSharing,
    YtProvider,
    YoutubeVideoPlayer,
    LoginProvider,
    MensagemProvider
  ]
})
export class AppModule {}
3
  • Fiz um downgrade para a versão 3.9.2 do Ionic-Cli, deletai as pastas platform e www, mandei preprarar o ionic cordova prepare, tudo ok, mas quando emular continua o mesmo erro.
    – Ramos
    Commented 23/08/2018 às 15:15
  • 1
    Encontrei uma resposta aqui. O cordova-android 7 alterou a estrutura das pastas. Uma opção é fazer o downgrade para o cordova-android 6.4.0.
    – Renata
    Commented 23/08/2018 às 16:02
  • estranho. ta parecendo erro por causa de permissao de escrita em arquivo. could not write to dest file .. tente rodar o cmd como administrador
    – jraspante
    Commented 23/08/2018 às 21:37

0

Você deve fazer log-in para responder a esta pergunta.

Pesquise outras perguntas com a tag .