api.video-flutter-uploader
api.video-flutter-uploader copied to clipboard
[Bug]: Android release mode: response null values
Version
1.2.1
Environment that reproduces the issue
Google pixel6a Android 14 Android studio emulator, Vivo android 13 Flutter 3.16.7 ~ 3.19.1
Is it reproducible in the example application?
Yes
Reproduction steps
After implement the package, I tried to test it as release mode. But response's property has null always.
Expected result
In the response, Current release mode sends all null "assets": {hls: null, iframe: null, player: null, thumbnail: null, mp4: null}
I want to get the correct value for each parameter of assets. "assets": { "hls": "https://vod.api.video/vod/vi7mdtR2wbth2lpgIazD74Ik/hls/manifest.m3u8", "iframe": "<iframe src="https://embed.api.video/vod/vi7mdtR2wbth2lpgIazD74Ik" width="100%" height="100%" frameborder="0" scrolling="no" allowfullscreen="true">", "player": "https://embed.api.video/vod/vi7mdtR2wbth2lpgIazD74Ik", "thumbnail": "https://vod.api.video/vod/vi7mdtR2wbth2lpgIazD74Ik/thumbnail.jpg", "mp4": "https://vod.api.video/vod/vi7mdtR2wbth2lpgIazD74Ik/mp4/source.mp4" },
Actual result
Greetings API.video team.
https://pub.dev/packages/video_uploader It works in debug mode as well. But in the release mode, it works but response of uploading are null for each paramter.
> I/flutter (14583): [video uploading result=====:, {videoId: vi2zZOODhfOFMaeY97eSkBfg, createdAt: 2024-03-20T20:42:24.000Z, title: REC6169411350185702043.mp4, description: , publishedAt: 2024-03-20T20:42:24Z, updatedAt: 2024-03-20T20:42:24.000Z, tags: [], metadata: [], source: Instance of 'VideoSource', assets: Instance of 'VideoAssets', playerId: null, _public: null, panoramic: false, mp4Support: true}]
> I/flutter (14583): [video uploading result=====:toJson, {hls: null, iframe: null, player: null, thumbnail: null, mp4: null}]
> I/flutter (14583): [video uploading result=====mp4:, null]
> I/flutter (14583): [video uploading result=====thumbnail:, null]
Please help me what I do to receive correct response. Best regards. Thank you.
Additional context
Video ID: vi7mdtR2wbth2lpgIazD74Ik
Relevant logs output
There is no error.
Hi, Thanks for reporting this bug. I can't reproduce exactly the same problem but there is indeed something odd with the obfuscation that we must fix. What upload method do you use?
As a workaround,you can set minifyEnabled to false in your application build.gradle.
Thanks for your response. I am using this function to upload video.
await ApiVideoUploader.uploadWithUploadToken(
Config.uploadToken, uploadFile.path,
)
I tried to build apk after setting minifyEnabled false. But failed to build by the setting.
hmm, I still have no clue on how to reproduce the exact bug. Have you tried to reproduce it in the example?
I added proguard rules in the native dependency but I want to make sure it fixes your issue before releasing it.
I don't think the issue on proguard is the issue you are looking at.
Anyway, I fixed in in the main branch. (and I also added a toString() for the Video object).
On my side, VideoAssets always returns correct value.
Is there a way I can reproduce your issue on my side? (like in the example, in a test application)?
I have the same problem with a pixel 8, Android 14, if the app is built in release mode the .uploadWithUploadToken returns null values every time, as described by devz097, the strange thing is that in debug mode it works perfectly.
The videos however in both release and debug mode are uploaded correctly on the api video side.
There is any solution?
Hi @Bram-000,
I added proguard rules in the native dependency but I want to make sure it fixes your issue before releasing it.
According to the git history, this is still true. Have you tested in the current main branch? If not, could you directly test the example in the main branch?
Hi, @ThibaultBee Sorry I tried only the release 1.2.2 I did't read carefully the messages... my bad, I forced the version from the main branch and it's working fine thank you. I think this fix is worth to be in the next version, thank you.
Thanks for testing. As this is a major issue, I will release today.
Fix in v1.2.3 See commit: https://github.com/apivideo/api.video-flutter-uploader/commit/3eb559920545b284500983202c8d3ba22cf62e5f