3

I generated a .so file which is builded by using ndk-build command. And in the Application.mk file,i writed these: APP_ABI := armeabi. Then, I used this .so file in another app, but I figured it out that the app is visible in Google play with an x86 device.

From the docs (http://developer.android.com/google/play/filters.html): By including native libraries built with the Android NDK that target a specific CPU architecture (ARM EABI v7 or x86, for example).

Now I'm confused, what should i do to make my app invisible to x86 device in GooglePlay?

We have an application published in GooglePlay,the application will crash in x86 device. So we want to make the application invisible for x86 device in GooglePlay. Now we have our .so file in armeabi directory under jniLibs directory, but x86 device still can find the application in GooglePlay.

lqynydyxf
  • 31
  • 4
  • I believe that the Play Store expects all x86 devices to have a translation layer: http://stackoverflow.com/questions/13005303/how-does-native-android-code-written-for-arm-run-on-x86 – Morrison Chang Feb 25 '16 at 03:48
  • @MorrisonChang Hi, I just updated my question. – lqynydyxf Feb 25 '16 at 06:38

1 Answers1

3

Google Play may be depending on the fact that x86 has a translation layer which will take armeabi code and translate to x86. See: How does native android code written for ARM run on x86?

While I don't know why your particular app won't work on x86, one way to handle it is to check the CPU/Architecture when you app starts up via the old

Build.CPU_ABI

or on API 21 and up

Build.SUPPORTED_ABI

http://developer.android.com/reference/android/os/Build.html#CPU_ABI

and prevent the user from running your app if a condition isn't met like CPU architecture. So on launch you would check and if the device isn't correct degrade with a dialog and/or prevent the user from accessing the feature which would crash.

EDIT

If you are required to block devices from even seeing your app, you'll have to use the Google Play Developer console to select what devices can see your app.

See: How to restrict android app to specific device make?

and https://support.google.com/googleplay/android-developer/answer/1286017?hl=en

Of course as new x86 devices come online you'll have to remove them as well.

Community
  • 1
  • 1
Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • Thank you for your answer!The reason that out app won't work on x86 is because some native methods in .so file is not compatible with x86. That's what our engineer said. I don't know the technical details. – lqynydyxf Feb 25 '16 at 08:35
  • On consumer x86 devices, `Build.SUPPORTED_API` will also report ARM architectures since they're supported through the translation layer. You can check if x86 is part of the list but blacklisting devices based on their CPU architecture may just piss users off. Why not fixing your compatibility issue? – ph0b Feb 25 '16 at 12:49
  • The .so files is provided by our Graphics engineers, they told me fixing the compatibility issue is a huge project, so I have to make the app invisible for x86 device. Is there a method to modify Build.SUPPORTED_API? – lqynydyxf Feb 29 '16 at 03:14