Skip to content

Commit 0469e5a

Browse files
committed
Recreate android files
Improved app/build.gradle { Bumped minSdkVersion to 21 (Lollipop) from 16 (Jellybean) Bumped targetSdkVersion (dynamic) Removed dependency on standard library Excluded unnecessary files from the apk } Set appCategory to game in AndroidManifest.xml Reset flutter_native_splash temporarily
1 parent 49d1468 commit 0469e5a

File tree

18 files changed

+70
-54
lines changed

18 files changed

+70
-54
lines changed

sudoku/android/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
99
# Remember to never publicly share your keystore.
1010
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1111
key.properties
12+
**/*.keystore
13+
**/*.jks

sudoku/android/app/build.gradle

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (keystorePropertiesFile.exists()) {
1717

1818
def flutterRoot = localProperties.getProperty('flutter.sdk')
1919
if (flutterRoot == null) {
20-
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
20+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
2121
}
2222

2323
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
@@ -35,21 +35,36 @@ apply plugin: 'kotlin-android'
3535
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
3636

3737
android {
38-
compileSdkVersion 30
38+
compileSdkVersion flutter.compileSdkVersion
39+
ndkVersion flutter.ndkVersion
3940

40-
sourceSets {
41-
main.java.srcDirs += 'src/main/kotlin'
41+
packagingOptions {
42+
exclude "**/kotlin/**"
43+
exclude "kotlin-tooling-metadata.json"
44+
exclude "DebugProbesKt.bin"
45+
exclude "/META-INF/androidx**"
46+
}
47+
48+
compileOptions {
49+
sourceCompatibility JavaVersion.VERSION_1_8
50+
targetCompatibility JavaVersion.VERSION_1_8
51+
}
52+
53+
kotlinOptions {
54+
jvmTarget = '1.8'
4255
}
4356

44-
lintOptions {
45-
disable 'InvalidPackage'
46-
checkReleaseBuilds false
57+
sourceSets {
58+
main.java.srcDirs += 'src/main/kotlin'
4759
}
4860

4961
defaultConfig {
62+
// Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
5063
applicationId "com.varuns2002.sudoku"
51-
minSdkVersion 16
52-
targetSdkVersion 30
64+
// You can update the following values to match your application needs.
65+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
66+
minSdkVersion 21
67+
targetSdkVersion flutter.targetSdkVersion
5368
versionCode flutterVersionCode.toInteger()
5469
versionName flutterVersionName
5570
}
@@ -68,6 +83,7 @@ android {
6883

6984
buildTypes {
7085
release {
86+
// Add your own signing config for the release build.
7187
// Signing with the debug keys for now, so `flutter run --release` works.
7288
signingConfig signingConfigs.debug
7389
// signingConfig signingConfigs.release // Key Config
@@ -78,7 +94,3 @@ android {
7894
flutter {
7995
source '../..'
8096
}
81-
82-
dependencies {
83-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
84-
}

sudoku/android/app/src/debug/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.varuns2002.sudoku">
3-
<!-- Flutter needs it to communicate with the running application
3+
<!-- The INTERNET permission is required for development. Specifically,
4+
the Flutter tool needs it to communicate with the running application
45
to allow setting breakpoints, to provide hot reload, etc.
56
-->
67
<uses-permission android:name="android.permission.INTERNET"/>

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33

44
<application
55
android:label="Sudoku"
6+
android:name="${applicationName}"
67
android:icon="@mipmap/ic_launcher"
78
android:roundIcon="@mipmap/ic_launcher_round"
89
android:installLocation="auto"
910
android:allowBackup="true"
11+
android:fullBackupOnly="true"
1012
android:isGame="true"
11-
android:allowAudioPlaybackCapture="true">
13+
android:appCategory="game"
14+
android:allowAudioPlaybackCapture="true"
15+
>
1216
<activity
1317
android:name=".MainActivity"
18+
android:exported="true"
1419
android:launchMode="singleTop"
1520
android:theme="@style/LaunchTheme"
1621
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -24,15 +29,6 @@
2429
android:name="io.flutter.embedding.android.NormalTheme"
2530
android:resource="@style/NormalTheme"
2631
/>
27-
<!-- Displays an Android View that continues showing the launch screen
28-
Drawable until Flutter paints its first frame, then this splash
29-
screen fades out. A splash screen is useful to avoid any visual
30-
gap between the end of Android's launch screen and the painting of
31-
Flutter's first frame. -->
32-
<meta-data
33-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
34-
android:resource="@drawable/launch_background"
35-
/>
3632
<intent-filter>
3733
<action android:name="android.intent.action.MAIN"/>
3834
<category android:name="android.intent.category.LAUNCHER"/>
-8.38 KB
Binary file not shown.
-3.8 KB
Binary file not shown.
-70 Bytes
Binary file not shown.
Lines changed: 10 additions & 7 deletions
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>
-9.6 KB
Binary file not shown.
-23.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)