Skip to content

Commit

Permalink
Fix android build
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s committed Dec 3, 2024
1 parent 929667a commit 30f5633
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 55 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Android Build

on:
push:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
38 changes: 8 additions & 30 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,21 @@ 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
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
Expand All @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.canopas.projectunity">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
5 changes: 2 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.canopas.projectunity">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
<application
android:label="Unity"
android:name="${applicationName}"
android:roundIcon="@mipmap/round_launcher"
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions android/app/src/main/kotlin/com/canopas/unity/MainActivity.kt

This file was deleted.

3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.canopas.projectunity">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/sign_in/bloc/sign_in_view_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SignInBloc extends Bloc<SignInEvent, SignInState> {
} else {
emit(state.copyWith(googleSignInLoading: false));
}
} on Exception {
} catch(e) {
emit(state.copyWith(
googleSignInLoading: false, error: firesbaseAuthError));
}
Expand Down

0 comments on commit 30f5633

Please sign in to comment.