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

[Mobile App] 989: Update Flutter SDK and packages, Xcode, Android Gradle #991

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion recipients_app/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
flutter 3.22.3
flutter 3.27.1
ruby 3.2.2
38 changes: 20 additions & 18 deletions recipients_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Mobile App for Recipients of a Social Income.
- Java JDK 17
- Android Studio LadyBug or later
- Latest vsCode
- Xcode 16.1
- Xcode 16.x

## Configure the Apple Silicon Mac environment to build our app

Expand All @@ -26,23 +26,25 @@ Mobile App for Recipients of a Social Income.
export PATH="$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools"
```
- Restart your terminal so that these changes take effect
- Install Java 17 via Homebrew `brew install openjdk@17`
- Homebrew is telling you to execute a symlink command, so that the
system Java wrappers can find this JDK. Please do this.
- Additionally in your USER's HOME directory in the file '.zshrc', add
the lines to set the JAVA_HOME environment variable to Java 17 and
add Java to the PATH environment variable
```shell
export JAVA_HOME=$(/usr/libexec/java_home -v17)
export PATH="$PATH:$JAVA_HOME/bin"
```
- Restart your terminal so that these changes take effect
- Install Flutter
- Tell Flutter to use our Java 17 JDK and not the one bundle with
Android Studio via `flutter config --jdk-dir "$JAVA_HOME"`.
Otherwise, you will get the error "Unsupported class file major
version 65” when building the app for Android.
- Restart your terminal and IDE so that these changes take effect
- Optional: Pin Flutter's JDK version and do not use the JDK from
Android Studio by default
- Install Java 21 via Homebrew `brew install openjdk@21`
- Homebrew is telling you to execute a symlink command, so that the
system Java wrappers can find this JDK. Please do this.
- Additionally in your USER's HOME directory in the file '.zshrc',
add the lines to set the JAVA_HOME environment variable to Java 21
and add Java to the PATH environment variable
```shell
export JAVA_HOME=$(/usr/libexec/java_home -v21)
export PATH="$PATH:$JAVA_HOME/bin"
```
- Restart your terminal so that these changes take effect
- Install Flutter
- Tell Flutter to use our Java 21 JDK and not the one bundle with
Android Studio via `flutter config --jdk-dir "$JAVA_HOME"`.
Otherwise, you will get the error "Unsupported class file major
version XX" when building the app for Android.
- Restart your terminal and IDE so that these changes take effect
- Install vsCode
- Install Flutter extension
- Install Xcode
Expand Down
4 changes: 3 additions & 1 deletion recipients_app/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
18 changes: 13 additions & 5 deletions recipients_app/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
// The Google services Gradle plugin
id "com.google.gms.google-services"
}

Expand Down Expand Up @@ -30,15 +32,25 @@ if (keystorePropertiesFile.exists()) {
}

android {
namespace 'org.socialincome.app'
compileSdkVersion 34

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
applicationId "org.socialincome.app"
minSdkVersion 21
minSdkVersion 23
Copy link
Contributor Author

Choose a reason for hiding this comment

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

minSdkVersion is because of Flutter Firebase packages update

targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down Expand Up @@ -84,7 +96,3 @@ flutter {
source '../..'
}

dependencies {
}


6 changes: 3 additions & 3 deletions recipients_app/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.socialincome.app">
<!-- Flutter needs it to communicate with the running application
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
3 changes: 1 addition & 2 deletions recipients_app/android/app/src/dev/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.socialincome.app">
xmlns:tools="http://schemas.android.com/tools">
<!-- Flutter needs it for communicate with firebase emulators -->
<application
android:label="Dev Social Income"
Expand Down
3 changes: 1 addition & 2 deletions recipients_app/android/app/src/main/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="org.socialincome.app">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions recipients_app/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.socialincome.app">
<!-- Flutter needs it to communicate with the running application
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
3 changes: 1 addition & 2 deletions recipients_app/android/app/src/stage/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.socialincome.app">
xmlns:tools="http://schemas.android.com/tools">
<application
android:label="Stage Social Income"
tools:replace="android:label"/>
Expand Down
4 changes: 2 additions & 2 deletions recipients_app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ allprojects {
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}

subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
5 changes: 4 additions & 1 deletion recipients_app/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 3 additions & 2 deletions recipients_app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.android.application" version '8.7.3' apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
// The dependency for the Google services Gradle plugin
// TODO(Verena): update to 4.4.0 once https://github.com/firebase/flutterfire/discussions/8691 is fixed
id "com.google.gms.google-services" version "4.3.15" apply false
}
Expand Down
4 changes: 2 additions & 2 deletions recipients_app/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
platform :ios, '13.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of Flutter Firebase packages update


# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -30,7 +30,7 @@ flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.25.0'
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.4.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of Flutter Firebase packages update


flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
Expand Down
Loading
Loading