gradle crash

backend_nfc
Serik.Uvaissov 2020-07-21 22:56:34 +06:00
parent ee598f59d8
commit 4196636df1
4 changed files with 71 additions and 3 deletions

View File

@ -50,6 +50,7 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -66,9 +67,21 @@ android {
buildConfigField ("String[]", "SUPPORTED_DEVICES", collectSupportedDevicesToArray())
}
release {
minifyEnabled false
shrinkResources false
signingConfig signingConfigs.release
}
}
compileOptions {
//coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
flutter {
@ -76,6 +89,7 @@ flutter {
}
dependencies {
//coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
@ -132,3 +146,5 @@ def collectSupportedDevicesToArray() {
"\"${it}\""
}.join(",") + '}'
}

View File

@ -73,6 +73,12 @@ public class BankNfcPlugins implements MethodCallHandler {
case "shutdown":
shutdown(call, result);
break;
case "version":
result.success("version: "+Runtime.class.getPackage().getSpecificationVersion());
break;
case "get":
final List<Object> json = new ArrayList<>();
for (int i = 0; i < 2; i++) {
@ -86,6 +92,16 @@ public class BankNfcPlugins implements MethodCallHandler {
}
private static int getVersion() {
String version = System.getProperty("java.version");
if(version.startsWith("1.")) {
version = version.substring(2, 3);
} else {
int dot = version.indexOf(".");
if(dot != -1) { version = version.substring(0, dot); }
} return Integer.parseInt(version);
}
private void init(MethodCall call, Result result) {
String serverUrl = call.argument("serverUrl");

View File

@ -130,6 +130,12 @@ allprojects {
google()
jcenter()
}
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 2, 'minutes'
}
}
}
rootProject.buildDir = '../build'
@ -143,3 +149,10 @@ subprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}

View File

@ -19,15 +19,16 @@ class _BankViewState extends State<BankView> {
String payValue;
String cancelValue;
String shutdownValue;
String versionValue;
bool loading = false;
@override
void initState() {
super.initState();
load();
//load();
}
load() async {
initialize() async {
String result = await _channel.invokeMethod('init', <String, dynamic>{
'serverUrl': 'http://185.98.84.231:2000',
});
@ -36,6 +37,13 @@ class _BankViewState extends State<BankView> {
});
}
version() async {
String result = await _channel.invokeMethod('version');
setState(() {
versionValue = result ?? 'none';
});
}
connect() async {
String result = await _channel.invokeMethod("connection");
setState(() {
@ -111,7 +119,22 @@ class _BankViewState extends State<BankView> {
children: <Widget>[
RaisedButton(
child: Text('Activity m4Bank'), onPressed: activity),
Text('init: $initValue'),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text('version: $versionValue'),
RaisedButton(
child: Text('Version'), onPressed: version),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text('init: $initValue'),
RaisedButton(
child: Text('Init'), onPressed: initialize),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[