giandifra / arcore_flutter_plugin

Flutter plugin for ARCore SDK, Android platform to build new augmented reality experiences
MIT License
435 stars 280 forks source link

Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'. #209

Open xiaogeamadeus opened 1 year ago

xiaogeamadeus commented 1 year ago

Hi, currently I'm writing a project which hope use arcore with flutter. But when I try to run the example in my local, I got an error message like this: Could you please tell me why the error occured?

Error message

Launching lib/main.dart on Pixel 6a in debug mode... e: /Users/xiaogeamadeus/.pub-cache/hosted/pub.dev/arcore_flutter_plugin-0.0.11/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArcoreFlutterPlugin.kt: (32, 74): Type mismatch: inferred type is Activity? but Activity was expected

FAILURE: Build failed with an exception.

BUILD FAILED in 12s Running Gradle task 'assembleDebug'... 13.6s Exception: Gradle task assembleDebug failed with exit code 1

ZakaryaRoohi commented 1 year ago

use the 0.2.0-alpha version of this package. this error has been solved in this version

skumar98 commented 1 year ago

hey @xiaogeamadeus

  1. Check Plugin Version should be compatible version of the arcore_flutter_plugin package with your Flutter version
  2. Check Kotlin Version Make sure your project's build.gradle files have the appropriate Kotlin version specified.
  3. Update Dependencies flutter upgrade flutter pub upgrade
  4. Check Plugin Documentation of the arcore_flutter_plugin package to see if there are any specific setup instructions that you might have missed.
  5. Check Code at Line 32 Open the ArcoreFlutterPlugin.kt file located at the specified path on line 32. Look for any type-related issues, especially related to the Activity type.
  6. Try cleaning and rebuilding your project: flutter clean flutter pub get flutter run 7.Run flutter doctor to check if there are any issues with your Flutter installation or configuration.