Skip to content

Commit 9e4cc12

Browse files
committed
TV项目适配AGP
1 parent bbf0f36 commit 9e4cc12

12 files changed

Lines changed: 336 additions & 378 deletions

File tree

simple_live_tv_app/.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "367f9ea16bfae1ca451b9cc27c1366870b187ae2"
7+
revision: "d8a9f9a52e5af486f80d932e838ee93861ffd863"
88
channel: "stable"
99

1010
project_type: app
@@ -13,11 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
17-
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
18-
- platform: windows
19-
create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
20-
base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
16+
create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863
17+
base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863
18+
- platform: android
19+
create_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863
20+
base_revision: d8a9f9a52e5af486f80d932e838ee93861ffd863
2121

2222
# User provided section
2323

simple_live_tv_app/android/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gradle-wrapper.jar
77
GeneratedPluginRegistrant.java
88

99
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
10+
# See https://flutter.dev/to/reference-keystore
1111
key.properties
1212
**/*.keystore
1313
**/*.jks

simple_live_tv_app/android/app/build.gradle

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
plugins {
22
id "com.android.application"
33
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
45
id "dev.flutter.flutter-gradle-plugin"
56
}
67

8+
79
def localProperties = new Properties()
810
def localPropertiesFile = rootProject.file('local.properties')
911
if (localPropertiesFile.exists()) {
@@ -30,34 +32,30 @@ if (keystorePropertiesFile.exists()) {
3032

3133
android {
3234
namespace "com.xycz.simple_live_tv"
33-
compileSdkVersion flutter.compileSdkVersion
34-
ndkVersion flutter.ndkVersion
35+
compileSdk = flutter.compileSdkVersion
36+
ndkVersion = flutter.ndkVersion
3537

3638
compileOptions {
37-
sourceCompatibility JavaVersion.VERSION_1_8
38-
targetCompatibility JavaVersion.VERSION_1_8
39+
sourceCompatibility = JavaVersion.VERSION_1_8
40+
targetCompatibility = JavaVersion.VERSION_1_8
3941
}
4042

4143
kotlinOptions {
42-
jvmTarget = '1.8'
43-
}
44-
45-
sourceSets {
46-
main.java.srcDirs += 'src/main/kotlin'
44+
jvmTarget = JavaVersion.VERSION_1_8
4745
}
4846

4947
defaultConfig {
5048
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
5149
applicationId "com.xycz.simple_live_tv"
5250
// You can update the following values to match your application needs.
53-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
54-
minSdkVersion flutter.minSdkVersion
55-
targetSdkVersion flutter.targetSdkVersion
56-
versionCode flutterVersionCode.toInteger()
57-
versionName flutterVersionName
51+
// For more information, see: https://flutter.dev/to/review-gradle-config.
52+
minSdk = flutter.minSdkVersion
53+
targetSdk = flutter.targetSdkVersion
54+
versionCode = flutter.versionCode
55+
versionName = flutter.versionName
5856
}
5957

60-
signingConfigs {
58+
signingConfigs {
6159
release {
6260
keyAlias keystoreProperties['keyAlias']
6361
keyPassword keystoreProperties['keyPassword']
@@ -68,8 +66,7 @@ android {
6866
}
6967
}
7068
buildTypes {
71-
buildTypes {
72-
debug {
69+
debug {
7370
signingConfig signingConfigs.release
7471
}
7572
profile {
@@ -83,12 +80,9 @@ android {
8380
'proguard-android-optimize.txt'),
8481
'proguard-rules.pro'
8582
}
86-
}
8783
}
8884
}
8985

9086
flutter {
91-
source '../..'
87+
source = "../.."
9288
}
93-
94-
dependencies {}

simple_live_tv_app/android/app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xycz.simple_live_tv">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<uses-permission android:name="android.permission.INTERNET" />
33
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
44
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
55
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
66
<application
7-
android:label="Simple Live TV"
7+
android:label="Simple Live TV"
88
android:name="${applicationName}"
99
android:icon="@mipmap/ic_launcher"
1010
android:banner="@mipmap/ic_banner"
@@ -14,6 +14,7 @@
1414
android:name=".MainActivity"
1515
android:exported="true"
1616
android:launchMode="singleTop"
17+
android:taskAffinity=""
1718
android:theme="@style/LaunchTheme"
1819
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1920
android:hardwareAccelerated="true"
@@ -40,4 +41,15 @@
4041
android:name="flutterEmbedding"
4142
android:value="2" />
4243
</application>
44+
<!-- Required to query activities that can process text, see:
45+
https://developer.android.com/training/package-visibility and
46+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
47+
48+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
49+
<queries>
50+
<intent>
51+
<action android:name="android.intent.action.PROCESS_TEXT"/>
52+
<data android:mimeType="text/plain"/>
53+
</intent>
54+
</queries>
4355
</manifest>

simple_live_tv_app/android/app/src/main/kotlin/com/xycz/simple_live_tv/MainActivity.kt renamed to simple_live_tv_app/android/app/src/main/kotlin/com/example/simple_live_tv_app/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ package com.xycz.simple_live_tv
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity() {
6-
}
5+
class MainActivity: FlutterActivity()

simple_live_tv_app/android/build.gradle

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.3.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
174
mavenCentral()
185
}
196
}
207

21-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
229
subprojects {
2310
project.buildDir = "${rootProject.buildDir}/${project.name}"
2411
}
2512
subprojects {
26-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
2714
}
2815

2916
tasks.register("clean", Delete) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true

simple_live_tv_app/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

simple_live_tv_app/android/settings.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ pluginManagement {
55
def flutterSdkPath = properties.getProperty("flutter.sdk")
66
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
77
return flutterSdkPath
8-
}
9-
settings.ext.flutterSdkPath = flutterSdkPath()
8+
}()
109

11-
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
1211

13-
plugins {
14-
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
1516
}
1617
}
1718

18-
include ":app"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23+
}
1924

20-
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
25+
include ":app"

0 commit comments

Comments
 (0)