标签: ionic-native

Ionic Pro iOS包/版本失败 - "错误:作业失败:退出状态1"

感谢您尝试帮助解决此问题.我正在使用付费的Ionic Pro订阅进行云构建和打包.直到两天前,当iOS构建突然停止工作时,一切都很好.

要清楚,之前构建的完全相同的提交现在没有构建,唯一可见的错误消息是" 错误:作业失败:退出状态1 ".对于Android,构建仍然正常运行.

我删除了cordova-plugin-consolecordova-ios按照此处的建议进行更新.

我已经执行npm cache clean -fnpm install npm -g所建议的在这里.

我在24小时前用Ionic支持开了一张票,但仍然没有回应.

这是完整(非常短)的构建日志:

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
  on Mac Package Runner 2 (dd66aa51)
Using Shell executor...
Running on Ionics-Mac-3.local...
Cloning repository...
Cloning into '/Users/ionic/builds/dd66aa51/0/project-1'...
Warning: Permanently added the ECDSA host key for IP address 'xx.xx.xx.xxx' to the list of known hosts.
Checking out f7b42652 as master...
Skipping Git submodules setup
$ …
Run Code Online (Sandbox Code Playgroud)

ios cordova ionic-framework ionic-native

8
推荐指数
1
解决办法
421
查看次数

如何在离子3中使用角度6?

我在Angular 5.2上有一个Ionic 3应用程序.我正在尝试更新到角度6.我按照升级指南已经为HttpClientNgModule.我现在遇到的问题是ionic-native.

我安装了ionic-native使用rxjsv6的V5 (angular6要求并且与以前的版本不兼容).

这是我的app.module.ts档案

import { Device } from '@ionic-native/device/ngx';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'
import { BrowserModule } from '@angular/platform-browser'
import { HttpClientModule } from '@angular/common/http'

