From 30f563367fe374c135a0d9d82096f20a7e78992d Mon Sep 17 00:00:00 2001 From: Sneha Canopas Date: Tue, 3 Dec 2024 16:04:32 +0530 Subject: [PATCH 1/4] Fix android build --- .github/workflows/android_build.yml | 2 - android/app/build.gradle | 38 ++++--------------- android/app/src/debug/AndroidManifest.xml | 3 +- android/app/src/main/AndroidManifest.xml | 5 +-- .../com/canopas/projectunity/MainActivity.kt | 6 --- .../kotlin/com/canopas/unity/MainActivity.kt | 6 --- android/app/src/profile/AndroidManifest.xml | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 4 +- lib/ui/sign_in/bloc/sign_in_view_bloc.dart | 2 +- 10 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 android/app/src/main/kotlin/com/canopas/projectunity/MainActivity.kt delete mode 100644 android/app/src/main/kotlin/com/canopas/unity/MainActivity.kt diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index a9d2c41bc..d6a4919e4 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -2,8 +2,6 @@ name: Android Build on: push: - branches: - - main workflow_dispatch: jobs: diff --git a/android/app/build.gradle b/android/app/build.gradle index c42208bfe..748b136eb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -2,35 +2,13 @@ plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" - id "com.google.gms.google-services" - id "com.google.firebase.crashlytics" } - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - - - - android { compileSdkVersion 34//flutter.compileSdkVersion + namespace = "com.example.canopas_unity" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -38,7 +16,7 @@ android { } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8 } sourceSets { @@ -48,10 +26,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.canopas.projectunity" - minSdkVersion 21 - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdkVersion 34 + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName android.applicationVariants.all { variant -> variant.outputs.all { outputFileName = "ProjectUnity-${variant.name}-${versionName}-${versionCode}.apk" diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 934fc2b33..f880684a6 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fe30fae21..1d396a7c4 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ - + - + diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3556a8496..74777a880 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Apr 26 12:42:38 IST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/settings.gradle b/android/settings.gradle index 5046f4aac..2047f3c8f 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.0.4" apply false - id "org.jetbrains.kotlin.android" version "1.8.21" apply false + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false id "com.google.gms.google-services" version "4.3.10" apply false id "com.google.firebase.crashlytics" version "2.9.9" apply false diff --git a/lib/ui/sign_in/bloc/sign_in_view_bloc.dart b/lib/ui/sign_in/bloc/sign_in_view_bloc.dart index f105dd0c8..5f691dc9d 100644 --- a/lib/ui/sign_in/bloc/sign_in_view_bloc.dart +++ b/lib/ui/sign_in/bloc/sign_in_view_bloc.dart @@ -39,7 +39,7 @@ class SignInBloc extends Bloc { } else { emit(state.copyWith(googleSignInLoading: false)); } - } on Exception { + } catch(e) { emit(state.copyWith( googleSignInLoading: false, error: firesbaseAuthError)); } From b27a58c1907075fbd6cddac55a238a9b9b54f02a Mon Sep 17 00:00:00 2001 From: Sneha Canopas Date: Tue, 3 Dec 2024 16:19:45 +0530 Subject: [PATCH 2/4] Fix android build --- .github/workflows/android_build.yml | 2 +- android/app/build.gradle | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index d6a4919e4..9fd791070 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -48,7 +48,7 @@ jobs: echo $APKSIGN_KEYSTORE_BASE64 | base64 -di > release.jks export APKSIGN_KEYSTORE=`pwd`/release.jks flutter build apk --release --build-number=$buildNumber --build-name=$buildName - mv build/app/outputs/apk/release/ProjectUnity*.apk . + mv build/app/outputs/apk/release/*.apk . env: APKSIGN_KEYSTORE_BASE64: ${{ secrets.APKSIGN_KEYSTORE_BASE64 }} APKSIGN_KEYSTORE_PASS: ${{ secrets.APKSIGN_KEYSTORE_PASS }} diff --git a/android/app/build.gradle b/android/app/build.gradle index 748b136eb..279d89788 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -79,6 +79,4 @@ flutter { source '../..' } -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0" -} + From 8b8497c58cec6588ecfcaa4922eebf0e01c8ca22 Mon Sep 17 00:00:00 2001 From: Sneha Canopas Date: Tue, 3 Dec 2024 16:24:55 +0530 Subject: [PATCH 3/4] Fix android build --- .../app/FlutterMultiDexApplication.java | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java diff --git a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java deleted file mode 100644 index 752fc185d..000000000 --- a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated file. -// -// If you wish to remove Flutter's multidex support, delete this entire file. -// -// Modifications to this file should be done in a copy under a different name -// as this file may be regenerated. - -package io.flutter.app; - -import android.app.Application; -import android.content.Context; -import androidx.annotation.CallSuper; -import androidx.multidex.MultiDex; - -/** - * Extension of {@link android.app.Application}, adding multidex support. - */ -public class FlutterMultiDexApplication extends Application { - @Override - @CallSuper - protected void attachBaseContext(Context base) { - super.attachBaseContext(base); - MultiDex.install(this); - } -} From 9f927b623bd05a49ee452634c0e182bb81d5226f Mon Sep 17 00:00:00 2001 From: Sneha Canopas Date: Tue, 3 Dec 2024 16:31:34 +0530 Subject: [PATCH 4/4] Fix android build --- .github/workflows/android_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index 9fd791070..65417088b 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -2,6 +2,8 @@ name: Android Build on: push: + branches: + - main workflow_dispatch: jobs: