I installed firebase and QR_scan and by themselves they work very well, however when I put in the same application I get the error "Finished with error: Gradle task assembleDebug failed with exit code 1"
I already restarted the IDE and used Flutter Clean but the error persists
can you help me?
ANDROID/APP/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.")
}
Good afternoon
I installed firebase and QR_scan and by themselves they work very well, however when I put in the same application I get the error "Finished with error: Gradle task assembleDebug failed with exit code 1"
I already restarted the IDE and used Flutter Clean but the error persists can you help me?
Follow the data
PUBSPEC dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 cloud_firestore: ^0.12.5 qrscan: ^0.2.17
ANDROID/build.gradle
buildscript { ext.kotlin_version = '1.3.41' repositories { google() jcenter() }
}
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 }
ANDROID/APP/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 plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { compileSdkVersion 28
}
flutter { source '../..' }
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.google.firebase:firebase-analytics:17.2.0'
}
apply plugin: 'com.google.gms.google-services'
gradle.properties
org.gradle.jvmargs=-Xmx1536M
gradle-wrapper.properties
Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
APLICATION DART
import 'package:flutter/material.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'dart:async'; import 'package:qrscan/qrscan.dart' as scanner;
class Page_qrscan extends StatefulWidget { @override _Page_qrscanState createState() => _Page_qrscanState(); }
class _Page_qrscanState extends State {
String barcode = 'empty';
@override initState() { super.initState(); }
@override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text('Qrcode Scanner Example'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center, children:[
SizedBox(
width: 200, //300
height: 200, //300
child: Text('aqui tinha uma imagem'), // Image.memory(bytes),
),
Text('RESULT $barcode'),
RaisedButton(onPressed: _scan, child: Text("Scan")),
],
),
),
),
);
}
Future _scan() async { String barcode = await scanner.scan(); setState(() => this.barcode = barcode); _salva_firestore; } void _salva_firestore() async { var myDatabase = Firestore.instance;
} }