build.gradle
5.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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 = "555"
if (flutterVersionCode == null) {
flutterVersionCode = '555'
}
def flutterVersionName = "5.5.5"
if (flutterVersionName == null) {
flutterVersionName = '5.5.5'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions{
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
main { jniLibs.srcDirs = ['libs'] }
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
// disable 'InvalidPackage'
// disable "Instantiatable"
// checkReleaseBuilds false
// abortOnError false
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.naji.one_key"
minSdkVersion 24
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'arm64-v8a', 'x86_64', 'mips64' //魅族64位,不支持32位
// abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86_64','x86', 'mips', 'mips64'
}
lintOptions {
checkReleaseBuilds false
}
manifestPlaceholders = [
XG_ACCESS_ID : '1500012875',
XG_ACCESS_KEY : 'AVR2GJERH0HC',
HW_APPID : '102832405',
VIVO_APPID: "103886384",
VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2",
PACKAGE_NAME : "com.naji.one_key",// 小米通道
AMAP_KEY : "dbced781d0acd36184d5b4b54da7188d"
]
}
signingConfigs {
release {
storeFile file("./src/main/assets/xiaotao.jks")
storePassword "xt123456"
keyAlias "key0"
keyPassword "xt123456"
}
debug {
storeFile file("./src/main/assets/xiaotao.jks")
storePassword "xt123456"
keyAlias "key0"
keyPassword "xt123456"
}
}
buildTypes {
release {
minifyEnabled true
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug{
minifyEnabled false
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
// minifyEnabled true
// // TODO: Add your own signing config for the release build.
// // Signing with the debug keys for now, so `flutter run --release` works.
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
// configurations.all {
// resolutionStrategy {
// force 'androidx.core:core-ktx:1.6.0'
// }
// }
// configurations.all {
// resolutionStrategy.eachDependency {
// DependencyResolveDetails details ->
// def requested = details.requested
// if (requested.group == "androidx.appcompat") {
// if (requested.name == "appcompat") {
// details.useVersion "1.3.1"
// }
// }
// }
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.tencent.tpns:huawei:1.2.0.3-release'// 华为推送
implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release' // 小米推送
implementation 'com.tencent.tpns:oppo:1.2.0.3-release' // OPPO 推送
implementation 'com.tencent.tpns:vivo:1.2.0.3-release' // vivo 推送
implementation 'com.amap.api:location:4.7.0'
implementation 'com.zhihu.android:matisse:0.5.3-beta3'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}