小编Tap*_*jee的帖子

错误:在Ionic 3中找不到org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25

在为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)

android cordova build.gradle ionic-framework ionic3

79
推荐指数
6
解决办法
1万
查看次数

从离子幻灯片迁移后,错误“swiper-slide”不是已知元素

我更新了我的 Angular Ionic 5 应用程序并尝试从 迁移ion-slidesSlides. 我正在关注官方文档

  • 我安装了刷卡器npm install swiper@6
  • 是否导入到scss文件中@import '~swiper/swiper';
  • 是否导入了 SwiperModuleapp.module.ts和我的 page.module.ts
import { SwiperModule } from 'swiper/angular';
@NgModule({
  imports: [SwiperModule],
})
export class AppModule {}
Run Code Online (Sandbox Code Playgroud)

我导入swiper后,HTML 页面能够识别,但无法识别并显示错误SwiperModulepage.module.tsswiper-slide'swiper-slide' is not a known element

<swiper>
  <swiper-slide>Slide 1</swiper-slide>
  <swiper-slide>Slide 3</swiper-slide>
  <swiper-slide>Slide 3</swiper-slide>
</swiper>
Run Code Online (Sandbox Code Playgroud)

ionic-framework angular ionic5 swiper.js

10
推荐指数
1
解决办法
6066
查看次数

类型错误:tslib.__spreadArrays 不是函数

我在 Ionic 3 的浏览器中执行ionic serve.

TypeError: tslib.__spreadArrays is not a function
Run Code Online (Sandbox Code Playgroud)

这是在我由于另一个错误而降级到"@ionic/app-scripts": "^3.2.3"from后发生的。"@ionic/app-scripts": "^3.2.4"

ionic-framework ionic3 tslib

9
推荐指数
1
解决办法
9802
查看次数

在 Ionic 5 路由器中登录/注销时登录/主页不会被破坏

我的项目在 IONIC 5 和 Firstore 中。经过ion-router-outlet身份验证的(主页)和未经身份验证的(索引)路由有 2 种不同。以下是为 class 中的用户动态打开登录/主页的代码app.component.ts

  this.afAuth.authState.subscribe(user => {
    if (user) {
      this.router.navigateByUrl('home');
    } else {
      this.router.navigateByUrl('index');
    }
  }); 
Run Code Online (Sandbox Code Playgroud)

流程:登录页面->(登录)->首页->(退出)->登录页面。当主页打开时,登录页面仍会加载并位于导航堆栈中。在ngOnDestroy登录页面的不执行。注销后,登录页面再次打开,但类 constructor ngOnInit方法不执行。这会导致很多问题,因为页面初始化没有重新加载。Flow Home Page -> (logout) -> Login Page -> (login) -> Home Page 也发生了同样的问题。如何在登录后销毁登录页面和注销后的主页,以便在同一会话中重新打开时可以重新加载?

编辑:

以下是路由配置:

app-routing.module.ts

const routes: Routes = [
  {
    path: 'home',
    canLoad: [AuthGuard],
    loadChildren: () => import('./home/home.module').then(m => m.HomePageModule)
  },
  {
    path: 'index',
    loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule)
  },
];
Run Code Online (Sandbox Code Playgroud)

无论是Home.html …

routes angular-routing ionic-framework angular ionic5

7
推荐指数
1
解决办法
2044
查看次数

node_modules / firebase-functions / lib / function-configuration.d.ts:4:64-预期错误TS1005:']'

firebase deploy --only function在Ionic 3项目中执行命令时,出现以下错误。此解决方案不适用于我。

Running command: npm --prefix "$RESOURCE_DIR" run build
> functions@ build /Users/myuser/Project/functions
> tsc

node_modules/firebase-functions/lib/function-configuration.d.ts:4:64 - error TS1005: ']' expected.
4 export declare const SUPPORTED_REGIONS: readonly ["us-central1", "us-east1", "us-east4", "europe-west1", "europe-west2", "asia-east2", "asia-northeast1"];
                                                                             ~

node_modules/firebase-functions/lib/function-configuration.d.ts:4:66 - error TS1134: Variable declaration expected.
4 export declare const SUPPORTED_REGIONS: readonly ["us-central1", "us-east1", "us-east4", "europe-west1", "europe-west2", "asia-east2", "asia-northeast1"];
                                                                   ~~~~~~~~~~

