adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
95 stars 17 forks source link

Support Flutter 3.0.0 #49

Closed samatzp closed 2 years ago

samatzp commented 2 years ago

e: /Users/GG/.pub-cache/hosted/pub.dartlang.org/adapty_flutter-1.0.9/android/src/main/kotlin/com/adapty/flutter/registrant/AdaptyPluginRegistrant.kt: (19, 33): Type mismatch: inferred type is String? but String was expected e: /Users/GG/.pub-cache/hosted/pub.dartlang.org/adapty_flutter-1.0.9/android/src/main/kotlin/com/adapty/flutter/registrant/AdaptyPluginRegistrant.kt: (22, 31): Type mismatch: inferred type is String? but String was expected

FAILURE: Build failed with an exception.

BUILD FAILED in 32s Exception: Gradle task assembleDebug failed with exit code 1

Horum-dev commented 2 years ago

same thing!

DipDevStudio commented 2 years ago

Change file .pub-cache/hosted/pub.dartlang.org/adapty_flutter-1.0.9/android/src/main/kotlin/com/adapty/flutter/registrant/AdaptyPluginRegistrant.kt to

`package com.adapty.flutter.registrant

import com.adapty.flutter.AdaptyFlutterPlugin import io.flutter.plugin.common.PluginRegistry

object AdaptyPluginRegistrant {

fun registerWith(registry: PluginRegistry?) {
    if (alreadyRegisteredWith(registry)) {
        return
    }
    registry?.registrarFor("com.adapty.flutter.AdaptyFlutterPlugin")?.let { registrar ->
        AdaptyFlutterPlugin.registerWith(registrar)
    }
}

private fun alreadyRegisteredWith(registry: PluginRegistry?): Boolean {
    val key: String? = AdaptyPluginRegistrant::class.java.canonicalName
    if (key == null) return false;
    if (registry?.hasPlugin(key) ?: false) {
        return true
    }
    registry?.registrarFor(key)
    return false
}

}`

Padi142 commented 2 years ago

@DipDevStudio THANK you, you saved me a lot of headache

x401om commented 2 years ago

Hey everyone! We have added support for the Flutter 3.0 in the release 1.0.11.