WebEngage / webengage-flutter

WebEngage Flutter Plugin
Apache License 2.0
4 stars 21 forks source link

Issue with the android build(class resolution issue) #42

Closed bishalstha closed 10 months ago

bishalstha commented 10 months ago

I have integrated this package into an app and it was working properly until a few days. I have updated the package from 1.2.4 to 1.3.0, and now when I try to build the Android APK or run it on Android it throws the following errors. Also, the flutter documentation on your site is now outdated too, so please check on that.

e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/AppFirebaseMessagingService.kt:6:34 Unresolved reference: WebEngage
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/AppFirebaseMessagingService.kt:11:9 Unresolved reference: WebEngage
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/AppFirebaseMessagingService.kt:17:13 Unresolved reference: WebEngage
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:6:34 Unresolved reference: LocationTrackingStrategy
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:7:34 Unresolved reference: WebEngage
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:8:34 Unresolved reference: WebEngageConfig
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:16:31 Unresolved reference: WebEngageConfig
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:19:46 Unresolved reference: LocationTrackingStrategy
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:22:30 Cannot access class 'com.webengage.sdk.android.WebEngageConfig'. Check your module classpath for missing or conflicting dependencies
e: file:///path/android/app/src/main/kotlin/com/test/mobileapp/MainActivity.kt:29:21 Unresolved reference: WebEngage

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDevDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 14s
Running Gradle task 'assembleDevDebug'...                         134.8s
Exception: Gradle task assembleDevDebug failed with exit code 1

Following is my futter version info:

[✓] Flutter (Channel stable, 3.16.5, on macOS 13.6 22G120 darwin-x64, locale en-NP)
    • Flutter version 3.16.5 on channel stable at /Users/username/Desktop/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (3 weeks ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/username/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/username/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.13.0

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (2 available)
    • SM A325F (mobile) • 192.168.10.68:5555 • android-arm64 • Android 13 (API 33)
    • macOS (desktop)   • macos              • darwin-x64    • macOS 13.6 22G120 darwin-x64

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
MilindWebEngage commented 10 months ago

@bishalstha I apologize for the inconvenience. There is an issue with version 1.3.0 on the Android platform. Kindly use version 1.2.4 for now. We will be updating the plugin later today.

MilindWebEngage commented 10 months ago

@bishalstha We are pleased to announce the release of the latest version, 1.3.1. We recommend updating to this version. Additionally, please be aware that the issue mentioned earlier in version 1.3.0 for the Android part has been addressed in this release. Thank you for your understanding.