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 Nb_utils errors and migrate example app to Gradle 8 #60

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ example/.flutter-plugins
example/.flutter-plugins-dependencies
example/.metadata
example/nb_utils_example.iml
.vscode/settings.json
.fvm/flutter_sdk
.fvm/fvm_config.json
example/.fvm/fvm_config.json
example/.fvm/flutter_sdk
33 changes: 22 additions & 11 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'kotlin-parcelize' // New plugin for parcelable
}

def localProperties = new Properties()
Expand All @@ -14,24 +15,34 @@ if (localPropertiesFile.exists()) {

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

android {
compileSdk 34

ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
// sourceCompatibility = JavaVersion.VERSION_17
// targetCompatibility = JavaVersion.VERSION_17

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
// compileOptions {
// sourceCompatibility = JavaVersion.VERSION_17
// targetCompatibility = JavaVersion.VERSION_17
// }
// // kotlinOptions {
// // jvmTarget = "17"
// // jvmToolchain(17)
// // }
// kotlin {
// jvmToolchain {
// languageVersion = JavaLanguageVersion.of(17)
// }
// Or shorter:
// jvmToolchain(<MAJOR_JDK_VERSION>)
// For example:
// jvmToolchain(17)
// }

defaultConfig {
applicationId "com.nb.nb_utils"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.flutter.plugins;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;

import io.flutter.embedding.engine.FlutterEngine;

/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
}
}
24 changes: 20 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ rootProject.allprojects {

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
// apply plugin: 'kotlin-android'
// apply plugin: 'kotlin-android-extensions'



android {
compileSdk 34
Expand All @@ -35,8 +39,20 @@ android {
disable 'InvalidPackage'
}
namespace 'com.nb.nb_utils'
}

dependencies {
//
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// kotlinOptions {
// jvmTarget = "17"
// jvmToolchain(17)
// }
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
viewBinding {
enabled = true
}
}
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
#android.defaults.buildfeatures.buildconfig=true
Expand Down
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading