我将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)
我试图回滚到旧版本,仍然遇到相同的问题。我有另一个离子应用程序,它可以与我的配置一起使用。
配置为:
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: …我有一个 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();
  }
}
我添加了这个新的(基于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();
  }
}
但这样,用户信息不会保存,因为我没有“结果”来处理或调用 setActiveAccount(result)。即使在“离子服务”中它也不起作用,所以我放弃了这种方法。
azure-active-directory ionic-framework azure-ad-msal ionic-native msal-angular
我的要求是将应用程序固定为手机上的纵向模式和选项卡上的横向模式,从闪屏开始。尝试使用 ionic native 上可用的 Screen Orientation 插件,但对我不起作用。
我尝试过的事情:
在 app.component.ts 上:
constructor(..., private screenOrientation: ScreenOrientation) {
    platform.ready().then(() => {
        this.screenOrientation.lock('landscape');
        ScreenOrientation.lockOrientation('landscape');
        screen.msLockOrientation('landscape');
    this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
我也在 home.ts 上尝试了上述所有行,但没有奏效。当我设置:
console.log(this.screenOrientation.type); 
这将在日志中正确打印出屏幕方向。每当我设置 subscribe 方法时,它也会在屏幕方向发生变化时提醒我,这意味着所有导入语句都可以正常工作并且我能够正确访问插件方法。我能够在 Android 和 iOS 上复制这个问题。任何帮助将不胜感激。
平台/库/依赖项详细信息:
"@angular/common": "4.1.3",
“离子角”:“3.6.0”,
“离子”:“3.7.0”
请帮我解决这个问题,
地理定位插件不适用于某些 android 设备。它在不同的 Android 手机上进行了测试,以识别地图问题上的当前位置,发现以下结果:
============ 我已经测试了这几台设备 ==========
酷派3600I | 安卓 6.0.1 | 不工作
红米笔记4 | 安卓 7、MIUI 9 | 不工作
摩托克 3 | 安卓 6 | 不工作
红米笔记4 | 安卓 7、MIUI 9 | 不工作
红米4 | 安卓 7.1.2,MIUI 9.1 | 在职的
摩托 G4 Plus | 安卓 7.0 | 在职的
米注3 | 安卓 6+,MIUI 8+ | 在职的
荣誉冬青2加| | 在职的
三星J7 | | 在职的
摩托克 3 | | 在职的
GetLatLong(){
      this.platform.ready().then(() => {
        var myoption = {
            timeout:5000,
            enableHighAccuracy:true …我的 ionic 4 代码中有一个按钮和一个函数。理想情况下,单击按钮时,该功能应该启动,但事实并非如此。
我的 HTML
<ion-content padding>
<div class="contentFlow" id="profile-content">
    <h1>Profile</h1>
    <ion-button (click)="clicked()"  expand="block" color="light">
      Logout
    </ion-button>
  </div>
</ion-content>
我的技术:
clicked() {
    alert('hello');
  }
注意:我需要将 div 保留在我的代码中。
我应该怎么办?
我\xe2\x80\x99m 不确定如何让 Cordova 插件在 Android 模拟器中与 Ionic 4 + Capacitor 一起使用。
\n\n我正在遵循这个示例(https://ionicacademy.com/create-pdf-files-ionic-pdfmake/),但我将向其中添加一些电容器插件,以便使用相机添加图像。
\n\n下面的 Cordova 插件是否仍可与 Capacitor 配合使用?我根本无法让它们工作。它们使用 cordova 而不是 Capacitor 工作得很好。\n我创建的项目如下:
\n\nionic start myApp\ncd myApp\nnpm install @capacitor/core @capacitor/cli\nnpx cap init\nnpm install pdfmake @ionic-native/file-opener @ionic-native/file \nnpm install cordova-plugin-file-opener2\nnpm install cordova-plugin-file\n\n*Writes code*\n\ncreate myApp/www dir\ncopied index.html to myApp/www dir\nnpx cap add android\nnpx cap update\nnpx cap open android (opens android studio)\nionic capacitor run android\nnpx cap sync\nnpx cap copy\nrun in emulator from android studio\n预期结果:
\n\npdf 将保存到设备,然后打开。 …
正如官方文档 [1] 中提到的,我一直在尝试使用 Cordova Advanced HTTP 插件 [2] 在 Ionic + Angular + Capacitor 项目中实现 SSL Pinning。
但是,每次我用 Xcode 打开 iOS 应用程序时,它都会记录一个错误 [3],说证书无效,我认为这是错误的。
2019-07-02 09:20:13.211085+0530 App[481:58424] TIC SSL Trust Error [1:0x280002100]: 3:0
2019-07-02 09:20:13.228677+0530 App[481:58424] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2019-07-02 09:20:13.228721+0530 App[481:58424] Task <46E01436-B71E-421D-B8F0-584EBEBEDD56>.<1> HTTP load failed (error code: -1202 [3:-9813])
2019-07-02 09:20:13.228908+0530 App[481:58418] Task <46E01436-B71E-421D-B8F0-584EBEBEDD56>.<1> finished with error - code: -1202
2019-07-02 09:20:13.231665+0530 App[481:58415] Task <46E01436-B71E-421D-B8F0-584EBEBEDD56>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this …ionic-framework certificate-pinning ionic-native ionic4 capacitor
连接的设备:
它正在运行开发者选项并启用了 USB 调试
它使用 MTP 作为设备文件管理器
驱动程序已安装到笔记本电脑上,没有任何问题,我可以正常浏览文件
当我运行:ionic cordova run android --device我得到这个输出:
BUILD SUCCESSFUL in 5s
42 actionable tasks: 42 up-to-date
Built the following apk(s):
    C:\Users\K-PC\myApp\platforms\android\app\build\outputs\apk\debug\app-debug.apk
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-debug.apk --device
[native-run] ERR_NO_DEVICE: No hardware devices found. Not attempting emulator because --device was specified.
[native-run]
[native-run]    More details for this error may be available online:
[native-run]
[native-run]    https://github.com/ionic-team/native-run/wiki/Android-Errors
[ERROR] An error occurred while running subprocess native-run.
        native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
        Re-running this …我有一个 Ionic 5/Angular 应用程序,它使用 Ionic Native Camera 插件来拍照并裁剪图像。在我更新到 Android 11(使用 note 10 plus)之前,该功能一直运行良好。更新后,裁剪时抛出以下错误:无法保存裁剪后的图像 - 访问被拒绝。
TS代码:
takePicture() {
    this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.READ_EXTERNAL_STORAGE, 
    this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE]);
    const options: CameraOptions = {
      quality: 100,
      targetHeight: 1920,
      targetWidth: 1080,
      sourceType: 1, // CAMERA
      destinationType: 0, // DATA_URL
      encodingType: this.camera.EncodingType.JPEG,
      correctOrientation: true,
      allowEdit: true
    };
    this.camera.getPicture(options).then((imageData) => {
     // Persist image data
    });
  }
应用程序在其他设备上运行良好。还检查了我的应用程序、图库应用程序和照片编辑器应用程序是否具有存储和相机权限。我可以拍照,裁剪器会打开 - 点击“完成”后,会显示“访问被拒绝”消息,紧接着会显示“无法保存裁剪后的图像”。
注意:我在另一台运行 Android 11 的设备上进行了测试,结果出现了相同的错误。
我正在开发一个使用谷歌地图和离子电容器的移动应用程序。我在谷歌地图 API 中创建了密钥。我激活了 Maps JavaScript API 和 Maps SDK for Android API。我添加了一种计费方式。我可以使用我创建的密钥在浏览器上看到地图,但我在 Android 应用程序中收到错误。因此,不显示地图。在 AndroidManifest.xml 中添加了 api 密钥。
我添加到 AndroidManifest.xml 的权限:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
错误如下。W/DynamiteModule:未找到 com.google.android.gms.googlecertificates 的本地模块描述符类。
无法使用 defaults.java.io.FileNotFoundException 检索 com.google.android.libraries.consentverifier#com.xxx.xxx 的标志快照:/data/user/0/com.xxx.xxx/files/phenotype/shared/ com.google.android.libraries.consentverifier#com.xxx.xxx.pb:打开失败:ENOENT(没有这样的文件或目录)
感谢您的帮助...
ionic-native ×10
android ×3
angular ×3
ionic4 ×3
capacitor ×2
cordova ×1
google-maps ×1
ionic2 ×1
ionic3 ×1
ionic5 ×1
msal-angular ×1
native ×1
typescript ×1