Skip to content

Commit e983ba9

Browse files
committed
android: re-create template
迁移实在是麻烦, 不过有一个比较简单的方法: ```sh rm android flutter create . ``` 不过就需要重新生成图标和名称了 参考: https://stackoverflow.com/a/78078686
1 parent b0956e0 commit e983ba9

File tree

27 files changed

+126
-107
lines changed

27 files changed

+126
-107
lines changed

android/app/build.gradle

+27-30
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,58 @@
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"
6+
}
7+
18
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
9+
def localPropertiesFile = rootProject.file("local.properties")
310
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localPropertiesFile.withReader("UTF-8") { reader ->
512
localProperties.load(reader)
613
}
714
}
815

9-
10-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
1117
if (flutterVersionCode == null) {
12-
flutterVersionCode = '1'
18+
flutterVersionCode = "1"
1319
}
1420

15-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
1622
if (flutterVersionName == null) {
17-
flutterVersionName = '1.0'
18-
}
19-
20-
plugins {
21-
id "com.android.application"
22-
id "kotlin-android"
23-
id "dev.flutter.flutter-gradle-plugin"
23+
flutterVersionName = "1.0"
2424
}
2525

2626
android {
27-
compileSdkVersion 33
28-
29-
lintOptions {
30-
disable 'InvalidPackage'
31-
disable "Instantiatable"
32-
checkReleaseBuilds false
33-
abortOnError false
34-
}
27+
namespace = "io.github.d1y.movie.movie"
28+
compileSdk = flutter.compileSdkVersion
29+
ndkVersion = flutter.ndkVersion
3530

3631
compileOptions {
37-
sourceCompatibility JavaVersion.VERSION_1_8
38-
targetCompatibility JavaVersion.VERSION_1_8
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
3934
}
4035

4136
defaultConfig {
4237
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
43-
applicationId "io.github.d1y.movie.movie"
44-
minSdkVersion 21
45-
targetSdkVersion 30
46-
versionCode flutterVersionCode.toInteger()
47-
versionName flutterVersionName
38+
applicationId = "io.github.d1y.movie.movie"
39+
// You can update the following values to match your application needs.
40+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
41+
minSdk = flutter.minSdkVersion
42+
targetSdk = flutter.targetSdkVersion
43+
versionCode = flutterVersionCode.toInteger()
44+
versionName = flutterVersionName
4845
}
4946

5047
buildTypes {
5148
release {
5249
// TODO: Add your own signing config for the release build.
5350
// Signing with the debug keys for now, so `flutter run --release` works.
54-
signingConfig signingConfigs.debug
51+
signingConfig = signingConfigs.debug
5552
}
5653
}
5754
}
5855

5956
flutter {
60-
source '../..'
57+
source = "../.."
6158
}

android/app/src/debug/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.github.d1y.movie.movie">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
+30-29
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.github.d1y.movie.movie">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
3+
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.WAKE_LOCK" />
38

4-
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
5-
<uses-permission android:name="android.permission.INTERNET" />
6-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
8-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9-
<uses-permission android:name="android.permission.WAKE_LOCK" />
9+
<queries>
10+
<intent>
11+
<action android:name="android.intent.action.VIEW" />
12+
<category android:name="android.intent.category.BROWSABLE" />
13+
<data android:scheme="https" />
14+
</intent>
15+
</queries>
1016

11-
<queries>
12-
<intent>
13-
<action android:name="android.intent.action.VIEW" />
14-
<category android:name="android.intent.category.BROWSABLE" />
15-
<data android:scheme="https" />
16-
</intent>
17-
</queries>
18-
19-
<application
17+
<application
2018
android:label="yoyo"
21-
android:icon="@mipmap/launcher_icon"
22-
android:usesCleartextTraffic="true">
19+
android:name="${applicationName}"
20+
android:icon="@mipmap/launcher_icon">
2321
<activity
2422
android:name=".MainActivity"
23+
android:exported="true"
2524
android:launchMode="singleTop"
25+
android:taskAffinity=""
2626
android:theme="@style/LaunchTheme"
2727
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2828
android:hardwareAccelerated="true"
29-
android:screenOrientation="portrait"
3029
android:windowSoftInputMode="adjustResize">
3130
<!-- Specifies an Android theme to apply to this Activity as soon as
3231
the Android process has started. This theme is visible to the user
@@ -36,15 +35,6 @@
3635
android:name="io.flutter.embedding.android.NormalTheme"
3736
android:resource="@style/NormalTheme"
3837
/>
39-
<!-- Displays an Android View that continues showing the launch screen
40-
Drawable until Flutter paints its first frame, then this splash
41-
screen fades out. A splash screen is useful to avoid any visual
42-
gap between the end of Android's launch screen and the painting of
43-
Flutter's first frame. -->
44-
<meta-data
45-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
46-
android:resource="@drawable/launch_background"
47-
/>
4838
<intent-filter>
4939
<action android:name="android.intent.action.MAIN"/>
5040
<category android:name="android.intent.category.LAUNCHER"/>
@@ -56,4 +46,15 @@
5646
android:name="flutterEmbedding"
5747
android:value="2" />
5848
</application>
49+
<!-- Required to query activities that can process text, see:
50+
https://developer.android.com/training/package-visibility and
51+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
52+
53+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
54+
<queries>
55+
<intent>
56+
<action android:name="android.intent.action.PROCESS_TEXT"/>
57+
<data android:mimeType="text/plain"/>
58+
</intent>
59+
</queries>
5960
</manifest>

