arcore_flutter_plugin
arcore_flutter_plugin copied to clipboard
Null Safety Problem
Hello! I'm trying to make a ARCore app first time. but my Flutter version is 2.2.2 I got a this issue
The library 'package:arcore_flutter_plugin/arcore_flutter_plugin.dart' is legacy, and should not be imported into a null safe library. Try migrating the imported library.
I don't know import null safe library. How ı can do for this problem?
My code is example code in the Ar_core_flutter package page. İf ı try to run this ım see this picture.

I didn't find this solution on github issues. THX.
Same issue +1
could you please try "flutter run --no-sound-null-safety" instead of "flutter run"?
@PeterTF656 Work for me thanks.
@PeterTF656 Im having the same issue, and tried to run it '--no-sound-null-safety' and i got this. can you help?
`e: C:\sr\flutter_windows_2.2.3-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@NonNull p0: Activity, @Nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks e: C:\sr\flutter_windows_2.2.3-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
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 5m 31s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 334.2s
Exception: Gradle task assembleDebug failed with exit code 1`
@PeterTF656 Im having the same issue, and tried to run it '--no-sound-null-safety' and i got this. can you help?
`e: C:\sr\flutter_windows_2.2.3-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@nonnull p0: Activity, @nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks e: C:\sr\flutter_windows_2.2.3-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
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 5m 31s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 334.2s Exception: Gradle task assembleDebug failed with exit code 1`
Hi, I haven't encountered that issue with arcore plugin. Could you try with flutter version <= 2.2.2?
hi, thanks for the quick response. I tried to downgrade it but it keeps telling me "There is no previously recorded version for channel "stable"." I'm thinking of maybe reinstall flutter?
Yes, you could try that. I'm using flutter 2.2.2, dart 2.13.3 on my Windows 10 machine and everything works fine with this package.
hi, thanks for the quick response. I tried to downgrade it but it keeps telling me "There is no previously recorded version for channel "stable"." I'm thinking of maybe reinstall flutter?
@Chos92 Yes, you could try that. I'm using flutter 2.2.2, dart 2.13.3 on my Windows 10 machine and everything works fine with this package.
@PeterTF656 I downgraded flutter to v2.2.2,and i get the same error `e: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@NonNull p0: Activity, @Nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks e: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
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 3m 46s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 229.4s
Exception: Gradle task assembleDebug failed with exit code 1`
I'm new to coding,and everything work for the past month. i didnt need to run --no-sound-null-safety and the code worked, and then it just started to get this errors. first the arcore legacy error and then the flutter gradle error and now this.
i don't know what to do ? sould i uninstall everything and instal i again?
tnx
@PeterTF656 I downgraded flutter to v2.2.2,and i get the same error `e: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@nonnull p0: Activity, @nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks e: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
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 3m 46s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 229.4s Exception: Gradle task assembleDebug failed with exit code 1`
I'm new to coding,and everything work for the past month. i didnt need to run --no-sound-null-safety and the code worked, and then it just started to get this errors. first the arcore legacy error and then the flutter gradle error and now this.
i don't know what to do ? sould i uninstall everything and instal i again?
tnx
Dear Chos92,
The reason that I suggested running --no-sound-null-safety is this plugin (ARCORE plugin) does not support null safety. If you only use null-safety plugins, then you are fine with flutter run. In your case, I would recommend running flutter clean to clean old builds, and then flutter pub get and flutter pub upgrade to update all plugins. Unfortunately, I am not a Java/Kotlin expert, so my help could be limited...
Hi, can you try null-safety version? #150 thanks
@giandifra yeah i did, but it keeps crashing because of this error. `: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@nonnull p0: Activity, @nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks e: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'. 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 3m 46s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 229.4s Exception: Gradle task assembleDebug failed with exit code 1`
i tried reinstaling the flutter plugging, downgrade it, upgrade it. notinhg worked so far.
I will fix it tomorrow
@giandifra yeah i did, but it keeps crashing because of this error. `: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@nonnull p0: Activity, @nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks e: C:\src\flutter_windows_2.2.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'. 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 3m 46s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 229.4s Exception: Gradle task assembleDebug failed with exit code 1`
i tried reinstaling the flutter plugging, downgrade it, upgrade it. notinhg worked so far.
I have not this error, I read that you use version 0.0.11 of plugin, the correct version is 0.1.0-null-safety.1 for null safety. Can you try?
You can disable null safety by setting the Dart SDK Version below 2.12
environment: sdk: ">=2.11.0 <3.0.0"
You have to remove any null safety references though.
: C:\Users\snanda\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.1+1\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\models\RotatingNode.kt: (131, 9): Val cannot be reassigned
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
Compilation error. See log for more details
C:\Users\snanda\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.1+1\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\models\RotatingNode.kt: (130, 9): Val cannot be reassigned
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
Compilation error. See log for more details
This Error I am getting any solution....
ead that you use version 0.0.11 of plugin, the correct version is 0.1.0-null-safety.1 for null safety.
C:\Users\snanda\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.1+1\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\models\RotatingNode.kt: (130, 9): Val cannot be reassigned
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
Compilation error. See log for more details What is solution of this...