adaptyteam / AdaptySDK-Flutter

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

Android build fails with Type inference failed #18

Closed kleeb closed 3 years ago

kleeb commented 3 years ago

Android is unable to build on Flutter 2.2.0

Running Gradle task 'assembleDevRelease'...                     
e: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/adapty_flutter-1.0.0/android/src/main/kotlin/com/adapty/flutter/AdaptyFlutterPlugin.kt: (162, 89): Type inference failed: Not enough information to infer parameter R in inline fun <T, R> T.let(block: (T) -> R): R
Please specify it explicitly.
e: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/adapty_flutter-1.0.0/android/src/main/kotlin/com/adapty/flutter/AdaptyFlutterPlugin.kt: (162, 101): Unresolved reference: logShowPaywall
e: /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/adapty_flutter-1.0.0/android/src/main/kotlin/com/adapty/flutter/AdaptyFlutterPlugin.kt: (174, 113): Unresolved reference: from
FAILURE: Build failed with an exception.
kleeb commented 3 years ago

It builds properly on my branch https://github.com/kleeb/AdaptySDK-Flutter

fixed 2 issues (check commits):

  1. missing companion
  2. removed broken method
vladd-g commented 3 years ago

Hi @kleeb What's the version of Kotlin in your build.gradle file? If it's lower than 1.4, please upgrade it to 1.4.32 and the errors should be gone

kleeb commented 3 years ago

Thanks Vladd! It helped, I had 1.3.50