1
- def localProperties = new Properties ()
2
- def localPropertiesFile = rootProject. file(' local.properties' )
3
- if (localPropertiesFile. exists()) {
4
- localPropertiesFile. withReader(' UTF-8' ) { reader ->
5
- localProperties. load(reader)
6
- }
7
- }
8
-
9
- def flutterRoot = localProperties. getProperty(' flutter.sdk' )
10
- if (flutterRoot == null ) {
11
- throw new GradleException (" Flutter SDK not found. Define location with flutter.sdk in the local.properties file." )
12
- }
13
-
14
- def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
15
- if (flutterVersionCode == null ) {
16
- flutterVersionCode = ' 1'
17
- }
18
-
19
- def flutterVersionName = localProperties. getProperty(' flutter.versionName' )
20
- if (flutterVersionName == null ) {
21
- flutterVersionName = ' 1.0'
1
+ plugins {
2
+ id " com.android.application"
3
+ id " kotlin-android"
4
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5
+ id " dev.flutter.flutter-gradle-plugin"
22
6
}
23
7
24
- apply plugin : ' com.android.application'
25
- apply plugin : ' kotlin-android'
26
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27
-
8
+ // flutter. variables commented for backwards compatibility with Flutter 3.16 and 3.19.
28
9
android {
29
- compileSdkVersion 34
30
-
31
- namespace ' com.xraph.plugin.flutter_unity_widget_example '
10
+ namespace = " com.xraph.plugin.flutter_unity_widget_example "
11
+ compileSdk = 34 // flutter.compileSdkVersion
12
+ // ndkVersion = flutter.ndkVersion
32
13
33
- compileOptions {
14
+ compileOptions {
34
15
sourceCompatibility JavaVersion . VERSION_17
35
16
targetCompatibility JavaVersion . VERSION_17
36
17
}
@@ -39,34 +20,35 @@ android {
39
20
main. java. srcDirs + = ' src/main/kotlin'
40
21
}
41
22
42
- lintOptions {
43
- disable ' InvalidPackage'
23
+ kotlinOptions {
24
+ // if you change this value, also change it in android/build.gradle subprojects{}
25
+ jvmTarget = JavaVersion . VERSION_17
44
26
}
45
27
46
28
defaultConfig {
47
- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48
- applicationId " com.xraph.plugin.flutter_unity_widget_example"
49
- minSdkVersion 28 // >= unity minSdk in player settings
50
- targetSdkVersion 34
51
- versionCode flutterVersionCode. toInteger()
52
- versionName flutterVersionName
29
+ applicationId = " com.xraph.plugin.flutter_unity_widget_example"
30
+ // You can update the following values to match your application needs.
31
+ // For more information, see: https://flutter.dev/to/review-gradle-config.
32
+ minSdk = 28 // flutter.minSdkVersion // >= unity minSdk in player settings
33
+ targetSdk = 34 // flutter.targetSdkVersion
34
+ versionCode = 1 // flutter.versionCode
35
+ versionName = " 1.0.0" // flutter.versionName
53
36
}
54
37
55
38
buildTypes {
56
39
release {
57
40
// TODO: Add your own signing config for the release build.
58
41
// Signing with the debug keys for now, so `flutter run --release` works.
59
- signingConfig signingConfigs. debug
42
+ signingConfig = signingConfigs. debug
60
43
}
61
44
}
62
45
}
63
46
64
47
flutter {
65
- source ' ../..'
48
+ source = " ../.."
66
49
}
67
50
68
51
dependencies {
69
52
implementation project(' :unityLibrary' )
70
53
implementation project(' :flutter_unity_widget' )
71
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
72
54
}
0 commit comments