Skip to content

Adds compatibility for flutter 3.29 and agp 8 #21

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

Open
wants to merge 3 commits into
base: master
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.PluginRegistry.Registrar;

public class AppLinkingPlugin implements FlutterPlugin, ActivityAware {
private MethodChannel methodChannel;
Expand All @@ -41,11 +40,7 @@ public class AppLinkingPlugin implements FlutterPlugin, ActivityAware {
private EventChannel.StreamHandler streamHandler;
private FlutterPluginBinding flutterPluginBinding;

public static void registerWith(Registrar registrar) {
AppLinkingPlugin appLinkingPlugin = new AppLinkingPlugin();
registrar.publish(appLinkingPlugin);
appLinkingPlugin.onAttachedToEngine(registrar.messenger(), registrar.activity());
}


private void onAttachedToEngine(final BinaryMessenger messenger, final Activity activity) {
if (AGConnectInstance.getInstance() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.flutter.plugin.common.EventChannel;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.PluginRegistry.Registrar;


public class AGConnectAuthPlugin implements FlutterPlugin, EventChannel.StreamHandler {
private MethodChannel channel;
Expand All @@ -31,10 +31,6 @@ public class AGConnectAuthPlugin implements FlutterPlugin, EventChannel.StreamHa
private MethodCallHandler methodCallHandler;
private AGConnectAuthModule agConnectAuthModule;

public static void registerWith(Registrar registrar) {
AGConnectAuthPlugin instance = new AGConnectAuthPlugin();
instance.initPlugin(registrar.messenger(), registrar.context().getApplicationContext());
}

@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
Expand Down
15 changes: 8 additions & 7 deletions agconnect_core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
classpath 'com.android.tools.build:gradle:8.1.2' }
}

rootProject.allprojects {
Expand All @@ -24,17 +23,19 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 30
compileSdkVersion 34
buildToolsVersion "30.0.3"

if (project.android.hasProperty('namespace')) {
namespace 'com.huawei.agconnectcore'
}
defaultConfig {
minSdkVersion 18
targetSdkVersion 30
minSdkVersion 21
targetSdkVersion 34
}
lintOptions {
disable 'InvalidPackage'
}
dependencies {
implementation 'com.huawei.agconnect:agconnect-core:1.9.0.300'
implementation 'com.huawei.agconnect:agconnect-core:1.9.1.300'
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Jun 05 14:28:30 PYT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
3 changes: 1 addition & 2 deletions agconnect_core/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.huawei.agconnectcore">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;

public class AGConnectCorePlugin implements FlutterPlugin, ActivityAware {
private MethodChannel channel;
Expand Down
15 changes: 8 additions & 7 deletions agconnect_crash/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
}
classpath 'com.android.tools.build:gradle:8.1.2' }
}

rootProject.allprojects {
Expand All @@ -24,12 +23,14 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdkVersion 34

if (project.android.hasProperty('namespace')) {
namespace 'com.huawei.agconnectcrash'
}
defaultConfig {
minSdkVersion 18
targetSdkVersion 30
minSdkVersion 21
targetSdkVersion 34
}
lintOptions {
disable 'InvalidPackage'
Expand All @@ -40,5 +41,5 @@ android {
}

dependencies {
implementation 'androidx.annotation:annotation:1.5.0'
implementation 'androidx.annotation:annotation:1.8.0'
}
1 change: 0 additions & 1 deletion agconnect_crash/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
3 changes: 1 addition & 2 deletions agconnect_crash/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.huawei.agconnectcrash">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;


public class AGConnectCrashPlugin implements FlutterPlugin, MethodCallHandler {
private MethodChannel channel;
Expand All @@ -45,11 +45,6 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBindin
channel.setMethodCallHandler(this);
}

public static void registerWith(Registrar registrar) {
initAGConnectSDK(registrar.context().getApplicationContext());
final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.huawei.flutter/agconnect_crash");
channel.setMethodCallHandler(new AGConnectCrashPlugin());
}

static void initAGConnectSDK(Context context) {
if (AGConnectInstance.getInstance() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;


public class AGConnectRemoteConfigPlugin implements FlutterPlugin, MethodCallHandler {
private MethodChannel channel;
Expand All @@ -49,12 +49,7 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBindin
channel.setMethodCallHandler(this);
}

public static void registerWith(Registrar registrar) {
initAGConnectSDK(registrar.context().getApplicationContext());
final MethodChannel channel = new MethodChannel(registrar.messenger(),
"com.huawei.flutter/agconnect_remote_config");
channel.setMethodCallHandler(new AGConnectRemoteConfigPlugin());
}


static void initAGConnectSDK(Context context) {
if (AGConnectInstance.getInstance() == null) {
Expand Down