@NgModule({
  declarations: [
    MyApp,
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot(),
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp
  ],
  providers: [
    Device
  ]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)

我收到了多个错误

找不到名字'设备'

'{declarations:(typeof MyApp)[];类型的参数; import :( ModuleWithProviders | …

ionic-native ionic3 angular

8
推荐指数
1
解决办法
4316
查看次数

Ionic cordova-plugin-qrscanner没有相机预览

我运行一个简单的演示来使用cordova-plugin-qrscanner,它可以扫描qrcode但没有摄像头预览.

在Github上的qrscannerDemo

相关密码打击:

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';


import { AndroidPermissions } from '@ionic-native/android-permissions';
import { QRScanner, QRScannerStatus } from '@ionic-native/qr-scanner';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController,
              public androidPermissions: AndroidPermissions,
              public qrScanner: QRScanner) {

  }

  qrscanner() {

    // Optionally request the permission early
    this.qrScanner.prepare()
      .then((status: QRScannerStatus) => {
        if (status.authorized) {
          // camera permission was granted
          alert('authorized');

          // start scanning
          let scanSub = this.qrScanner.scan().subscribe((text: string) => …
Run Code Online (Sandbox Code Playgroud)

qr-code cordova-plugins ionic-native ionic3

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

Ionic Native GooglePlus登录失败,没有任何错误

我按照https://ionicframework.com/docs/native/google-plus/中的说明操作.

我使用正确的SHA-1 在https://console.cloud.google.com/apis/credentials/oauthclient中创建了Android客户端(重新检查使用keytool -list -printcert -jarfile <path to your apk>)

登录代码很简单,如说明:

this.googlePlus.login({})
.then(res => console.log(res))
.catch(err => console.error(err));
Run Code Online (Sandbox Code Playgroud)

然而,它从未进入既不then也不是catch.控制台中不显示错误.

离子版3.20.0

Cordova版本7.1.0

Ionic Native GooglePlus 5.3.0

Android手机版5.1.1

cordova-plugin-googleplus 5.3.0

我花了两天时间,Ionic Native Facebook工作正常,而GooglePlus只是默默地失败了.

请指教.

更新1

这似乎是一个问题cordova-plugin-googleplus,就像我正在改变GooglePlus.execute使用时一样

@Override
public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException {
    this.savedCallbackContext = callbackContext;
    savedCallbackContext.error(42);
    action = "abracadabra";
    ... //remains unchanged
Run Code Online (Sandbox Code Playgroud)

然后我在Chrome控制台42中看到 - 这意味着,错误处理在cordova-plugin-googleplus插件中无法正常工作.

cordova ionic-framework google-plus-signin ionic-native ionic3

7
推荐指数
2
解决办法
4923
查看次数

从离子浏览器更改启动画面

启动我的应用程序时出现以下闪屏:

在此处输入图片说明

我只跑过

ionic cordova platform add browser

ionic cordova build browser

我的 config.xml

<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="StatusBarBackgroundColor" value="#000000" />
Run Code Online (Sandbox Code Playgroud)

感谢帮助!

ionic-framework ionic-native ionic3

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

找不到com.google.android.gms:strict-version-matcher-plugin:1.1.0

无法解析配置“ classpath”的所有文件。

找不到com.google.android.gms:strict-version-matcher-plugin:1.1.0。

Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom https://jcenter.bintray.com/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar file:/C:/Users/e1706396/.m2/repository/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom file:/C:/Users/e1706396/.m2/repository/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.jar Required by: unspecified:unspecified:unspecified > com.google.gms:google-services:4.2.0

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

https://help.gradle.org上获得更多帮助

7s cmd中的BUILD FAILED:命令失败,退出代码为1

我正在使用插件

   <plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
    <plugin name="cordova-plugin-camera" spec="^4.0.3" />
    <plugin name="cordova-plugin-compat" spec="^1.2.0" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="cordova-plugin-googleplus" spec="^5.2.1">
        <variable name="REVERSED_CLIENT_ID" value="xxx" />
    </plugin>
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.19" />
    <plugin name="cordova-plugin-mfp" spec="^8.0.2018070216" …
Run Code Online (Sandbox Code Playgroud)

android ionic-framework ionic-native ionic3

7
推荐指数
2
解决办法
9205
查看次数

Ionic4 watchPosition 和 getCurrentPosition of Geolocation 与 Ionic/Capacitor 不准确

我正在使用 Capacitor 来构建我的 Ionic 应用程序。我当然想通过 GPS 在地图上显示当前位置的应用程序。

下面的代码可以工作,并按照我的意愿在地图上为我提供正确的标记,但是......它远非准确。

async getLocation() {
    var self = this;
    let location = await Geolocation.getCurrentPosition({
        enableHighAccuracy: true,
        timeout: 1000
    });
    self.marker.setLngLat([location.coords.longitude, location.coords.latitude])
    const wait = Geolocation.watchPosition({enableHighAccuracy: true, timeout: 1000}, (position, err) => {
        self.marker.setLngLat([position.coords.longitude, position.coords.latitude])
    });
}
Run Code Online (Sandbox Code Playgroud)

标记像疯了一样四处走动。发生在我测试的每个位置。它移动的不是厘米,而是我所在位置周围的数米...

我错过了什么让我的 GPS 坐标不太准确?我以为enableHighAccuracy: true够了,但还不够。

cordova ionic-framework ionic-native ionic4 capacitor

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

错误:无法解析setupPlatform的所有参数:(?,[对象对象],[对象对象])

我将Angular更新为版本8,但遇到一个小问题。当我用离子发球启动应用程序时

 Error: Can't resolve all parameters for setupPlatform: (?, [object 
 Object], [object Object]).
    at syntaxError (http://localhost:8100/build/vendor.js:177346:17)
    at CompileMetadataResolver._getDependenciesMetadata 
 (http://localhost:8100/build/vendor.js:196072:35)
    at CompileMetadataResolver._getFactoryMetadata 
 (http://localhost:8100/build/vendor.js:195972:51)
   at CompileMetadataResolver.getProviderMetadata 
 (http://localhost:8100/build/vendor.js:196204:43)
  at http://localhost:8100/build/vendor.js:196134:49
  at Array.forEach (<anonymous>)
  at CompileMetadataResolver._getProvidersMetadata 
 (http://localhost:8100/build/vendor.js:196094:19)
  at http://localhost:8100/build/vendor.js:195717:119
  at Array.forEach (<anonymous>)
  at CompileMetadataResolver.getNgModuleMetadata 
(http://localhost:8100/build/vendor.js:195708:49)
Run Code Online (Sandbox Code Playgroud)

我试图回滚到旧版本,仍然遇到相同的问题。我有另一个离子应用程序,它可以与我的配置一起使用。

配置为:

Ionic:

  Ionic CLI          : 5.2.1
  Ionic Framework    : ionic-angular 3.9.6
  @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 6.5.0
   Cordova Platforms : android 6.1.2, browser 4.1.0, ios 4.5.5
   Cordova Plugins   : cordova-plugin-ionic-webview 1.2.1, (and 16 other plugins)

Utility: …
Run Code Online (Sandbox Code Playgroud)

typescript ionic-framework ionic-native angular

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

离子-角度与离子-反应

1.哪个更容易开发混合应用程序,Ionic - Angular 或 Ionic - React?

2.哪个性能更好?

3.所有插件都支持Ionic-React和Ionic-Angular吗?

如果有人分享有关此主题的宝贵意见和知识,那就太好了

ionic-framework ionic-native ionic4

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

Ionic 和 MSAL 身份验证

我有一个 Ionic 应用程序需要在 Azure 中进行身份验证,因此我按照本教程安装了 MSAL: https: //learn.microsoft.com/en-us/graph/tutorials/angular

它的工作原理就像“离子服务”的魅力,但当我在设备中运行它时,当我尝试登录 Azure 时它会崩溃。我认为这是因为 MSAL 显示的弹出窗口在 Ionic 中不允许登录。

所以我的第一次尝试是将loginPopup() 调用更改为loginRedirect()。所以我删除了这段代码:

async signIn(): Promise<void> {
  const result = await this.msalService
    .loginPopup(OAuthSettings)
    .toPromise()
    .catch((reason) => {
      this.alertsService.addError('Login failed',
        JSON.stringify(reason, null, 2));
    });

  if (result) {
    this.msalService.instance.setActiveAccount(result.account);
    this.authenticated = true;
    this.user = await this.getUser();
  }
}
Run Code Online (Sandbox Code Playgroud)

我添加了这个新的(基于https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/errors.md):

async signIn(): Promise<void> {
  await this.msalService.instance.handleRedirectPromise();

  const accounts = this.msalService.instance.getAllAccounts();
  if (accounts.length === 0) {
    // No user signed in
    this.msalService.instance.loginRedirect();
  }
}
Run Code Online (Sandbox Code Playgroud)

但这样,用户信息不会保存,因为我没有“结果”来处理或调用 setActiveAccount(result)。即使在“离子服务”中它也不起作用,所以我放弃了这种方法。

第二种方法是在寻找可能的解决方案两天后,在 InAppBrowser …

azure-active-directory ionic-framework azure-ad-msal ionic-native msal-angular

7
推荐指数
2
解决办法
6907
查看次数