我尝试构建一个离子2应用程序.当我在浏览器中使用离子服务器尝试应用程序或在模拟器上启动它时,一切正常.
但是当我每次尝试构建错误时
ionic-app-script tast: "build"
Error Type AddEvent in "PATH"/add.event.ts is part of the declarations of 2 modules: AppModule in "PATH"/app.modules.ts and AddEvent in "PATH"/add-event.module.ts.
Please consider moving AddEvent in "PATH"/add-event.ts to a higher module that imports AppModule in "PATH"/app.module.ts and AddEventModule.
You can also creat a new NgModule that exports and includes AddEvent then import that NgModule in AppModule and AddEventModule
Run Code Online (Sandbox Code Playgroud)
我的AppModule是
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, …Run Code Online (Sandbox Code Playgroud) 在为Android构建Ionic 3应用程序时,突然出现以下错误。
Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25
Run Code Online (Sandbox Code Playgroud)
我们已经从Android Studio中的一个解决方案在这里,但我在我的build.gradle没有变化用下面的代码后,我仍然得到错误。
buildscript {
repositories {
...
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
allprojects {
repositories {
...
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
Run Code Online (Sandbox Code Playgroud)
更新Cordova并添加上述解决方案后,我的build.gradle文件如下所示。
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url …Run Code Online (Sandbox Code Playgroud) 我在一个离子项目中遇到一个问题,该问题昨天开始发生而没有修改任何依赖项。
运行时ionic cordova run android出现此错误:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Run Code Online (Sandbox Code Playgroud)
但是这些天我没有安装任何依赖项。
这是我的cordova plugins清单:
cordova-fabric-plugin 1.1.14-dev "cordova-fabric-plugin"
cordova-plugin-advanced-http 2.0.9 "Advanced HTTP plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appminimize 1.0.1 "AppMinimize"
cordova-plugin-apprate 1.4.0 "AppRate"
cordova-plugin-appsee 2.6.0 "Appsee"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-facebook4 3.2.0 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-firebase …Run Code Online (Sandbox Code Playgroud) android android-gradle-plugin ionic-framework ionic-native ionic3
我一直试图解决这个问题,但隧道尽头似乎没有任何亮点,因此在这里尝试一下......希望你能提供帮助.
我有一个离子项目.Running via ionic serve给出了我期望的结果,没问题.但是,在运行命令时ionic cordova run ios -lc,我收到一个错误,打破了构建过程.我收到的错误如下:
[cordova] error: archive not found at path '/Users/path-to-app/platforms/ios/demoapp.xcarchive'
[cordova] ** EXPORT FAILED **
[cordova]
[cordova] (node:5866) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,demoapp.xcarchive,-exportOptionsPlist,/Users/path-to-app/platforms/ios/exportOptions.plist,-exportPath,/Users/path-to-app/platforms/ios/build/device
[cordova] (node:5866) [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.
我在这里看到2个不同的错误:找不到存档和弃用问题.不知道哪一个打破了构建但似乎无法为其中任何一个找到解决方案.
离子信息:
Ionic:
ionic (Ionic CLI) : 4.1.2 …Run Code Online (Sandbox Code Playgroud) 你能告诉我应用程序Component和Page生成器之间有什么区别Ionic 3吗?看来我也可以ionViewWillLeave在组件内部使用页面生命周期钩子.所以我何时应该使用角度生命周期钩子呢?如果它是相同的那么为什么它有2个发电机?希望你能为此提供反馈.
组件生成器:
ionic generate component SubscribeTopicComponent
Run Code Online (Sandbox Code Playgroud)
页面生成器:
ionic generate page LoginPage
Run Code Online (Sandbox Code Playgroud) 有没有办法检查应用程序是否在ionic/cordova/phonegap的前台或后台运行,我需要在android和ios上使用它,非常感谢
Ionic 2中图像资产的最佳实践是什么?我有一堆SVG我想用作非系统图标.我发现了一些关于使用Gulp的旧技巧,但似乎Ionic团队决定将Rollup作为首选的构建工具,目前还没有关于此的文档.
有人告诉我只是添加它们www/img.有任何缺点吗?
我正在尝试做,npm install并出现错误:
Failed at the node-sass@4.5.0 postinstall script.
Run Code Online (Sandbox Code Playgroud)
我试图删除node_modules然后重新安装它,出现相同的错误.什么是解决方案?
节点v8.9.3
npm v5.4.2
离子3.19.0
我试图使用打字稿获取离子2中的设备宽度和高度.
在以前版本的离子2我用过,
window.screen.width
window.screen.height
Run Code Online (Sandbox Code Playgroud)
但在较新版本中,这不起作用.
如何使用Type Script + ionic 2?
我已经将材料图标添加到ionic2 app,从那时起我就收到错误""与服务器的连接失败了.(file:///android_asset/www/index.html)""尽管MaterialIcons的css和fonts文件位于assets文件夹中(我在本地安装),但没有调用" https://fonts.googleapis" .com/icon?family =材料+图标 "我该怎么办?我可以修复它或突然知道为什么超时.
ionic3 ×10
angular ×5
ionic2 ×5
cordova ×3
android ×2
typescript ×2
build ×1
build.gradle ×1
declaration ×1
ionic-native ×1
ionic4 ×1
javascript ×1
node-sass ×1
npm ×1
reactjs ×1