shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.35k stars 142 forks source link

fix: [ ] Execution failed for task ':camera_android_camerax:compileReleaseJavaWithJavac'. #2464

Closed anything-good closed 2 months ago

anything-good commented 2 months ago

App ID: 46bc1f29-7bd9-4068-96db-49bd43527b2a

Description

I made an android patch and now I can't publish it and I am getting this error.

Steps To Reproduce

create a project with the following dependency and check if you can publish a patch for it compatible with my android release apk.


environment:
  sdk: '>=3.0.0 <4.0.0'
dependencies:
  flutter:
    sdk: flutter

  appinio_video_player: ^1.2.2
  # cached_video_player:
  #   git:
  #     url: https://github.com/vikram25897/flutter_cached_video_player
  #     ref: feature/gradle_version_bump

  supabase_flutter: ^2.5.6
  hashids2: ^2.0.0
  uuid: ^4.4.0
  dio: ^5.0.1
  flutter_svg: ^2.0.7
  cached_network_image: ^3.1.0
  carousel_slider: ^5.0.0
  device_info_plus: ^9.0.0
  image_picker: ^1.0.7
  lottie: ^3.1.2
  shared_preferences: 
  curved_navigation_bar: ^1.0.3
  liquid_pull_to_refresh: ^3.0.1
  flutter_zoom_drawer: ^3.0.4+1
  photo_view: ^0.15.0
  flutter_local_notifications: ^17.0.0
  timezone: ^0.9.1
  intl: ^0.19.0
  flutter_launcher_icons: ^0.13.0
  flutter_native_splash: ^2.2.19
  flutter_animate: ^4.1.1+1
  youtube_explode_dart: ^2.0.2
  flip_board: ^1.0.0
  confetti: ^0.7.0
  animated_text_kit: ^4.2.2
  firebase_core: 
  firebase_messaging: ^15.0.1
  flutter_html: ^3.0.0-beta.2
  camera: ^0.11.0+1
  tflite_flutter: ^0.10.4
  card_swiper: ^3.0.1
  flutter_pdfview: ^1.2.7
  # flutter_zoom_videosdk:
  #   path: /home/ahmed/Downloads/flutter-zoom-video-sdk-5.17.2-1.10.2
  dart_jsonwebtoken: ^2.13.0
  google_fonts: ^6.1.0
  flutter_lints: 
  flutter_hooks: ^0.20.5
  events_emitter: ^0.5.2
  url_launcher: ^6.2.5
  # flutter_zoom_meeting: ^1.0.1
  # zoom_native_sdk:
  # flutter_zoom_sdk: ^1.1.0+4
  # jitsi_meet_flutter_sdk: ^0.3.0
  flutter_card_swiper: ^7.0.1
  flutter_flip_card: ^0.0.6
  webview_flutter: ^4.8.0
  flutter_tts: ^4.0.2
  speech_to_text: ^6.6.2
  video_player: ^2.8.6
  image: any
  path_provider: any
  audioplayers: ^6.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter

Expected Behavior

A clear and concise description of what you expected to happen.

Screenshots

none.

Additional Context none. it was working fine untill recently, I think the flutter version I build the apk with is not compatible with my current one. I tried removing the camera dependency from the pubspec.yml and I was able to create the path and publish it but when opening the app it freezes at the splash screen

bryanoltman commented 2 months ago

Can you share:

  1. The command you're running
  2. The log file that is linked to at the end of the shorebird logs
anything-good commented 2 months ago

command is :shorebird patch android -v

pub_log.txt

bryanoltman commented 2 months ago

That looks like a log from a run of a flutter pub command and not a shorebird command. The log file name should look like 1725570575883_shorebird.log , where the number is the timestamp when the command was run.

bryanoltman commented 2 months ago

And the path to this log file will be printed at the end of the failed command output, like so:

If you aren't sure why this command failed, re-run with the --verbose flag to see more information.

You can also file an issue if you think this is a bug. Please include the following log file in your report:
/Users/bryanoltman/Library/Application Support/shorebird/logs/1725570575883_shorebird.log
anything-good commented 2 months ago

shorebird_log.txt thanks for your help in advance.

bryanoltman commented 2 months ago

The error appears to be:

[        ] /home/ahmed/.pub-cache/hosted/pub.dev/camera_android_camerax-0.6.8+2/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java:84: error: cannot find symbol
[        ]             new TextureRegistry.SurfaceProducer.Callback() {
[        ]                                                ^
[        ]   symbol:   class Callback
[        ]   location: interface SurfaceProducer
[        ] /home/ahmed/.pub-cache/hosted/pub.dev/camera_android_camerax-0.6.8+2/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java:85: error: method does not override or implement a method from a supertype
[        ]               @Override
[        ]               ^
[        ] /home/ahmed/.pub-cache/hosted/pub.dev/camera_android_camerax-0.6.8+2/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java:91: error: method does not override or implement a method from a supertype
[        ]               @Override
[        ]               ^

This looks to be an issue with the camera_android_camerax plugin. I would verify that the version you're using is compatible with your Flutter version.

anything-good commented 2 months ago

I don't use this package directly but the camera package is dependent on camera_android_camerax: 6.5 and for some unknown reasons I see that camera_android_camerax-0.6.8+2 is being installed .

and I checked the packages that depends on the camera_android_camerax and it is only the camera package: https://pub.dev/packages?q=dependency%3Acamera_android_camerax.

I am not sure if that is the issue or not but any help will be appreciated.

anything-good commented 2 months ago

any updates???

anything-good commented 2 months ago

image as you can see they drop support for the flutter version I am using witch is 3.22 they only support 3.24 and above

anything-good commented 2 months ago

I solved this by add this to my pubspec.yml: camera_android_camerax: 0.6.5