arcore_flutter_plugin icon indicating copy to clipboard operation
arcore_flutter_plugin copied to clipboard

Null Safety Problem

Open ruskyvisky opened this issue 4 years ago • 17 comments

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. image

I didn't find this solution on github issues. THX.

ruskyvisky avatar Jul 05 '21 07:07 ruskyvisky

Same issue +1

NTJ3 avatar Jul 06 '21 07:07 NTJ3

could you please try "flutter run --no-sound-null-safety" instead of "flutter run"?

PeterTF656 avatar Jul 10 '21 18:07 PeterTF656

@PeterTF656 Work for me thanks.

NTJ3 avatar Jul 15 '21 12:07 NTJ3

@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`

Chos92 avatar Aug 07 '21 21:08 Chos92

@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?

PeterTF656 avatar Aug 08 '21 09:08 PeterTF656

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 avatar Aug 08 '21 21:08 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.

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 avatar Aug 09 '21 06:08 PeterTF656

@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

Chos92 avatar Aug 09 '21 13:08 Chos92

@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...

PeterTF656 avatar Aug 10 '21 02:08 PeterTF656

Hi, can you try null-safety version? #150 thanks

giandifra avatar Aug 19 '21 16:08 giandifra

@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.

Chos92 avatar Aug 24 '21 14:08 Chos92

I will fix it tomorrow

giandifra avatar Aug 26 '21 11:08 giandifra

@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?

giandifra avatar Aug 29 '21 16:08 giandifra

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.

digitalrbnz avatar Dec 21 '21 19:12 digitalrbnz

: 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

saurabhandroid-code avatar May 25 '22 06:05 saurabhandroid-code

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....

saurabhandroid-code avatar May 25 '22 06:05 saurabhandroid-code

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...

saurabhandroid-code avatar May 25 '22 06:05 saurabhandroid-code