我正在尝试构建我的 ionic 3 应用程序并在我的设备上部署和实时重新加载,因此我正在尝试以下命令:
ionic cordova run ios --device --prod -lcs
Run Code Online (Sandbox Code Playgroud)
但运行该命令后,我收到以下错误:
error: exportArchive: No profiles for 'io.ionic.starter' were found
Run Code Online (Sandbox Code Playgroud)
和
"No profiles for 'io.ionic.starter' were found" UserInfo={NSLocalizedDescription=No profiles for 'io.ionic.starter' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Development provisioning profiles matching 'io.ionic.starter'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}
Run Code Online (Sandbox Code Playgroud)
它说To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.但是在科尔多瓦怎么样?
一些额外的错误输出。正如您在下面看到的,首先Archive Succeeded但后来失败了。
** ARCHIVE SUCCEEDED ** …Run Code Online (Sandbox Code Playgroud) 我ion-spinner在离子应用程序中使用。但我的情况是我想改变微调器的大小。当我使用带有默认微调器调整大小的自定义 css 时效果很好。但是对于气泡、圆圈、圆点旋转器,它无法正常工作。
CSS
.spinner-large {
width: 100px;
height: 100px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<ion-spinner name="dots" class="spinner-large"></ion-spinner>
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题。
使用 Ionic Native,可以通过本机插件使用 iBeacons: https: //ionicframework.com/docs/native/ibeacon
示例代码是为使用 Ionic 和 AngularJS 的人编写的,但我使用的是 VueJS,我不知道如何让它工作:
示例代码的 Angular 版本:
import { IBeacon } from '@ionic-native/ibeacon/ngx';
constructor(private ibeacon: IBeacon) { }
...
// Request permission to use location on iOS
this.ibeacon.requestAlwaysAuthorization();
// create a new delegate and register it with the native layer
let delegate = this.ibeacon.Delegate();
// Subscribe to some of the delegate's event handlers
delegate.didRangeBeaconsInRegion()
.subscribe(
data => console.log('didRangeBeaconsInRegion: ', data),
error => console.error()
);
delegate.didStartMonitoringForRegion()
.subscribe(
data => console.log('didStartMonitoringForRegion: ', data),
error …Run Code Online (Sandbox Code Playgroud) 我正在制作一个 Ionic React 应用程序,并使用 Firebase 来验证我的用户。我面临的一个问题是,在登录/注册页面上,如果自动填充用户的用户名(电子邮件)或密码,则不会触发该输入项的 onChange 事件,并且用户的信息不会保存到我的组件的状态中。有没有更好的方法可以让我在不完全 hacky 的情况下完成此任务?
const LoginPage: React.FC = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
async function login() {
const res = await loginUser(username, password);
if(!res) {
toast('There was an error logging in.')
}else {
toast('You are logged in!');
}
}
...
<IonItem>
<IonLabel position="stacked">
Email <IonText color="danger">*</IonText>
</IonLabel>
<IonInput
required
type="email"
onIonChange={(e: any) => setUsername(e.target.value)}
></IonInput>
</IonItem>
<IonItem>
<IonLabel position="stacked">
Password <IonText color="danger">*</IonText>
</IonLabel>
<IonInput
required
type="password" …Run Code Online (Sandbox Code Playgroud) 我正在尝试为我的Ionic应用程序获取全屏视频背景,它在 Android 和浏览器上运行良好,但是当我在 Xcode 模拟器中的 iPhone 上运行该应用程序时,它只是一个白色背景,视频无法加载.
html代码:
<div class="fullscreen-bg">
<video autoplay loop muted playsinline webkit-playsinline>
<source src="/assets/videos/background.mp4" type="video/mp4">
</video>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS 代码:
.fullscreen-bg {
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
z-index: -100;
height: 100vh;
}
Run Code Online (Sandbox Code Playgroud)
我还在 config.xml 文件中添加了这个
<preference name="AllowInlineMediaPlayback" value="true"/>
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
我正在创建一个离子电容器应用程序。在我的应用程序中,我必须使用 QR 扫描仪,所以我使用https://ionicframework.com/docs/native/qr-scanner插件来集成 qr 扫描仪。然后我做ionic capacitor copy android和ionic capacitor open android。然后在 android studio 当我尝试构建它时抛出
电容cordova-android-plugins/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java -找不到符号类ActivityCompat -找不到符号变量ActivityCompat
Ionic 版本为 6.4.0,android studio 版本为 3.6.2
有人可以帮我解决这个问题。
我正在尝试通过 Android Studio 将我的 Ionic Angular 应用程序发布到 Google Play 商店,但在生成 Android 应用程序包时遇到问题。
当我在 Android Studio 中打开应用程序时,我会转到Build>Generate Signed Bundle / APK
下面的 3 个屏幕截图显示了我输入的值。
屏幕一:
屏幕二:
屏幕三:
但是当我单击 时Finish,没有显示任何提示、错误消息等来表明捆绑包是否已创建。
当我转到 时android/app,没有release出现文件夹。
有人可以告诉我为什么如果未创建文件夹则不会出现错误消息吗?
我尝试为我的 Ionic 应用程序构建图像缓存服务。
<ion-col [routerLink]="['/category-detail',cat.objectId,i]" class="category-item"
*ngFor="let cat of categories;index as i" size="3">
<ion-img class="cat-image" [src]="getImage(cat.image.url) | async">
</ion-img>
<p class="cat-name">
{{cat.name}}
</p>
</ion-col>
Run Code Online (Sandbox Code Playgroud)
我从 ion-image 中的 src 标签调用该函数
async getImage(fileUrl: any) {
return await this.cacheService.checkFile(fileUrl);
}
Run Code Online (Sandbox Code Playgroud)
该函数检查文件是否存在,返回文件的 URL,否则返回参数中的 URL
public async checkFile(fileUrl) {
let stringURL = String(fileUrl);
let fileName = stringURL.split('//')[1].replace(/\//g, '-');
return this.file.checkFile(this.file.tempDirectory, fileName)
.then(
async result => {
if (result) {
return this.file.tempDirectory + fileName;
} else {
return fileUrl;
}
}
)
.catch(
async err => …Run Code Online (Sandbox Code Playgroud) 当它以离子连接时,我试图在线条之间填充颜色。当四线相互接触时,我想在线条之间填充颜色。为此,我使用触摸事件创建了一个画布演示。请帮助解决我的问题。
我们在画布框中有 4 条线,我们将拖动它们并连接每条线并给出一个形状线框。这意味着我们的线现在连接了线之间的填充颜色,因此框填充了颜色。
html文件:
<canvas #canvasDraw width="300" height="300" (touchstart)="handleTouchStart($event)"
(touchmove)="handleTouchmove($event)"
(touchend)="handleTouchEnd($event)">
You need a browser that supports HTML5!
</canvas>
Run Code Online (Sandbox Code Playgroud)
.ts 文件:
import { Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
@ViewChild('canvasDraw', { static: false }) canvas: ElementRef;
canvasElement: any;
lines: any[];
isDown: boolean = false;
startX: number;
startY: number;
nearest: any;
offsetX: any;
offsetY: any;
constructor() {
}
ngAfterViewInit() {
this.canvasElement = this.canvas.nativeElement;
this.lines = [];
this.lines.push({ x0: …Run Code Online (Sandbox Code Playgroud) 我们正在开发一个新的 angular ionic 应用程序,它构建在我们所有的 powershell 机器上,但在我们的构建机器上,当它将文件从 perforce 拉到我们的 D: 驱动器时,它无法构建。我们的构建机器使用 teamcity,我们使用 powershell 构建步骤来运行我们的 ng 命令。我可以使用完全相同的文件,如果我将 powershell 脚本明确指向它们,它们就会构建(我什至在执行此操作之前删除了 node_modules)。
这是我们得到的错误。我删除了与我们的构建机器相关的路径部分,以保持其清洁。
ERROR in ./src/global.scss (<path to application>/node_modules/css-loader/dist/cjs.js??ref--13-1!<path to application>/node_modules/postcss-loader/src??embedded!/node_modules/sass-loader/dist/cjs.js??ref--13-3!./src/global.scss)
Module build failed (from <path to application>/node_modules/postcss-loader/src/index.js):
Error: Failed to find '@ionic/angular/css/core.css'
in [
<path to application>\projects\ta\src
]
at resolveModule.catch.catch (<path to application>\node_modules\postcss-import\lib\resolve-id.js:35:13)
@ ./src/global.scss 2:26-225
@ multi ./src/theme/variables.scss ./src/global.scss ./src/theme/site.scss
Run Code Online (Sandbox Code Playgroud)
我检查了@ionic/angular/css/core.css文件是否真的丢失了,即使找不到它,它也在 node_modules 中。
我们使用下面的命令来构建
ng run ta:build --verbose
Run Code Online (Sandbox Code Playgroud)
我们正在使用各种软件的以下版本
我对构建 Angular 应用程序不是很熟悉,所以如果你需要我提供其他信息,请告诉我,我可以提供。
{
"name": "tenantapp",
"version": …Run Code Online (Sandbox Code Playgroud) ionic-framework ×10
angular ×4
android ×2
capacitor ×2
cordova ×2
css ×2
angularjs ×1
async-await ×1
autofill ×1
html ×1
ionic-native ×1
ionic3 ×1
ionic4 ×1
ios ×1
javascript ×1
observable ×1
ramdisk ×1
reactjs ×1
teamcity ×1
typescript ×1
vue.js ×1