CariusLars / ar_flutter_plugin

Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices
MIT License
330 stars 238 forks source link

Issue when building #44

Closed MalekHAMID closed 2 years ago

MalekHAMID commented 2 years ago

Google 3A PIXEL XL EMULATOR,

RUNNIG ANY OF THE EXAMPLE CODES PRODUCE THIS ERROR

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:58: error: cannot find symbol
            status = Environment.isExternalStorageManager()
                                ^
  symbol:   method isExternalStorageManager()
  location: class Environment
....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:144: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
                                                               ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:250: error: cannot find symbol
                    if (permission == PermissionConstants.PERMISSION_GROUP_MANAGE_EXTERNAL_STORAGE && Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
                                                                                          ^
  symbol:   variable R
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:264: error: cannot find symbol
            } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && permission == PermissionConstants.PERMISSION_GROUP_MANAGE_EXTERNAL_STORAGE) {
                                                                   ^
  symbol:   variable R
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:266: error: cannot find symbol
                        Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION,
                                ^
  symbol:   variable ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
  location: class Settings
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:336: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
                                                               ^
  symbol:   variable R
  location: class VERSION_CODES
C:\Users\Comma\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:367: error: cannot find symbol
                    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
                                                                   ^
  symbol:   variable R
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:371: error: cannot find symbol
                    return Environment.isExternalStorageManager()
                                      ^
  symbol:   method isExternalStorageManager()
  location: class Environment
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:33: error: cannot find symbol
            case Manifest.permission.ACCESS_BACKGROUND_LOCATION:
                                    ^
  symbol:   variable ACCESS_BACKGROUND_LOCATION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:47: error: cannot find symbol
            case Manifest.permission.BIND_CALL_REDIRECTION_SERVICE:
                                    ^
  symbol:   variable BIND_CALL_REDIRECTION_SERVICE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:60: error: cannot find symbol
            case Manifest.permission.ACCESS_MEDIA_LOCATION:
                                    ^
  symbol:   variable ACCESS_MEDIA_LOCATION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:62: error: cannot find symbol
            case Manifest.permission.ACTIVITY_RECOGNITION:
                                    ^
  symbol:   variable ACTIVITY_RECOGNITION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:64: error: cannot find symbol
            case Manifest.permission.MANAGE_EXTERNAL_STORAGE:
                                    ^
  symbol:   variable MANAGE_EXTERNAL_STORAGE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:72: error: cannot find symbol
            case Manifest.permission.BLUETOOTH_SCAN:
                                    ^
  symbol:   variable BLUETOOTH_SCAN
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:74: error: cannot find symbol
            case Manifest.permission.BLUETOOTH_ADVERTISE:
                                    ^
  symbol:   variable BLUETOOTH_ADVERTISE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:76: error: cannot find symbol
            case Manifest.permission.BLUETOOTH_CONNECT:
                                    ^
  symbol:   variable BLUETOOTH_CONNECT
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:115: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                                                                ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:116: error: cannot find symbol
                    if (hasPermissionInManifest(context, permissionNames, Manifest.permission.ACCESS_BACKGROUND_LOCATION))
                                                                                          ^
  symbol:   variable ACCESS_BACKGROUND_LOCATION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:117: error: cannot find symbol
                        permissionNames.add(Manifest.permission.ACCESS_BACKGROUND_LOCATION);
                                                               ^
  symbol:   variable ACCESS_BACKGROUND_LOCATION
  location: class permission
C:\Users\Comma\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:139: error: cannot find symbol
                if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.Q && hasPermissionInManifest(context, permissionNames, Manifest.permission.READ_PHONE_NUMBERS)) {
                                                                          ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:158: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && hasPermissionInManifest(context, permissionNames, Manifest.permission.BIND_CALL_REDIRECTION_SERVICE))
                                                                ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:158: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && hasPermissionInManifest(context, permissionNames, Manifest.permission.BIND_CALL_REDIRECTION_SERVICE))
                                                                                          ^
  symbol:   variable BIND_CALL_REDIRECTION_SERVICE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:159: error: cannot find symbol
                    permissionNames.add(Manifest.permission.BIND_CALL_REDIRECTION_SERVICE);
                                                           ^
  symbol:   variable BIND_CALL_REDIRECTION_SERVICE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:195: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q && Environment.isExternalStorageLegacy())) {
                                                               ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:195: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q && Environment.isExternalStorageLegacy())) {
                                                                                          ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:195: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q || (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q && Environment.isExternalStorageLegacy())) {
                                                                                          ^
  symbol:   method isExternalStorageLegacy()
  location: class Environment
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:210: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
                                                               ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:213: error: cannot find symbol
                if(hasPermissionInManifest(context, permissionNames, Manifest.permission.ACCESS_MEDIA_LOCATION))
                                                                                        ^
  symbol:   variable ACCESS_MEDIA_LOCATION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:214: error: cannot find symbol
                    permissionNames.add(Manifest.permission.ACCESS_MEDIA_LOCATION);
                                                           ^
  symbol:   variable ACCESS_MEDIA_LOCATION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:220: error: cannot find symbol
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
                                                               ^
  symbol:   variable Q
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:223: error: cannot find symbol
                if (hasPermissionInManifest(context, permissionNames, Manifest.permission.ACTIVITY_RECOGNITION))
                                                                                         ^
  symbol:   variable ACTIVITY_RECOGNITION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:224: error: cannot find symbol
                    permissionNames.add(Manifest.permission.ACTIVITY_RECOGNITION);
                                                           ^
  symbol:   variable ACTIVITY_RECOGNITION
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:235: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && hasPermissionInManifest(context, permissionNames, Manifest.permission.MANAGE_EXTERNAL_STORAGE ))
                                                                ^
  symbol:   variable R
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:235: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && hasPermissionInManifest(context, permissionNames, Manifest.permission.MANAGE_EXTERNAL_STORAGE ))
                                                                                          ^
  symbol:   variable MANAGE_EXTERNAL_STORAGE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:236: error: cannot find symbol
                    permissionNames.add(Manifest.permission.MANAGE_EXTERNAL_STORAGE);
                                                           ^
  symbol:   variable MANAGE_EXTERNAL_STORAGE
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:259: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, permissionNames, Manifest.permission.BLUETOOTH_SCAN ))
                                                                ^
  symbol:   variable S
  location: class VERSION_CODES
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:259: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, permissionNames, Manifest.permission.BLUETOOTH_SCAN ))
                                                                                          ^
  symbol:   variable BLUETOOTH_SCAN
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:260: error: cannot find symbol
                    permissionNames.add(Manifest.permission.BLUETOOTH_SCAN);
                                                           ^
  symbol:   variable BLUETOOTH_SCAN
  location: class permission
