From cb4ff94b4a27397da3136e73f78e29c031be3543 Mon Sep 17 00:00:00 2001 From: Daniel Dallos Date: Wed, 7 Aug 2024 15:43:14 +0200 Subject: [PATCH 1/5] bump Gradle version to 7.3.1 --- flutter_theolive_sdk/example/android/build.gradle | 2 +- flutter_theolive_sdk_android/android/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter_theolive_sdk/example/android/build.gradle b/flutter_theolive_sdk/example/android/build.gradle index 1cfff59..bdb5721 100644 --- a/flutter_theolive_sdk/example/android/build.gradle +++ b/flutter_theolive_sdk/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/flutter_theolive_sdk_android/android/build.gradle b/flutter_theolive_sdk_android/android/build.gradle index 6e5caeb..64c60f1 100644 --- a/flutter_theolive_sdk_android/android/build.gradle +++ b/flutter_theolive_sdk_android/android/build.gradle @@ -14,7 +14,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' + classpath 'com.android.tools.build:gradle:7.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } From 38cfeb04d387560f80a022ebd66db9c918c2e653 Mon Sep 17 00:00:00 2001 From: Daniel Dallos Date: Wed, 7 Aug 2024 15:51:11 +0200 Subject: [PATCH 2/5] specify namespace in build.gradle files --- flutter_theolive_sdk/example/android/app/build.gradle | 4 ++++ flutter_theolive_sdk_android/android/build.gradle | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/flutter_theolive_sdk/example/android/app/build.gradle b/flutter_theolive_sdk/example/android/app/build.gradle index b49ce29..d8308ec 100644 --- a/flutter_theolive_sdk/example/android/app/build.gradle +++ b/flutter_theolive_sdk/example/android/app/build.gradle @@ -26,6 +26,10 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + if (project.android.hasProperty("namespace")) { + namespace 'com.theolive.theolive_example' + } + compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/flutter_theolive_sdk_android/android/build.gradle b/flutter_theolive_sdk_android/android/build.gradle index 64c60f1..dfd758f 100644 --- a/flutter_theolive_sdk_android/android/build.gradle +++ b/flutter_theolive_sdk_android/android/build.gradle @@ -36,6 +36,10 @@ apply plugin: 'kotlin-android' def theoliveVersion ='3.13.1' android { + if (project.android.hasProperty("namespace")) { + namespace 'com.theolive.flutter' + } + compileSdkVersion 31 compileOptions { From 5abfd0a546996021b7eb2ef3fb2c09165e3ae9c4 Mon Sep 17 00:00:00 2001 From: Daniel Dallos Date: Wed, 7 Aug 2024 15:51:52 +0200 Subject: [PATCH 3/5] eliminate jitpack dependency --- flutter_theolive_sdk_android/android/build.gradle | 8 -------- 1 file changed, 8 deletions(-) diff --git a/flutter_theolive_sdk_android/android/build.gradle b/flutter_theolive_sdk_android/android/build.gradle index dfd758f..5216a31 100644 --- a/flutter_theolive_sdk_android/android/build.gradle +++ b/flutter_theolive_sdk_android/android/build.gradle @@ -6,11 +6,7 @@ buildscript { repositories { google() mavenCentral() - maven { url 'https://mvn.theoplayer.com/releases' } - // for THEOplayer Android Core dependencies: - maven { url 'https://jitpack.io' } - } dependencies { @@ -23,11 +19,7 @@ rootProject.allprojects { repositories { google() mavenCentral() - maven { url 'https://mvn.theoplayer.com/releases' } - // for THEOplayer Android Core dependencies: - maven { url 'https://jitpack.io' } - } } From 29fd8c0c50c5d1e34609de0d337147f0e15d5b66 Mon Sep 17 00:00:00 2001 From: Daniel Dallos Date: Wed, 7 Aug 2024 17:08:22 +0200 Subject: [PATCH 4/5] refactor and expose THEOlogger --- flutter_theolive_sdk/lib/theolive.dart | 3 +- .../lib/theolive_android.dart | 2 +- .../lib/theolive_ios.dart | 2 +- .../lib/helpers/debug_helpers.dart | 8 +++++ .../theologger.dart} | 36 ++++++++----------- .../lib/theolive_view_controller_mobile.dart | 2 +- 6 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 flutter_theolive_sdk_platform_interface/lib/helpers/debug_helpers.dart rename flutter_theolive_sdk_platform_interface/lib/{debug_helpers.dart => helpers/theologger.dart} (94%) diff --git a/flutter_theolive_sdk/lib/theolive.dart b/flutter_theolive_sdk/lib/theolive.dart index 474e21b..c491f4b 100644 --- a/flutter_theolive_sdk/lib/theolive.dart +++ b/flutter_theolive_sdk/lib/theolive.dart @@ -1,13 +1,14 @@ import 'package:flutter/widgets.dart'; import 'package:theolive/theolive_state.dart'; import 'package:theolive/theolive_view.dart'; -import 'package:theolive_platform_interface/debug_helpers.dart'; +import 'package:theolive_platform_interface/helpers/debug_helpers.dart'; import 'package:theolive_platform_interface/theolive_event_listener.dart'; import 'package:theolive_platform_interface/theolive_playerconfig.dart'; import 'package:theolive_platform_interface/theolive_view_controller_interface.dart'; export 'package:theolive_platform_interface/theolive_playerconfig.dart'; export 'package:theolive_platform_interface/theolive_event_listener.dart'; +export 'package:theolive_platform_interface/helpers/theologger.dart'; typedef PlayerCreatedCallback = void Function(); typedef StateChangeListener = void Function(); diff --git a/flutter_theolive_sdk_android/lib/theolive_android.dart b/flutter_theolive_sdk_android/lib/theolive_android.dart index 09ca04c..d25502e 100644 --- a/flutter_theolive_sdk_android/lib/theolive_android.dart +++ b/flutter_theolive_sdk_android/lib/theolive_android.dart @@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; import 'package:theolive_android/theolive_viewcontroller_android.dart'; import 'package:theolive_platform_interface/theolive_platform_interface.dart'; import 'package:theolive_platform_interface/theolive_playerconfig.dart'; -import 'package:theolive_platform_interface/debug_helpers.dart'; +import 'package:theolive_platform_interface/helpers/debug_helpers.dart'; class THEOliveAndroid extends TheolivePlatform { /// Registers this class as the default instance of [TheoplayerPlatform]. diff --git a/flutter_theolive_sdk_ios/lib/theolive_ios.dart b/flutter_theolive_sdk_ios/lib/theolive_ios.dart index 4daf667..8ac0b59 100644 --- a/flutter_theolive_sdk_ios/lib/theolive_ios.dart +++ b/flutter_theolive_sdk_ios/lib/theolive_ios.dart @@ -3,7 +3,7 @@ import 'package:flutter/widgets.dart'; import 'package:theolive_ios/theolive_viewcontroller_ios.dart'; import 'package:theolive_platform_interface/theolive_platform_interface.dart'; import 'package:theolive_platform_interface/theolive_playerconfig.dart'; -import 'package:theolive_platform_interface/debug_helpers.dart'; +import 'package:theolive_platform_interface/helpers/debug_helpers.dart'; class THEOliveIOS extends TheolivePlatform { /// Registers this class as the default instance of [TheoplayerPlatform]. diff --git a/flutter_theolive_sdk_platform_interface/lib/helpers/debug_helpers.dart b/flutter_theolive_sdk_platform_interface/lib/helpers/debug_helpers.dart new file mode 100644 index 0000000..35cbe72 --- /dev/null +++ b/flutter_theolive_sdk_platform_interface/lib/helpers/debug_helpers.dart @@ -0,0 +1,8 @@ +import 'package:flutter/foundation.dart'; + +void dprint(Object? object) { + if (kDebugMode) { + print(object); + } +} + diff --git a/flutter_theolive_sdk_platform_interface/lib/debug_helpers.dart b/flutter_theolive_sdk_platform_interface/lib/helpers/theologger.dart similarity index 94% rename from flutter_theolive_sdk_platform_interface/lib/debug_helpers.dart rename to flutter_theolive_sdk_platform_interface/lib/helpers/theologger.dart index 969f302..68a6c81 100644 --- a/flutter_theolive_sdk_platform_interface/lib/debug_helpers.dart +++ b/flutter_theolive_sdk_platform_interface/lib/helpers/theologger.dart @@ -1,26 +1,5 @@ import 'package:flutter/foundation.dart'; -void dprint(Object? object) { - if (kDebugMode) { - print(object); - } -} - -void exceptionHandler({required String tag, required Exception exception, String? context = null, StackTrace? stacktrace = null}) { - if (kDebugMode) { - throw exception; - } else { - final prefix = "[$tag]"; - final ctx = context != null ? "[C:$context]" : ""; - var logMessage = "THEOLogger$prefix$ctx - Exception happened: $exception"; - if (!THEOLogger.instance.isListening()) { - logMessage += " - for more info, attach a logger to THEOLogger.instance!"; - } - print(logMessage); - THEOLogger.instance._log(exception, stacktrace); - } -} - /** * Logger class to capture logs and exceptions * NOTE: @@ -54,4 +33,19 @@ class THEOLogger { abstract class THEOLoggerCallback { void onException(Exception e, StackTrace stackTrace); +} + +void exceptionHandler({required String tag, required Exception exception, String? context = null, StackTrace? stacktrace = null}) { + if (kDebugMode) { + throw exception; + } else { + final prefix = "[$tag]"; + final ctx = context != null ? "[C:$context]" : ""; + var logMessage = "THEOLogger$prefix$ctx - Exception happened: $exception"; + if (!THEOLogger.instance.isListening()) { + logMessage += " - for more info, attach a logger to THEOLogger.instance!"; + } + print(logMessage); + THEOLogger.instance._log(exception, stacktrace); + } } \ No newline at end of file diff --git a/flutter_theolive_sdk_platform_interface/lib/theolive_view_controller_mobile.dart b/flutter_theolive_sdk_platform_interface/lib/theolive_view_controller_mobile.dart index 7d1a418..0fc5d5a 100644 --- a/flutter_theolive_sdk_platform_interface/lib/theolive_view_controller_mobile.dart +++ b/flutter_theolive_sdk_platform_interface/lib/theolive_view_controller_mobile.dart @@ -1,4 +1,4 @@ -import 'package:theolive_platform_interface/debug_helpers.dart'; +import 'package:theolive_platform_interface/helpers/theologger.dart'; import 'package:theolive_platform_interface/pigeon/theolive_api.g.dart'; import 'package:theolive_platform_interface/pigeon_multi_instance_wrapper.dart'; import 'package:theolive_platform_interface/theolive_event_listener.dart'; From 07216220891c20805c5a75b7dc6cc7cdf0d996b5 Mon Sep 17 00:00:00 2001 From: Daniel Dallos Date: Wed, 7 Aug 2024 21:41:56 +0200 Subject: [PATCH 5/5] added changelog --- flutter_theolive_sdk/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flutter_theolive_sdk/CHANGELOG.md b/flutter_theolive_sdk/CHANGELOG.md index 0e9922f..9f20557 100644 --- a/flutter_theolive_sdk/CHANGELOG.md +++ b/flutter_theolive_sdk/CHANGELOG.md @@ -1,3 +1,8 @@ +## [Unreleased] + +* [Android] Updated Gradle version to 7.3.1 +* [Android] Fixed Gradle namespace issue + ## 1.0.1 * Updated documentation.