line / flutter_line_sdk

A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.
https://developers.line.biz/
Apache License 2.0
216 stars 44 forks source link

Unresolved reference: BuildConfig #107

Closed a1573595 closed 1 month ago

a1573595 commented 1 month ago

What did you do?

Just import in my Flutter pubspec.yaml and update Android minSdk to 24.

What did you expect?

Compile Success.

What happened actually?

Launching lib/main.dart on Android SDK built for arm64 in debug mode...
Running Gradle task 'assembleDebug'...
e: file:///Users/chien/.pub-cache/hosted/pub.dev/flutter_line_sdk-2.3.8/android/src/main/kotlin/com/linecorp/flutter_line_sdk/util/CommonKotlinExension.kt:3:38 Unresolved reference: BuildConfig
e: file:///Users/chien/.pub-cache/hosted/pub.dev/flutter_line_sdk-2.3.8/android/src/main/kotlin/com/linecorp/flutter_line_sdk/util/CommonKotlinExension.kt:6:9 Unresolved reference: BuildConfig

Your environment?

flutter_line_sdk: ^2.3.8 Android Gradle: gradle-8.4-all

[✓] Flutter (Channel stable, 3.24.3, on macOS 14.7 23H124 darwin-arm64, locale zh-Hant-TW) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [✓] Android Studio (version 2024.1) [✓] Network resources

• No issues found!

Sample project

Use Flutter 3.24.3 to create a new Flutter project(Gradle 8) and import flutter_line_sdk, even the default counter cannot be compiled, in gradle-7.6.3-all work well.

onevcat commented 1 month ago

@YkSix Could you take a look at this when you have a chance? Thanks!

YkSix commented 1 month ago

@a1573595 , Thanks for reporting it. Please try the following approach and see if it works for you. Thanks.

For example:

a1573595 commented 1 month ago

@a1573595 , Thanks for reporting it. Please try the following approach and see if it works for you. Thanks.

  • File: ${app_project}/android/gradle.properties
  • Please add android.defaults.buildfeatures.buildconfig=true if it's missing

For example:

It can be compiled, thank you.