我运行离子运行android,它开始下载很多东西,除了gradle我下载它并自己设置路径,现在我有2个问题:
1:离子框架是否应该随每个新项目下载大量内容?
和
2:我如何解决以下错误,我将ANDROID_PATH变量设置为指向包存在的Android-SDK
什么地方出了错:
评估根项目'android'时出现问题:
No installed build tools found. Install the Android build tools version 19.1.0
or higher.
Run Code Online (Sandbox Code Playgroud) 我正在创建一个Stripe支付系统,并且很难使这个集成代码正常运行.代码是从这里拉出来的.我想要做的是创建一个数据库引用到用户的特定用户ID(uid),因为createStripeCharge等待write event发生类似的事情/stripe_customers/XCXaweADowefj/charges/QC123XYZ.我不确定,但也许我的问题是我错误地引用了客户.如果您对我如何正确使用此功能有任何想法或反馈,我非常感谢!
触发器(这会导致云功能工作):
payByStripe(amount,email,userId, token): firebase.database.Reference {
return firebase.database().ref(`/stripe_customers/${userId}/charges/`).push({
amount:amount,
email:email,
token:token
});
}
Run Code Online (Sandbox Code Playgroud)
云功能:
exports.createStripeCharge = functions.database.ref('/stripe_customers/{userId}/charges/{id}').onWrite(event => {
const val = event.data.val();
if (val === null || val.id || val.error) return null;
return admin.database().ref(`/stripe_customers/${event.params.userId}/customer_id`).once('value').then(snapshot => {
return snapshot.val();
}).then(customer => {
const amount = val.amount;
const idempotency_key = event.params.id;
let charge = {amount, currency, customer};
if (val.source !== null) charge.source = val.source;
return stripe.charges.create(charge, {idempotency_key});
}).then(response …Run Code Online (Sandbox Code Playgroud) 我最近更新了android studio,现在我在尝试使用离子cordova构建时出现此错误,我正在使用gradle-4.4.1
谁能帮帮我吗.
离子信息:
cli包:(C:\ Users\David\AppData\Roaming \npm \node_modules)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
Run Code Online (Sandbox Code Playgroud)
全球套餐:
cordova (Cordova CLI) : 7.0.1
Run Code Online (Sandbox Code Playgroud)
本地包裹:
@ionic/app-scripts : 3.0.0
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.7.1
Run Code Online (Sandbox Code Playgroud)
系统:
Android SDK Tools : 26.1.1
Node : v6.10.3
npm : 5.5.1
OS : Windows 10
Run Code Online (Sandbox Code Playgroud)
其他:
backend : legacy
Run Code Online (Sandbox Code Playgroud)
[错误]运行cordova build android时出错(退出代码1):
(截断)... v7/27.0.2/appcompat-v7-27.0.2.jar
file:/path/platforms/android/sdk-manager/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar
Required by:
project :
> Could not find com.android.support:support-v4:27.0.2.
Searched in the following locations:
file:/path/AndroidStudio/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.2/support-v4-27.0.2.pom
file:/path/AndroidStudio/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.2/support-v4-27.0.2.jar
file:/path/platforms/android/sdk-manager/com/android/support/support-v4/27.0.2/support-v4-27.0.2.jar …Run Code Online (Sandbox Code Playgroud) 我有一个离子应用程序使用ionic1制作并使用OneSignal进行推送通知.目前,在以下情况下,一个信号适用于推送通知: - 应用程序已打开 - 应用程序处于后台或终止,单击推送通知
使用这两个函数handleNotificationReceived和handleNotificationOpened
window.plugins.OneSignal.handleNotificationReceived(function(jsonData) {
$state.go('panicalarm');
console.log("navigate to panicalarm page");
})
window.plugins.OneSignal.handleNotificationOpened(function(jsonData) {
$state.go('panicalarm');
console.log("navigate to panicalarm page");
})
Run Code Online (Sandbox Code Playgroud)
我想知道,如何在直接启动应用程序时处理推送通知,或者在不点击推送通知的情况下将应用程序从后台运行到前台?那可能吗 ?
我试图将我的Ionic应用程序作为ios本机应用程序运行,并且遇到一个奇怪的URL连接错误,该错误阻止数据填充到我的应用程序视图中。当我以iphone的形式在网络浏览器中运行该应用程序时,它可以正常运行并填充,但是在本机ios上运行时,它并没有使用API数据按预期填充页面。我已经检查了控制台,实际上已经调用了API,但是xcode控制台正在打印出填充页面数据的2个API调用的以下内容:
2018-02-19 11:30:21.199933-0500 MyApp[1429:350591] NSURLConnection finished with error - code -1100
2018-02-19 11:30:21.202556-0500 MyApp[1429:350591] NSURLConnection finished with error - code -1100
Run Code Online (Sandbox Code Playgroud)
我已经看到并看到代码-1100通常是一个找不到文件的问题类型,但是我不确定这将如何发生,因为它只是通过API调用返回数据,然后将其存储在离子卡格式。
我有一个Ionic2和Angular2 的项目。
我在代码中使用RamdaJS,可以完美地与以下命令配合使用:
ionic serve ionic cordova build android ionic cordova run android但是,当我尝试执行以下命令:时ionic cordova build android --prod --release,出现有关Ramda和Type的错误。
看到我的一部分package.json:
"dependencies": {
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/flex-layout": "^2.0.0-rc.1",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",
"@angular/material": "2.0.0-beta.2",
"@angular/platform-browser": "2.4.8",
"@angular/platform-browser-dynamic": "2.4.8",
"@angular/platform-server": "2.4.8",
"@angular/router": "3.4.8",
"@ionic-native/camera": "3.7.0",
"@ionic-native/core": "3.7.0",
"@ionic-native/network": "3.7.0",
"@ionic-native/splash-screen": "3.7.0",
"@ionic-native/status-bar": "3.7.0",
"@ionic/storage": "2.0.0",
"cordova-plugin-device": "^2.0.1",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3",
"hammerjs": "2.0.8",
"ionic-angular": "2.3.0", …Run Code Online (Sandbox Code Playgroud) 我知道此链接:https : //cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#where-to-store-files
但我想将文件保存在下载目录中。是否可以使用Ionic将文件保存在任何路径中?如果是这样,请分享示例。
这是代码:
downloadImage(image) {
this.platform.ready().then(() => {
const fileTransfer: TransferObject = this.transfer.create();
const imageLocation = `${cordova.file.applicationDirectory}www/assets/img/${image}`;
fileTransfer.download(imageLocation, cordova.file.externalDataDirectory + image).then((entry) => {
const alertSuccess = this.alertCtrl.create({
title: `Download Succeeded!`,
subTitle: `${image} was successfully downloaded to: ${entry.toURL()}`,
buttons: ['Ok']
});
alertSuccess.present();
}, (error) => {
const alertFailure = this.alertCtrl.create({
title: `Download Failed!`,
subTitle: `${image} was not successfully downloaded. Error code: ${error.code}`,
buttons: ['Ok']
});
alertFailure.present();
});
});
}
Run Code Online (Sandbox Code Playgroud)
基本上,我想将文件保存在用户可见的位置。
我想知道如何确保ion-list显示正确的内容.
该ion-list如下所示:
<ion-list [virtualScroll]="list" [approxItemHeight]="'132px'">
<ion-item *virtualItem="let item">
<span item-start>{{item.foo}}</span>
</ion-item>
</ion-list>
Run Code Online (Sandbox Code Playgroud)
单元测试:
it('should display the correct content', () => {
comp.list = [ { foo: 'bar' } ];
fixture.detectChanges();
de = fixture.debugElement.query(By.css('ion-content'));
el = de.nativeElement;
console.log(el);
});
Run Code Online (Sandbox Code Playgroud)
这输出:
<ion-list class="list list-md virtual-loading" ng-reflect-virtual-scroll="[object Object],[object Object" ng-reflect-approx-item-height="132px">
<!---->
</ion-list>
Run Code Online (Sandbox Code Playgroud)
如何触发因果报应来呈现ion-item的ion-list?
ionic-framework ×10
android ×4
cordova ×3
ionic3 ×3
angular ×2
ios ×2
firebase ×1
gradle ×1
ionic2 ×1
jasmine ×1
javascript ×1
karma-runner ×1
node.js ×1
onesignal ×1
plugins ×1
ramda.js ×1
typescript ×1