0

when I have both libs/armeabi folder and libs/armeabi-v7a folder in my project, everything works and I'm able to perform static initialization of OpenCV by calling OpenCVLoader.initDebug()

However, since my primary goal is to support all the older devices that aren't using ARM v7 CPU's, I heard that armeabi-v7a has some optimization code while using just armeabi should be working for all devices so I wanted to remove it to reduce APK size. However after doing that it failed to initialize on my Samsung Galaxy S3.

Did I do something wrong? How to force it to initialize using libs/armeabi?

Thanks in advance!

Community
  • 1
  • 1
Bruce
  • 2,357
  • 5
  • 29
  • 50

1 Answers1

1

I figured out the problem but I'm not sure why it is behaving like so..

It is because of my folder structure:

/armeabi
   - libabc.so
   - libdef.so
   - libspecial.so

/armeabi-v7a
   - libabc.so
   - libdef.so

Because my device is using arm7 cpu, the final APK only contain libabc.so and libdef.so in the libs folder. That's why I couldn't initialize OpenCV which depends on libspecial.so. My question above is misleading as I said I removed armeabi-v7a folder but in fact I only removed the libspecial.so, sorry about that, should have mentioned it clearer.

However, after reading this article I'm more confused.. http://docs.xamarin.com/guides/android/advanced_topics/cpu_architecture .This article states that after version 4.0.4 it should do a merging and I wouldn't have this problem.. oh well.

I got it to work by removing armeabi-v7a folder entirely, so everything runs on armeabi. But I think this is not a good idea as some suggest I should create two seperate APK target with each architecture if I really want to save APK file size.

Bruce
  • 2,357
  • 5
  • 29
  • 50