我正在使用 Angular 4/Ionic 3 构建一个应用程序,加载用户从服务器上传的图像。我目前正在使用下面的代码,但它不起作用:
<img src="{{user.image}} || assets/images/profileimage.png" />
Run Code Online (Sandbox Code Playgroud)
我不确定我做错了什么。我想在主图像从服务器加载之前它会显示占位符图像。相反,在主图像加载之前它仍然是空白的。我应该使用 Angular 特有的东西吗?
我刚刚将我的 Xcode 更新到版本 10.0 (10A255),它也在我的 MacBook 上运行。之后我使用了命令
sudo ionic cordova build ios --emulator --prod
Run Code Online (Sandbox Code Playgroud)
然后它开始正常构建,但构建似乎永远不会结束,因为此过程永远不会返回“构建失败”或“构建成功”。它显然突然结束,这是终端中的输出:
Running app-scripts build: --prod --platform ios --target cordova
[16:09:56] build prod started ...
[16:09:56] clean started ...
[16:09:56] clean finished in 3 ms
[16:09:56] copy started ...
[16:09:57] deeplinks started ...
[16:09:58] deeplinks finished in 1.52 s
[16:09:58] ngc started ...
[16:10:27] ngc finished in 28.76 s
[16:10:27] preprocess started ...
[16:10:27] preprocess finished in less than 1 ms
[16:10:27] webpack started ...
[16:10:27] copy …Run Code Online (Sandbox Code Playgroud) 我已经完成了一个项目,我想构建一个apk。我已经尝试构建它,但是在编写构建它的句子之后,第三个代码给了我一个错误。这里我写的代码或语句来构建它。
ionic cordova platform remove android
ionic cordova plarform add android@6.4.0
ionic cordova build android
Run Code Online (Sandbox Code Playgroud)
3 天前,我按照上面编写的代码构建了一个项目。这里的错误。(这次我连接了firebase)
Platform android already added.
[ERROR] An error occurred while running subprocess cordova.
cordova platform add android@6.4.0 --save exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
E:\ionic\notasFirebase>ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[19:08:57] ionic-app-scripts 3.2.0
[19:08:57] build dev started ...
[19:08:57] clean started ...
[19:08:57] clean finished in 13 ms
[19:08:57] …Run Code Online (Sandbox Code Playgroud) cordova ionic-framework firebase-realtime-database ionic3 ionic4
离子 3 应用程序
我一直在使用这个插件:cordova-plugin-firebase 2.0.5几乎一年没有问题了,所有的 phoneauth 测试都适用于 iOS 和 Android。一周前,生产版本(在商店中)开始下载和用户注册,我们注意到一些用户从未收到过短信,而其他人确实收到了没有问题的短信。我自己测试了它,发现这种行为有时我会收到,有时我没有,即使尝试了不同的电话号码或设备(在 4 个不同的 android 设备和 2 个 iOS 上尝试过)。
在“verifyPhoneNumber”功能上没有发现错误(就在我尝试了太多次并且每个用户 cuota 每小时超过 10 条短信时)。
我联系了 firebase 支持团队,他们告诉我他们的状态仪表板上没有任何事件报告,无法提供更多帮助,因为这不是他们的官方 SDK。
我进一步研究了为什么会发生这种情况,我坚信这可能是由于电话运营商(来自墨西哥)阻止了@bojeil 在此问题中评论的某些内容的消息:
Android Firebase 电话身份验证未发送任何短信 https://github.com/firebase/quickstart-android/issues/287
预期行为 SMS 应始终在出现任何问题时发送。
我在 firebase 中有 2 个项目用于这个应用程序(生产和开发),并且我都经历过同样的行为。我不认为问题出在我的代码中,而是将其用于进一步的信息:
this.firebaseNative.verifyPhoneNumber(this.telephone.full, 120).then(res => {
this.verificationId = res.verificationId; // android case, on iOS I get
the string directly from the response // ... promt the user to input the sms code
}).catch(
error => { console.error(error); // ... …Run Code Online (Sandbox Code Playgroud) 我正在使用 IONIC 3 构建应用程序,并且在构建生产应用程序时遇到了 JS 问题。
我使用代码ionic cordova build ios --prod
并出现以下错误
<--- Last few GCs --->
[2769:0x104000000] 198493 ms: Mark-sweep 8037.6 (8188.4) -> 8037.6 (8189.4) MB, 10477.9 / 0.0 ms (average mu = 0.108, current mu = 0.001) allocation failure scavenge might not succeed
[2769:0x104000000] 211226 ms: Mark-sweep 8038.6 (8189.4) -> 8038.5 (8190.9) MB, 12720.3 / 0.0 ms (average mu = 0.048, current mu = 0.001) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS …Run Code Online (Sandbox Code Playgroud) 我在其中一个项目中使用了 Ionic 版本 3,并且我使用了 ion-list,其中图像是从 firebase 渲染的。在浏览器上一切正常,但是一旦我构建了 apk,只有前几张图像会正确渲染,并且在虚拟滚动(无限滚动)时,图像会闪烁并消失。
我的代码层次结构如下:-
<ion-list>
<ion-card>
<ion-col>
<div>
<ion-row>
<img/>
</ion-row>
</div>
</ion-col>
</ion-card>
</ion-list>
Run Code Online (Sandbox Code Playgroud)
我已经使用 img 标签来加载图像。我尝试了所有可能的解决方案,但无法破解它。
我还尝试了以下方法来解决这个问题:1) 尝试更改 img 标签的位置。2) 尝试使用 ion-img 标签。3) 尝试了 npm 的完美滚动条模块 4) 按照这个链接 masteringionic.com/blog/... 5) 试图找到任何事件冒泡的踪迹。在尝试了所有这些之后,如果有的话,我会寻求您的帮助。
预先感谢您的解决方案!
我正在 Ionic3 中创建 ios13 应用程序。
但是 ios13Beta2 在 InAppBrowser 中不起作用。
所以选择参数'_blank',这个应用程序崩溃了。
这是错误详情。
[TraitCollection] 类 _UIFullscreenPresentationController 覆盖了 -traitCollection getter,不支持。如果您尝试覆盖特征,则必须使用适当的 API。
我的离子环境
离子:
Ionic CLI : 5.0.3
Ionic Framework : ionic-angular 3.9.6
@ionic/app-scripts : 3.2.4
Run Code Online (Sandbox Code Playgroud)
科尔多瓦:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 14 other plugins)
Run Code Online (Sandbox Code Playgroud)
公用事业:
cordova-res : not installed
native-run : not installed
Run Code Online (Sandbox Code Playgroud)
系统:
ios-sim : 8.0.1
NodeJS : v12.4.0
npm : 6.9.0
OS : macOS Catalina
Xcode : …Run Code Online (Sandbox Code Playgroud) 我有一个 ionic3 项目,我正在尝试在 iphone plus 8、12.4 模拟器上运行它。但是,当我运行时:
ionic cordova emulate ios --target="iPhone-8-Plus" --verbose
Run Code Online (Sandbox Code Playgroud)
它给了我一个错误:
** BUILD SUCCEEDED **
Command finished with error code 0: xcodebuild -workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 8 Plus,build,CONFIGURATION_BUILD_DIR=/Users/myuser/MyProjects/mobileapp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/myuser/MyProjects/mobileapp/platforms/ios/build/sharedpch,-UseModernBuildSystem=0
No scripts found for hook "after_compile".
No scripts found for hook "after_build".
> native-run ios --app "platforms/ios/build/emulator/MyApp.app" --target iPhone-8-Plus --verbose
[native-run] 2019-08-08T10:01:24.916Z client:usbmuxd connectUsbmuxdSocket
[native-run] 2019-08-08T10:01:24.919Z client:usbmuxd getDevices
[native-run] 2019-08-08T10:01:24.920Z protocol:usbmux socket write: {"messageType":"ListDevices"}
[native-run] 2019-08-08T10:01:25.517Z protocol:usbmux Response: {"DeviceList":[]}
[native-run] 2019-08-08T10:01:25.523Z native-run Caught fatal error: { Error: No device or simulator …Run Code Online (Sandbox Code Playgroud) 在我的 Ionic3 应用程序中,我计算文件大小如下。
HTML
<div>
<input type="file" accept="*" (change)="onSelect($event)">
<button ion-button (click)="calcSize()">calculate size</button>
</div>
<p>Size: {{ size }}</p>
Run Code Online (Sandbox Code Playgroud)
TS
file: File;
size: number;
onSelect(event: any) {
this.file = event.target.files[0];
}
calcSize() {
this.size = this.file.size;
}
Run Code Online (Sandbox Code Playgroud)
以上代码在 iOS 13.2 以下的所有 Android 设备和 iOS 设备上都能完美运行。
但是在 iOS 设备上从照片库中选择大于 13.2 的size视频时,只有视频文件的值为 0。
但是当从 iCloud Drive 选择视频时效果很好。
任何帮助都受到高度赞赏。
在StackBlitz上查找问题。
我真的需要一些帮助来配置 karma.conf.js 以处理打字稿文件,或者不确定缺少什么或我在这里做错了什么。非常新的单元测试并学习了 Jasmine 框架(在示例中它使用 *.js 和 *.spec.js 文件)但在我的 ionic-angular 项目中它的 *.ts 文件和获取错误(如下所示)。我一直试图弄清楚2天,但无法解决这个问题。任何帮助真的很感激。
[在 Angular 6 (6.1.10) 和 typescript (3.8.+.) 中使用 ionic 3 (ionic-angular 3.9.+) 框架]
我的 tsconfig.json >
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"target": "es6"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"src/**/*.spec.ts",
"src/**/__tests__/*.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
Run Code Online (Sandbox Code Playgroud)
我的 karma.conf.js >
module.exports = function (config) { …Run Code Online (Sandbox Code Playgroud) ionic3 ×10
cordova ×5
angular ×4
ios ×3
firebase ×2
javascript ×2
android ×1
html ×1
ionic4 ×1
ios13.2 ×1
iphone ×1
node.js ×1
typescript ×1
unit-testing ×1
xcode10 ×1