Skip to content

Commit 2457137

Browse files
committed
Fixing android build fails
1 parent aed5e34 commit 2457137

File tree

8 files changed

+76
-66
lines changed

8 files changed

+76
-66
lines changed

Diff for: android/.gitignore

+2
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

Diff for: android/app/build.gradle

+11-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
3434
android {
3535
compileSdkVersion 30
3636

37+
compileOptions {
38+
sourceCompatibility JavaVersion.VERSION_1_8
39+
targetCompatibility JavaVersion.VERSION_1_8
40+
}
41+
42+
kotlinOptions {
43+
jvmTarget = '1.8'
44+
}
45+
3746
sourceSets {
3847
main.java.srcDirs += 'src/main/kotlin'
3948
}
@@ -42,7 +51,7 @@ android {
4251
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4352
applicationId "com.cubanopensource.todo"
4453
minSdkVersion 16
45-
targetSdkVersion 31
54+
targetSdkVersion 30
4655
versionCode flutterVersionCode.toInteger()
4756
versionName flutterVersionName
4857
}
@@ -91,6 +100,7 @@ android {
91100
release {
92101
signingConfig signingConfigs.release
93102
minifyEnabled true
103+
useProguard true
94104
proguardFiles getDefaultProguardFile('proguard-android.txt')
95105
}
96106
debug {

Diff for: android/app/src/main/AndroidManifest.xml

+59-59
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.cubanopensource.todo">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.cubanopensource.todo">
33

4-
<uses-permission android:name="android.permission.INTERNET"/>
5-
<uses-permission android:name="android.permission.CALL_PHONE" />
6-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
7-
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
8-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
9-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
11-
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
12-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
4+
<uses-permission android:name="android.permission.INTERNET"/>
5+
<uses-permission android:name="android.permission.CALL_PHONE" />
6+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
7+
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
8+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
9+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
11+
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
12+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
1313

14-
<application
15-
android:label="TODO"
16-
android:icon="@mipmap/launcher_icon"
17-
android:usesCleartextTraffic="true">
14+
<application
15+
android:label="TODO"
16+
android:icon="@mipmap/launcher_icon"
17+
android:usesCleartextTraffic="true">
1818

19-
<receiver android:name=".TodoAppWidget" android:exported="true">
20-
<intent-filter>
21-
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
22-
</intent-filter>
19+
<receiver android:name=".TodoAppWidget" android:exported="true">
20+
<intent-filter>
21+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
22+
</intent-filter>
2323

24-
<meta-data
25-
android:name="android.appwidget.provider"
26-
android:resource="@xml/todo_app_widget_info" />
27-
</receiver>
24+
<meta-data
25+
android:name="android.appwidget.provider"
26+
android:resource="@xml/todo_app_widget_info" />
27+
</receiver>
2828

29-
<service android:name=".FloatingWindow" />
29+
<service android:name=".FloatingWindow" />
3030

31-
<activity
32-
android:name=".MainActivity"
33-
android:launchMode="singleTop"
34-
android:theme="@style/LaunchTheme"
35-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
36-
android:hardwareAccelerated="true"
37-
android:windowSoftInputMode="adjustResize"
38-
android:exported="true">
39-
<!-- Specifies an Android theme to apply to this Activity as soon as
40-
the Android process has started. This theme is visible to the user
41-
while the Flutter UI initializes. After that, this theme continues
42-
to determine the Window background behind the Flutter UI. -->
43-
<meta-data
44-
android:name="io.flutter.embedding.android.NormalTheme"
45-
android:resource="@style/NormalTheme"
46-
/>
47-
<!-- Displays an Android View that continues showing the launch screen
48-
Drawable until Flutter paints its first frame, then this splash
49-
screen fades out. A splash screen is useful to avoid any visual
50-
gap between the end of Android's launch screen and the painting of
51-
Flutter's first frame. -->
52-
<meta-data
53-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
54-
android:resource="@drawable/launch_background"
55-
/>
56-
<intent-filter>
57-
<action android:name="android.intent.action.MAIN"/>
58-
<category android:name="android.intent.category.LAUNCHER"/>
59-
</intent-filter>
60-
</activity>
61-
<!-- Don't delete the meta-data below.
62-
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
31+
<activity
32+
android:name=".MainActivity"
33+
android:launchMode="singleTop"
34+
android:theme="@style/LaunchTheme"
35+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
36+
android:hardwareAccelerated="true"
37+
android:windowSoftInputMode="adjustResize"
38+
android:exported="true">
39+
<!-- Specifies an Android theme to apply to this Activity as soon as
40+
the Android process has started. This theme is visible to the user
41+
while the Flutter UI initializes. After that, this theme continues
42+
to determine the Window background behind the Flutter UI. -->
6343
<meta-data
64-
android:name="flutterEmbedding"
65-
android:value="2" />
66-
</application>
44+
android:name="io.flutter.embedding.android.NormalTheme"
45+
android:resource="@style/NormalTheme"
46+
/>
47+
<!-- Displays an Android View that continues showing the launch screen
48+
Drawable until Flutter paints its first frame, then this splash
49+
screen fades out. A splash screen is useful to avoid any visual
50+
gap between the end of Android's launch screen and the painting of
51+
Flutter's first frame. -->
52+
<meta-data
53+
android:name="io.flutter.embedding.android.SplashScreenDrawable"
54+
android:resource="@drawable/launch_background"
55+
/>
56+
<intent-filter>
57+
<action android:name="android.intent.action.MAIN"/>
58+
<category android:name="android.intent.category.LAUNCHER"/>
59+
</intent-filter>
60+
</activity>
61+
<!-- Don't delete the meta-data below.
62+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
63+
<meta-data
64+
android:name="flutterEmbedding"
65+
android:value="2" />
66+
</application>
6767
</manifest>

Diff for: android/app/src/profile/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.cubanopensource">
2+
package="com.cubanopensource.todo">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->

Diff for: android/build.gradle

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.5.30'
2+
ext.kotlin_version = '1.3.50'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.2'
9+
classpath 'com.android.tools.build:gradle:4.1.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
@@ -21,8 +21,6 @@ allprojects {
2121
rootProject.buildDir = '../build'
2222
subprojects {
2323
project.buildDir = "${rootProject.buildDir}/${project.name}"
24-
}
25-
subprojects {
2624
project.evaluationDependsOn(':app')
2725
}
2826

Diff for: android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

0 commit comments

Comments
 (0)