B4A Library Vitamio 5 (Version 5.2.3)

Almora

Active Member
Licensed User
Longtime User
hi..
my app on google Play I installed it as aab the videos didn't open. I uploaded the videos again as apk opened. vitamio doesn't support aab?
sdk=29
 

moster67

Expert
Licensed User
Longtime User
hi..
my app on google Play I installed it as aab the videos didn't open. I uploaded the videos again as apk opened. vitamio doesn't support aab?
sdk=29
I presume with abb you mean App Bundle?
Unfortunately, I am not able to test uploading an app using App Bundle but it seems strange there would be problems.
Make sure to use the provided ARM-library (i.e. the library without x86 binaries which are not 64bit compatible) as already mentioned in the email you received from me.
 

Almora

Active Member
Licensed User
Longtime User


The library I'm using is new. v5.23

I tested it on sdk30 and it doesn't work. the page is closing.
converting the app to App Bundle(.aab) does not work.
It works in apk.

In the application I converted to App Bundle(.aab), videos are working in the videoview library. but videos working with vitamio library do not open.
 

Attachments

  • SharedScreenshot.jpg
    7 KB · Views: 177

moster67

Expert
Licensed User
Longtime User
No idea, sorry.
I have never used App Bundle. When I find some time, I will have a look.
 

Almora

Active Member
Licensed User
Longtime User
No idea, sorry.
I have never used App Bundle. When I find some time, I will have a look.
thanks..

screenshots in the application error log. maybe it can help.
 

Attachments

  • Screenshot_1631986514.png
    69.9 KB · Views: 205
  • Screenshot_1631986605.png
    74.2 KB · Views: 187
  • Screenshot_1631986611.png
    63.3 KB · Views: 198

moster67

Expert
Licensed User
Longtime User
It works for me.
This was my test procedure:
1) Changed the included demo app to use SDK 30 as target version
2) set the library to be used: Vitamio5_23OnlyArm and cleaned the project
3) Built the project using "Build App Bundle under Project Menu in B4A IDE. Here is the output:

To test the app on the phone (in my case Samsung Note 9 running Android 10):
1) I currently don't have any app on Google Play Store which I can update so I copied the "testvitamio5.aab" directly to my phone. Here is a useful link for testing abb-files by sideloading: https://beebom.com/how-install-android-app-bundles/
2) I used/installed a free app from the PlayStore called "App Bundle Installer" which is useful for testing.
3) Used above mentioned "App Bundle Installer" app and installed the Vitamio demo app on my phone and it worked just fine.

I made sure to use the latest B4A version (11.0 at the time of writing this post)
I installed the SDK and the tools as suggested from the download page of B4A.
I am using OpenJDK 11. Not tested with Oracle Java 8.

Maybe you need to use OpenJDK 11?

If you still have errors, then I have probably not understood your procedure/steps of getting the error. If so, please explain step by step your procedure.
 
Last edited:

Addo

Well-Known Member
Licensed User
Will change my jdk and test
 

Almora

Active Member
Licensed User
Longtime User
yes it works that way. I used the application at the link below to find out the cause of the problem. a conversion is being made and is working here. but it does not work when you install the application on google play and then download it from google play and install the application.

 
Last edited:

Addo

Well-Known Member
Licensed User
I couldn't test yet to upload in playstore at new version at the moment. but you can send your playstore apk so it can help to debug the issue
 

moster67

Expert
Licensed User
Longtime User
I had a better look. While the procedure I showed works, and which @Almora also confirmed to work, it does not work and will make the app crash when the app is downloaded from the Play Store.

I can confirm this since I made a demo app and uploaded it for internal testing using the Play Console and the app downloaded from the testing account did indeed crash on the phone. Just to be 100% sure, and exclude any problems with B4A and the wrapper, I also compiled the original demo project, written in Java, with Android Studio, uploaded the abb-file using the Play Console, and then tested it on my phone and also in this case, the same crash happens. I also tried setting "enableSplit = false" for "abi", which can be done in the app build.gradle file, in Android Studio and tested the generated App Bundle file but it crashed too.
So it is not related to B4A and my wrapper.

Since the APK-file works fine but the App Bundle does not, it means that the Abb Bundle, which is a publishing format, does some changes. This probably happens in the file structure since the error indicates that the library cannot be found.

I don't recall if the code for opening the library is available in the sources or not but if it is, maybe I can adapt it so the native libraries can be loaded. I have also made a post on SO to see if anyone can help and if there is a quick fix.

I will let you know later if this can be resolved or not.
 

moster67

Expert
Licensed User
Longtime User
OK, after further looking into this problem, the "problem" is that the APKs generated from the App Bundle leave native libraries uncompressed in the APK so they're not extracted at installation on the device, thus saving space on the device. Apparently, Vitamio is not using the Android standard way of loading native libraries, or else this exception probably would not happen. I had a look into the original Vitamio jars and I am unsure if I can change the behavior of loading the native libraries.

However, there is one easy fix, at least when using Android Studio. If I add the following line in the gradle.property file in Android Studio:
android.bundle.enableUncompressedNativeLibs = false
and then generate the App Bundle with AS, then the demo app I wrote when downloaded from the PlayStore will install and work properly on the device. This is of course defeating the purpose of Android Bundles, which is to save space, but since Vitamio is probably loading the native libraries not in a standard way, it is the only way to get it working.

As far as I am aware, B4A (and its IDE) is not using Gradle so that is a bummer (but also a lifesafer). I think B4A is using the BundleTool when generating App Bundles. It seems it should be possible to use the same option with BundleTool by setting the ApkOptimizations to use "setUncompressNativeLibraries(false). I found this snippet:
ApkOptimizations.builder()
.setSplitDimensions(ImmutableSet.of(ABI, SCREEN_DENSITY, LANGUAGE))
.setUncompressNativeLibraries(true) //should probably be "false"
.build());
The problem is that I don't know how to generate an App Bundle using the BundleTool and which parameters are needed.

There are MANY users of Vitamio and it still works very well and has some options required by users, such as rich codec support, RTMP, which are not found in other video libraries such as VideoView, ExoPlayer. It would be a pity if the life cycle of Vitamio came to an end.

I don't know if @Erel can help us?
 
Last edited:

moster67

Expert
Licensed User
Longtime User
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Try this:
Find bundleconfig.json in the installation folder and edit it (you need elevated permissions for this).

Something like:
B4X:
{
  "compression": {
    "uncompressedGlob": [
      "**/*.3g2",
      "**/*.3gp",
      "**/*.3gpp",
      "**/*.3gpp2",
      "**/*.aac",
      "**/*.amr",
      "**/*.awb",
      "**/*.gif",
      "**/*.imy",
      "**/*.jet",
      "**/*.jpeg",
      "**/*.jpg",
      "**/*.m4a",
      "**/*.m4v",
      "**/*.mid",
      "**/*.midi",
      "**/*.mkv",
      "**/*.mp2",
      "**/*.mp3",
      "**/*.mp4",
      "**/*.mpeg",
      "**/*.mpg",
      "**/*.ogg",
      "**/*.png",
      "**/*.rtttl",
      "**/*.smf",
      "**/*.wav",
      "**/*.webm",
      "**/*.wma",
      "**/*.wmv",
      "**/*.xmf"
    ]
  }
  ,"uncompressNativeLibraries": {
      "enabled": false
    }
}
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…