Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix android build #106

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update namespace to use production domain

The namespace is using an example domain which should not be used in production:

-namespace = "com.example.canopas_unity"
+namespace = "com.canopas.projectunity"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
namespace = "com.example.canopas_unity"
namespace = "com.canopas.projectunity"

compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
Comment on lines 8 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix inconsistent SDK version configuration

The compileSdkVersion is both hardcoded and referenced from flutter:

-compileSdkVersion 34//flutter.compileSdkVersion
-compileSdk = flutter.compileSdkVersion
+compileSdkVersion flutter.compileSdkVersion

Committable suggestion skipped: line range outside the PR's diff.


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
cp-sneha-s marked this conversation as resolved.
Show resolved Hide resolved
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
cp-sneha-s marked this conversation as resolved.
Show resolved Hide resolved
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));
}
cp-sneha-s marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading