UPDATE: OK, so I've looked into this a bit further. Managed to use bundletool to try and test the different apks, and found this:
"App Bundle contains 32-bit RenderScript bitcode file (.bc) which disables 64-bit support in Android."
Does anyone know how I can fix this? The renderscript forms a pretty important part of the project.
I'm trying to get my app 64-bit compatible for the new PlayStore requirement. We do use RenderScript in the app, so I was wondering if this will cause issues? And, how does one fix those issues? The renderscript is a very tiny script that just outputs a bitmap with green or red sections depending on the input.
#pragma version(1)
#pragma rs java_package_name(za.co.overtake)
int*reds;
int*greens;
int*blues;
int imgWidth;
uchar4 RS_KERNEL root(uchar4 in, uint32_t x, uint32_t y) {
bool colourme = false;
for(int col = 0; col < imgWidth; col++){
const int red = reds[col];
const int green = greens[col];
const int blue = blues[col];
if (in.r == red && in.g == green && in.b == blue){
colourme = true;
}
}
if (colourme) {
// Cannot increase red amount much as it will cause issues when capturing the image in 565
// format.
in.r = 100;
in.g = 10;
in.b = 10;
in.a = 100;
} else if (in.a > 200) {
in.r = 21;
in.g = 63;
in.b = 81;
in.a = 100;
} else {
in.r = 0;
in.g = 0;
in.b = 0;
in.a = 0;
}
return in;
}
we call this script in java like so:
final RenderScript rs = RenderScript.create(this);
final Allocation input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT | Allocation.USAGE_SHARED);
final Allocation output = Allocation.createTyped(rs, input.getType());
final ScriptC_singlesource script = new ScriptC_singlesource(rs);
Allocation red = Allocation.createSized(rs, Element.I32(rs), reds.length);
red.copyFrom(reds);
script.bind_reds(red);
Allocation green = Allocation.createSized(rs, Element.I32(rs), greens.length);
green.copyFrom(greens);
script.bind_greens(green);
Allocation blue = Allocation.createSized(rs, Element.I32(rs), blues.length);
blue.copyFrom(blues);
script.bind_blues(blue);
script.set_imgWidth(noOfColours);
script.forEach_root(input, output);
output.copyTo(bitmap);
RenderScript blur = RenderScript.create(this);
ScriptIntrinsicBlur theIntrinsic = ScriptIntrinsicBlur.create(blur, Element.U8_4(blur));
Allocation tmpIn = Allocation.createFromBitmap(blur, bitmap);
Allocation tmpOut = Allocation.createFromBitmap(blur, bitmap);
theIntrinsic.setRadius(4.0f);
theIntrinsic.setInput(tmpIn);
theIntrinsic.forEach(tmpOut);
tmpOut.copyTo(bitmap);
The Android Developer documentation states that using any C or C++ code could make your app incompatible. But, I couldn't find a solution to RenderScript specifically.