node_modules/firebase-functions/lib/function-configuration.d.ts:4:153 - error TS1005: ';' expected.
4 export declare const SUPPORTED_REGIONS: readonly ["us-central1", "us-east1", "us-east4", "europe-west1", "europe-west2", "asia-east2", …
Run Code Online (Sandbox Code Playgroud)

firebase typescript google-cloud-functions

6
推荐指数
1
解决办法
434
查看次数

Ionic 3 Angular 4中数据建模的最佳实践

我正在使用Ionic 3,Angular 4和Firebase构建应用程序,我对数据建模非常困惑.有两种方法.

  1. 创建一个模型类,声明变量和方法.
  2. 创建一个接口

我不确定我应该采取哪种方法.接口将是空体,但将允许可选变量,但类不会.
我只是在寻找数据建模的清晰概念.

data-modeling ionic-framework angular

5
推荐指数
0
解决办法
2847
查看次数

Cloud Firestore 字符串 &gt;= 字符串

以下是 Cloud Firestore 列表查询中的示例之一

citiesRef.where("state", ">=", "CA").where("state", "<=", "IN")
Run Code Online (Sandbox Code Playgroud)

这是什么意思?

这是我可以进行搜索子字符串的查询的方式吗?例如,我有一个用户集合,我的所有用户文档都有名字和姓氏。现在,作为用户,我尝试通过输入名称的一部分并进行搜索来搜索其他人。我应该能够编写一个查询来获取名称包含该字符串的所有用户。我该如何在 Firestore 中执行此操作?

firebase google-cloud-firestore

5
推荐指数
1
解决办法
3606
查看次数

CocoaPods 找不到 pod“Firebase/Performance”的兼容版本:在 Ionic 5 中安装 Firebase X 时

我在 Ionic 5 中的项目并使用 Capacitor 2.1.2。我已经使用以下代码为电容器安装了Firebase X。

npm install cordova-plugin-firebasex
npm install @ionic-native/firebase-x
Run Code Online (Sandbox Code Playgroud)

当我这样做时ionic cap sync,android 安装没有错误,但我在 IOS 中收到以下错误。

? Updating iOS native dependencies with "pod install" (may take several minutes): 
? update ios: 
[error] Error running update: Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Performance":
  In Podfile:
    CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`) was resolved to 2.1.2, which depends on
      Firebase/Performance (= 6.23.0)

None of your spec sources contain a spec satisfying the dependency: `Firebase/Performance …
Run Code Online (Sandbox Code Playgroud)

ios cordova firebase ionic-framework capacitor

5
推荐指数
1
解决办法
1993
查看次数

当 Ionic 3 中的输入处于活动状态时,显示/隐藏密码按钮不起作用

我正在尝试为 Ionic 3 中的密码字段实现显示/隐藏按钮。我从这里得到了代码帮助

登录.html

  <ion-item>
    <ion-input [type]="passwordType" placeholder="Password" formControlName="password"></ion-input>
    <ion-icon item-end [name]="passwordIcon" class="passwordIcon" (click)='hideShowPassword()'></ion-icon>
  </ion-item>
Run Code Online (Sandbox Code Playgroud)

登录.scss

    .passwordIcon{
        font-size: 1.3em;
        position: absolute;
        right: .1em;
        top: .5em;
        z-index: 2;
     }
Run Code Online (Sandbox Code Playgroud)

登录.ts

passwordType: string = 'password';
passwordIcon: string = 'eye-off';
  hideShowPassword() {
    this.passwordType = this.passwordType === 'text' ? 'password' : 'text';
    this.passwordIcon = this.passwordIcon === 'eye-off' ? 'eye' : 'eye-off';
}
Run Code Online (Sandbox Code Playgroud)

我在 .scss 文件中做了一个修改,并将图标设为绝对,以便它出现在输入字段的顶部而不是侧面。当输入字段未处于活动/选择状态时,此图标单击有效,但如果我正在输入字段中键入,则单击无效/无法识别。请帮忙。

解决方案建议我的领域看起来像这样。 在此处输入图片说明

passwords sass show-hide ionic-framework ionic3

4
推荐指数
1
解决办法
3170
查看次数

在一次读取计数中仅获取来自 Cloud Firestore 的集合 ID

在Cloud Foreshore 的这份文档中提到,“请求一个集合 ID 列表,您需要为读取一个文档付费”。

现在我在我的项目中使用 AngularFire 和 Ionic3。我的要求是仅从具有 where 条件的集合中获取集合 ID。如果我执行以下操作,结果中的读取次数 = 文档数。

let snap = this.afs.collection('path').ref
        .where('field', "==",'data').get();

snap.forEach(x => {
          list.push(x.id);
        });
Run Code Online (Sandbox Code Playgroud)

我无法使用getCollections()我在几个地方找到的方法作为解决方案。

如果您有解决方案,请告诉我。

firebase angularfire ionic-framework google-cloud-firestore

4
推荐指数
2
解决办法
2882
查看次数