Greetings,
Our existing app, found at
https://play.google.com/store/apps/details?id=com.imoogi.gevacampus ,
does not seem to work on the new Android Pie. We have not made any changes to the app in the past year or so.
I've asked the app's developer, who no longer works for us (just to explain why I'm here), for help. He used an emulator to come up with the attached log.
Can you tell what the problem is from that? Is there a quick fix?
Edit: I'm not sure what version of the studio the app was compiled with, given that it was uploaded more than a year ago. I'm still trying to figure out if the issue is still occuring on a recent alpha release that was compiled on a newer SDK.
Appreciate your help.
Omri sapir
It looks like the
BinaryEncoder
class was removed in Android 9.0. It is used in the Ti.UI.ImageView [here](https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/util/TiUIHelper.java#L922) to handle image resources. A simple fix would be to use the following instead:*EDIT*: I just ran our kitchensink sample-app on Android 9 and it works fine, even with image-views. It is possible that you use some kind of Ti.Android.R or Ti.App.Android.R API's to get Android resources (aka res-id's) to be displayed in an image-view within your app? *EDIT 2*: Ok, so I think I pinpointed it. Where and how do you use the
images
(notimage
) property of the Ti.UI.ImageView and what do you pass?Hi! Thanks for the quick update. According to our developer, We use it for splash animation. Here is the bit of code that deals with it:
Thanks, so I was right, yey! Would you be able to provide the above test-case in a simplified (classic app.js) project that you can attach? Once we are able to reproduce it, we could fix it on the fly and provide you a custom version of the SDK so you can reupload your app asap. Thank you! *EDIT*: I just tested the following code (with some demo resources in platform/android/res/drawable) and it works fine on Android 9:
I used 7.2.0.GA, but 7.1.1 should work quite the same. Did you try to use 7.2.0 or even 7_3_X (ti sdk install -b 7_3_X) already? I even tried to remove some drawables to see if that triggers the error but it doesn't.
I was able to reproduce it. The issue can also be seen when using
Ti.Utils.md5HexDigest
which uses the same internal API's:PR: https://github.com/appcelerator/titanium_mobile/pull/10253 Test-Case: Above
Tried to remove the code that dealt with the animation. I still see errors in the log; hopefully it helps:
[~osapir] The root cause was an outdated Apache "common-codec" library used for md5/sha calculations. I am just uploading you a custom 7.1.2 version that represents a 7.1.1.GA + this fix so you can test and upload it right away. [Download 7.1.2 here](https://eu.syncplicity.com/share/x75owoazxqh6wfc/mobilesdk-7.1.2-osx).
Our developer is installing and checking right now. I really appreciate the quick handling of the situation. Thank you. Edit: Our developer is having issues with the installation. Is there a chance for a Windows version?
I'm sorry, I run on macOS only. You could cherry-pick the changes from the pull-request manually and build an own (windows-based) version of the SDK.
[~osapir], is your app targeting API Level 28 (aka: Android P) as shown below?
Titanium does not support "targeting" API Level 28 yet. As of Titanium 7.3.0, we support targeting up to API Level 27 (aka: Android 8.1). We document what we support [here](https://docs.appcelerator.com/platform/latest/#!/guide/Titanium_Compatibility_Matrix-section-src-29004837_safe-id-VGl0YW5pdW1Db21wYXRpYmlsaXR5TWF0cml4LUFuZHJvaWRTREsvVGFyZ2V0QW5kcm9pZHBsYXRmb3Jt). Now, we do allow app developer to target a higher API Level at their own risk, but recommend that you stick to what Titanium supports since this is what we internally test against. I say this because Google introduces breaking-changes when targeting higher API Levels. For example, Google documents the following breaking-changes for Android P in the link below. We have to go out of our way to resolve these breaking changes in our core Titanium code before we can claim that we support targeting it (like the changes [~hknoechel] is suggesting). https://developer.android.com/about/versions/pie/android-9.0-changes-all For now, I recommend that you build with Titanium 7.3.0 and target API Level 27, which is the API Level that Google Play currently requires. An Android P device will run your app in backward compatibility mode and will correctly load your images and perform MD5 hashes. I've confirmed this.
Since our current production build was uploaded on March 2017, I assume the target SDK is much lower than that. And that's the build that is having issues on Pie.
I can't reproduce this issue in Titanium 7.1.1 unless I explicitly target API Level 28 (Android P) in XML myself. By default, Titanium 7.1.1 won't target Android P, which avoids this issue. Can you double check your "tiapp.xml" file please? Check if you have the below set. If you do, then I recommend that you delete it. Titanium will then automatically target the highest API Level it supports.
Verified the fix on SDK 7.5.0.v20181001073642. Image view displayed correctly on android 9 and other OS versions.Closing Operating System Name = Mac OS X Version = 10.13.6 Architecture = 64bit Node.js Node.js Version = 8.9.1 npm Version = 5.5.1 Titanium CLI CLI Version = 5.1.1 Titanium SDK SDK =7.5.0.v20181001073642 Device =samsung s5 android 6,pixel2 android 9, sony experia android4.1 emulator.