android/app/src/main/java/io/github/d1y/movie/movie/MainActivity.java

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package io.github.d1y.movie.movie
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()
-7.22 KB
Binary file not shown.
-2.94 KB
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
23
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item>
4-
<bitmap android:gravity="fill" android:src="@drawable/background"/>
5-
</item>
6-
<item>
7-
<bitmap android:gravity="center" android:src="@drawable/splash"/>
8-
</item>
9-
</layer-list>
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Binary file not shown.
Binary file not shown.
Binary file not shown.
-70 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
23
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item>
4-
<bitmap android:gravity="fill" android:src="@drawable/background"/>
5-
</item>
6-
<item>
7-
<bitmap android:gravity="center" android:src="@drawable/splash"/>
8-
</item>
9-
</layer-list>
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>

android/app/src/main/res/values-night/styles.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
44
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
55
<!-- Show a splash screen on the activity. Automatically removed when
6-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
</style>
99
<!-- Theme applied to the Android Window as soon as the process has started.
1010
This theme determines the color of the Android Window while your
1111
Flutter UI initializes, as well as behind your Flutter UI while its
1212
running.
13-
13+
1414
This Theme is only used starting with V2 of Flutter's Android embedding. -->
1515
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
1616
<item name="android:windowBackground">?android:colorBackground</item>

android/app/src/main/res/values/styles.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
44
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
55
<!-- Show a splash screen on the activity. Automatically removed when
6-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
8-
<item name="android:windowFullscreen">false</item>
98
</style>
109
<!-- Theme applied to the Android Window as soon as the process has started.
1110
This theme determines the color of the Android Window while your
1211
Flutter UI initializes, as well as behind your Flutter UI while its
1312
running.
14-
13+
1514
This Theme is only used starting with V2 of Flutter's Android embedding. -->
1615
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
1716
<item name="android:windowBackground">?android:colorBackground</item>
1817
</style>
19-
</resources>
18+
</resources>

android/app/src/profile/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="io.github.d1y.movie.movie">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

android/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ allprojects {
55
}
66
}
77

8-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
99
subprojects {
1010
project.buildDir = "${rootProject.buildDir}/${project.name}"
11-
project.evaluationDependsOn(':app')
11+
}
12+
subprojects {
13+
project.evaluationDependsOn(":app")
1214
}
1315

1416
tasks.register("clean", Delete) {

android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

android/settings.gradle

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ pluginManagement {
1616
}
1717
}
1818

19-
include ":app"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23+
}
24+
25+
include ":app"

ios/Runner/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
<key>UIApplicationSupportsIndirectInputEvents</key>
4949
<true/>
5050
</dict>
51-
</plist>
51+
</plist>

macos/Flutter/ephemeral/Flutter-Generated.xcconfig

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
FLUTTER_ROOT=/Users/d1y/fvm/versions/3.22.0
33
FLUTTER_APPLICATION_PATH=/Users/d1y/code/github/movie
44
COCOAPODS_PARALLEL_CODE_SIGN=true
5+
FLUTTER_TARGET=/Users/d1y/code/github/movie/lib/main.dart
56
FLUTTER_BUILD_DIR=build
67
FLUTTER_BUILD_NAME=2.1.0
78
FLUTTER_BUILD_NUMBER=2
9+
DART_DEFINES=RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9mNjM0NGI3NWRjZjg2MWQ4YmYxZjEzMjI3ODBiODgxMWY5ODJlMzFhLw==
810
DART_OBFUSCATION=false
911
TRACK_WIDGET_CREATION=true
1012
TREE_SHAKE_ICONS=false
11-
PACKAGE_CONFIG=.dart_tool/package_config.json
13+
PACKAGE_CONFIG=/Users/d1y/code/github/movie/.dart_tool/package_config.json

macos/Flutter/ephemeral/flutter_export_environment.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
export "FLUTTER_ROOT=/Users/d1y/fvm/versions/3.22.0"
44
export "FLUTTER_APPLICATION_PATH=/Users/d1y/code/github/movie"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6+
export "FLUTTER_TARGET=/Users/d1y/code/github/movie/lib/main.dart"
67
export "FLUTTER_BUILD_DIR=build"
78
export "FLUTTER_BUILD_NAME=2.1.0"
89
export "FLUTTER_BUILD_NUMBER=2"
10+
export "DART_DEFINES=RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9mNjM0NGI3NWRjZjg2MWQ4YmYxZjEzMjI3ODBiODgxMWY5ODJlMzFhLw=="
911
export "DART_OBFUSCATION=false"
1012
export "TRACK_WIDGET_CREATION=true"
1113
export "TREE_SHAKE_ICONS=false"
12-
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
14+
export "PACKAGE_CONFIG=/Users/d1y/code/github/movie/.dart_tool/package_config.json"

macos/Podfile.lock

-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ PODS:
2121
- video_player_avfoundation (0.0.1):
2222
- Flutter
2323
- FlutterMacOS
24-
- wakelock_macos (0.0.1):
25-
- FlutterMacOS
2624
- wakelock_plus (0.0.1):
2725
- FlutterMacOS
2826

@@ -37,7 +35,6 @@ DEPENDENCIES:
3735
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`)
3836
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
3937
- video_player_avfoundation (from `Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin`)
40-
- wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`)
4138
- wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)
4239

4340
EXTERNAL SOURCES:
@@ -61,8 +58,6 @@ EXTERNAL SOURCES:
6158
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
6259
video_player_avfoundation:
6360
:path: Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin
64-
wakelock_macos:
65-
:path: Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos
6661
wakelock_plus:
6762
:path: Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos
6863

@@ -77,7 +72,6 @@ SPEC CHECKSUMS:
7772
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
7873
url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399
7974
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
80-
wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9
8175
wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269
8276

8377
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

0 commit comments

Comments
 (0)