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

build(android_intent_plus): Update to target and compile SDK 34 on Android #2711

Merged
merged 5 commits into from
Mar 17, 2024
Merged
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
6 changes: 3 additions & 3 deletions packages/android_intent_plus/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 33
compileSdk 34

namespace 'dev.fluttercommunity.plus.androidintent'

defaultConfig {
minSdkVersion 19
minSdk 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -46,7 +46,7 @@ android {
}

dependencies {
implementation 'androidx.annotation:annotation:1.7.0'
implementation 'androidx.annotation:annotation:1.7.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.11.0'
testImplementation 'androidx.test:core:1.5.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest package="dev.fluttercommunity.plus.androidintent">
</manifest>
<manifest package="dev.fluttercommunity.plus.androidintent"/>
16 changes: 12 additions & 4 deletions packages/android_intent_plus/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdk 34

namespace 'io.flutter.plugins.androidintentexample'

Expand All @@ -40,8 +40,8 @@ android {

defaultConfig {
applicationId "io.flutter.plugins.androidintentexample"
minSdkVersion 19
targetSdkVersion 33
minSdk 19
targetSdk 34
multiDexEnabled true

versionCode flutterVersionCode.toInteger()
Expand All @@ -63,8 +63,16 @@ flutter {
}

dependencies {
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package io.flutter.plugins.androidintentexample;

import android.annotation.SuppressLint;
import android.content.IntentFilter;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {

@SuppressLint("WrongConstant")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

IntentFilter filter = new IntentFilter("com.example.broadcast");
MyBroadcastReceiver receiver = new MyBroadcastReceiver();
registerReceiver(receiver, filter);
ContextCompat.registerReceiver(this, receiver, filter, ContextCompat.RECEIVER_EXPORTED);
}
}