.....\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:265: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, permissionNames, Manifest.permission.BLUETOOTH_ADVERTISE ))
                                                                ^
  symbol:   variable S
  location: class VERSION_CODES
...\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:265: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, permissionNames, Manifest.permission.BLUETOOTH_ADVERTISE ))
                                                                                          ^
  symbol:   variable BLUETOOTH_ADVERTISE
  location: class permission
...\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:266: error: cannot find symbol
                    permissionNames.add(Manifest.permission.BLUETOOTH_ADVERTISE);
                                                           ^
  symbol:   variable BLUETOOTH_ADVERTISE
  location: class permission
...\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:271: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, permissionNames, Manifest.permission.BLUETOOTH_CONNECT ))
                                                                ^
  symbol:   variable S
  location: class VERSION_CODES
...\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:271: error: cannot find symbol
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, permissionNames, Manifest.permission.BLUETOOTH_CONNECT ))
                                                                                          ^
  symbol:   variable BLUETOOTH_CONNECT
  location: class permission
...\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\permission_handler-8.2.2\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:272: error: cannot find symbol
                    permissionNames.add(Manifest.permission.BLUETOOTH_CONNECT);
                                                           ^
  symbol:   variable BLUETOOTH_CONNECT
  location: class permission
44 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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 25s
Exception: Gradle task assembleDebug failed with exit code 1

Flutter Version is 2.5.1

I followed the setting up following this article https://medium.com/flutterdevs/augmented-reality-in-flutter-1153b0ef2758

Nothing seems to help

CariusLars commented 2 years ago

Hey @MalekHAMID , all errors relate to the Flutter package permission_handler, so I'd suggest moving the issue there. It seems to be related directly to running on the emulator though, did you follow this gudie to set up your virtual device?

naveenbharadwaj19 commented 2 years ago

I experience the same thing but if change compiledsdkversion to 31 this package is working . But if i do that other packages not working

CariusLars commented 2 years ago

also only on the simulator or on a physical device as well?

naveenbharadwaj19 commented 2 years ago

@CariusLars As of now i didn't test on physical device

flutter doctor -v ```dart [√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.19043.1237], locale en-IN) • Flutter version 2.5.0 at D:\OTHER FILES D\CS ALL FOLD\Flutter main sdk\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4cc385b4b8 (5 weeks ago), 2021-09-07 23:01:49 -0700 • Engine revision f0826da7ef • Dart version 2.14.0 [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at D:\Android_SDK • Platform android-31, build-tools 31.0.0 • ANDROID_HOME = D:\Android_SDK • Java binary at: D:\Android studio main\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [√] Android Studio (version 4.1) • Android Studio at D:\Android studio main • 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 1.8.0_242-release-1644-b01) [√] VS Code (version 1.53.2) • VS Code at C:\Users\bhara\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.20.0 [√] Connected device (2 available) • Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61 • Edge (web) • edge • web-javascript • Microsoft Edge 94.0.992.47 • No issues found! ```

Steps Tried:

- flutter clean
- dart pub cache repair
- delete cache folder
CariusLars commented 2 years ago

@naveenbharadwaj19 thanks for the additional info! I'm pretty sure this is an issue with the permission_handler package not working well with the Android emulator, so I'd suggest you open an issue or a discussion there and provide them with the same information.