在我运行应用程序时,我尝试将我的应用程序与Firebase连接时显示错误- *其中: 构建文件“ D:\ AndroidStudio \ login \ android \ app \ build.gradle”行:24
这是我的应用程序级别build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.mdhv.login"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
这是我的项目级别build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
运行我的应用程序后,它显示以下错误-
失败:构建失败,并出现异常。
其中: 构建文件“ D:\ AndroidStudio \ login \ android \ app \ build.gradle”行:24
出了什么问题: 评估项目':app'时发生问题。
ASCII
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。
1秒内失败 命令:D:\ AndroidStudio \ login \ android \ gradlew.bat app:properties
完成错误:请在android /文件夹中查看您的Gradle项目设置。
运行'flutter run -v'后显示-
Please review your Gradle project setup in the android/ folder.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 _readGradleProject (package:flutter_tools/src/android/gradle.dart:158:7)
<asynchronous suspension>
#2 _gradleProject (package:flutter_tools/src/android/gradle.dart:111:34)
<asynchronous suspension>
#3 getGradleAppOut (package:flutter_tools/src/android/gradle.dart:105:29)
<asynchronous suspension>
#4 AndroidApk.fromAndroidProject (package:flutter_tools/src/application_package.dart:160:23)
<asynchronous suspension>
#5 ApplicationPackageFactory.getPackageForPlatform (package:flutter_tools/src/application_package.dart:47:32)
<asynchronous suspension>
#6 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:352:56)
<asynchronous suspension>
#7 HotRunner.run (package:flutter_tools/src/run_hot.dart:251:39)
<asynchronous suspension>
#8 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:469:37)
<asynchronous suspension>
#9 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:478:18)
<asynchronous suspension>
#10 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:383:33)
<asynchronous suspension>
#11 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#12 _rootRun (dart:async/zone.dart:1124:13)
#13 _CustomZone.run (dart:async/zone.dart:1021:19)
#14 _runZoned (dart:async/zone.dart:1516:10)
#15 runZoned (dart:async/zone.dart:1463:12)
#16 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#17 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:375:20)
#18 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#19 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:396:21)
<asynchronous suspension>
#20 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#21 _rootRun (dart:async/zone.dart:1124:13)
#22 _CustomZone.run (dart:async/zone.dart:1021:19)
#23 _runZoned (dart:async/zone.dart:1516:10)
#24 runZoned (dart:async/zone.dart:1463:12)
#25 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#26 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:356:19)
<asynchronous suspension>
#27 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#28 new Future.sync (dart:async/future.dart:224:31)
#29 CommandRunner.run (package:args/command_runner.dart:112:14)
#30 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:242:18)
#31 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:22)
<asynchronous suspension>
#32 _rootRun (dart:async/zone.dart:1124:13)
#33 _CustomZone.run (dart:async/zone.dart:1021:19)
#34 _runZoned (dart:async/zone.dart:1516:10)
#35 runZoned (dart:async/zone.dart:1500:12)
#36 run.<anonymous closure> (package:flutter_tools/runner.dart:60:18)
<asynchronous suspension>
#37 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#38 _rootRun (dart:async/zone.dart:1124:13)
#39 _CustomZone.run (dart:async/zone.dart:1021:19)
#40 _runZoned (dart:async/zone.dart:1516:10)
#41 runZoned (dart:async/zone.dart:1463:12)
#42 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#43 runInContext (package:flutter_tools/src/context_runner.dart:56:24)
<asynchronous suspension>
#44 run (package:flutter_tools/runner.dart:51:10)
#45 main (package:flutter_tools/executable.dart:62:9)
<asynchronous suspension>
#46 main (file:///C:/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#47 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#48 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
答案 0 :(得分:2)
我也遇到了这个问题,正在改变
console.log('client', client)
收件人
var AWS = require('aws-sdk');
AWS.config.update({region: 'eu-west-2'});
// create the promise object for ELB call
var elb_describe = new AWS.ELB().describeLoadBalancers().promise();
// handle the promise object
elb_describe.then(
function(data) {
for (i = 0; i < (data.LoadBalancerDescriptions).length; i++) {
console.log(`Instances attached to ${data.LoadBalancerDescriptions[i].LoadBalancerName}`)
for (j = 0; j < (data.LoadBalancerDescriptions[0].Instances).length; j++) {
console.log(data.LoadBalancerDescriptions[0].Instances[j])
}
}
},
function(error) {
console.log(error)
}
);
// create promise object for elbv2 call
var elbv2_describe = new AWS.ELBv2().describeLoadBalancers().promise();
// handle the promise object
elbv2_describe.then(
function(data) {
// for number of results returned in describe load balancers call
for (i = 0; i < (data.LoadBalancers).length; i++) {
let lb_arn = data.LoadBalancers[i].LoadBalancerArn
// get Target groups associated with the load balancer
elbv2_get_target_groups = new AWS.ELBv2().describeTargetGroups({ LoadBalancerArn: lb_arn}).promise();
elbv2_get_target_groups.then(
function(data) {
//only selecting the first result from the results, will need modifying for LBs forwarding to multiple TGs
let tg_arn = data.TargetGroups[0].TargetGroupArn
// get target health of instances registered to the target group (only way I could find of getting the instance-id)
elbv2_get_target_health = new AWS.ELBv2().describeTargetHealth({ TargetGroupArn: tg_arn}).promise();
elbv2_get_target_health.then(
function(data) {
console.log(`Instances registered to '${tg_arn}', associated with ${lb_arn}`)
for (j = 0; j < (data.TargetHealthDescriptions).length; j++) {
console.log(data.TargetHealthDescriptions[j].Target)
}
}
)
}
)
}
},
function(error) {
console.log(error)
}
);
为我修复了。
答案 1 :(得分:0)
我遇到了这个问题并通过以下方式解决了:
Win + R
并输入 resmon.exe 并按 Enter。flutter clean
。pub get
再次获取所有依赖项。这对我有用。