Delphi XE7 compiling for android 5.0 lollipop ( Nexus 7)

Delphi XE7  compiling for android 5.0 lollipop ( Nexus 7)

unit FMX.Graphics.Android;

line 285
TJBitmapFactory.JavaClass.decodeByteArray
return Options.outWidth=0 and Options.outHeight=0 .. function fails

This makes any software with stored bitmap resources ( i.e. Timage ) failing to load on android lollipop.

Anybody experienced the same?

Comments

  1. Don't have any help for you but I think Embrccadero have many tasks to realize: Android 5, iOS 64bit and both - significant, and  also we need Linux :)

    ReplyDelete
  2. Is this happening with a developer image or with an officially delivered?

    ReplyDelete
  3. Roland Kossow official android 5 image for nexus, released today

    ReplyDelete
  4. We tested on developer images, and this didn't happen (or wasn't noticed). Do you know if the bug has been opened on quality.embarcadero.com? Is this only if you store the image in the FMX file, not if you load it separately? Does it happen also for images in buttons?

    ReplyDelete
  5. Hi! All works fine on Andoid L developer on Nexus 7 2013. I'll then try to update my Nexus 7 2012 to last img. BTW do you use an SDK, bundled with studio, or any updated version?

    ReplyDelete
  6. Well, not totally fine.. There is a known issue: TListView doesn't show bitmaps on Android L

    ReplyDelete
  7. I've updated my Nexus 7 2012 to Android 5.0, can't reproduce the problem. Thus, two questions unanswered yet: do you use a bundled SDK and what Nexus 7 do you use?

    ReplyDelete
  8. simple program with a listview and button closing, do not even open since I downloaded the new SDK and ndk, anyone have any idea? I use nexus 5 factory version Android 5.0

    ReplyDelete
  9. As http://docwiki.embarcadero.com/RADStudio/XE7/en/Installing_the_Android_Development_Tools says, "The installer for RAD Studio installs the current recommended and tested versions of the Android development tools during the RAD Studio product installation."
    If you need to have an up-to-date SDK, please install it separately and don't bind it to Studio

    ReplyDelete
  10. That's strange, but after I've updated a bundled SDK, the problem still doesn't occur :( Please, make a test app and make an issue at quality.embarcadero.com, as Marco said. Anyway I have an option: now I'll try to update NDK.

    ReplyDelete
  11. No bug anyway. I'll wait for further details.

    ReplyDelete
  12. Arturo TheMonster As Sergey mentioned int he thread, we made some tests but could not reproduce. If you have more info or a sample program that fails please log it in quality portal and possibly link in this thread, so we can follow up.

    ReplyDelete
  13. Marco Cantù Just create new project with imagecontrol, here is resource:
    object Form3: TForm3
      Left = 0
      Top = 0
      Caption = 'Form3'
      ClientHeight = 480
      ClientWidth = 640
      FormFactor.Width = 320
      FormFactor.Height = 480
      FormFactor.Devices = [Desktop]
      DesignerMasterStyle = 0
      object ImageControl1: TImageControl
        Bitmap.PNG = {
          89504E470D0A1A0A0000000D4948445200000020000000200806000000737A7A
          F4000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000
          0739494441545847ED564B88645719FEEEB98FBA55F751555DFD986062331DB3
          51883023411C0717AEDC19649044C94AC8DEC72671313B5D0F220A11DD25615C
          E842170141431C64187004495424DDF4A4273DD595EAAED77DDF7BFCFE733BA6
          93B40B17E266FEAABFCEB9F79EFAFFEF7CFFE35C3C94FFB758F2B3582CB66CBB
          F4CD9DFF8DE85E6F6DFF74FE21B1E87CF38F6FBC715055B9EDBA1E3A1DCFD29A
          FFD08DB62C0B8E6DC3F53C2865C3B66D4BF15A5996564A81CF2DFE98B9514B99
          3554EDB82E1CC7E1B5A21BF3FC07A3D1E8C5D6ED07622549B2FDBBD75EDBFBDE
          F7F9CC167BAD314EA0F8673A13A39CDBE810E0D670DD8C863B4B4373420C7271
          FA956BBA34005B5BCF3EF30C1EDF79BC393C3CFCD6952B577E6E3C9F8AC0435D
          D758EA04A99D2373A86E8EC22B51B8D44E858CF3CC2B90FB25BAEB3DF41FE91B
          8D8D46882EC4548E5B11C2AD10C16688EE460FFE7A17DE90EC79863D75EFDEBD
          6F1AAF67C40090DDC95E64075A76F5BE2A8DAA5F7181EC50A3A80ACC92B97926
          EC2B4DCA358D6B52CD0FAFE0366EAB9507AF92D185D588179AB72CA79D7D2006
          808953C2054B1A5D9236D115EF95C0F4AB13A020AD2929A5CE264B20E3BA926B
          2ADEAB88BAD6980EA6787BE76D34BAE1658D1A154A8BAA4A944DC59CE2869858
          C6EB1931009A46A3F11A343D6A40033D1AE855A8D61882477294C3027587F7A8
          0BBDC0B43C416E3324D4C2A6033A7977EB01C69B47C45AA0A263F90808038621
          6E1ADAAEAAF31910FA3DD73109C4E46F95BBAAC21ACED845763195AA30F7EBAA
          C1C9628EA6A64131CAB1E6987449612D64D021AF6B61A269E7554D2004911785
          6DBC9E110340CA47CA66D0EFB7B94091DF72AB40F74E80E55374C8DDCB33A172
          BE9C232F0BE3DC80024706DA29B84186C4CE9911990D27738C3605192610C6A7
          357E465A06E43E9FAF050338358D64CC8794B7FC06DDBFFAE8DE0DD030F11473
          C45A592866AC8C931C56A1A09927852AA0B839C987C44B91A99C1595217152AC
          9C04A56608C98065ABF373C02448CE674CF8611C7347FC38D46E49CAF9C7A985
          F4D18425C9987B2C533BC1513EC18A999BEA14C7D131DCB90B95293ECBFE4DB9
          844B58AA382FCB52DAC6F9008A2247ED324644DE097DB8BE63AEA50C75CE9DDF
          B7518E4839C134342AB13D78E23EB23AA5930AD3D131C27743384B072B7F85B2
          66628A36A50153559C13409A66EC601F1603204B5222652C69380B32C46104ED
          302C2C3FC12CB4577185860C368C75B69DE1E8F363BC174DE9A842CA04EC4C3A
          F0C75D247ECAF5349B5AD87D72CF3C6FC86E45A02CD18FE7409665480920FB74
          86C9E5F7B0FBDC2E9ABE863B74A0E60450701147ED6B2CBE3CC7E24B73AC3EB7
          C4F0951126172628B85301DF240D0F1660192D300B6638D839C0F8B1B1019174
          088A8DABE3BAE787409A877DC82EB6EB62E3971B38F9CC31D4169BCD81034DCA
          0578F46A8CEEEFD95EFFD445F4AB18F67D85B9BBC0D1D611EC131B3969AE0822
          0952BCF995B7F0CE67DFC1C5DF5E84CE34192200FAA93F5E042D00D356C72CC5
          7D96CDAE837C5020DD4EE1AD5C3404DD28E643C95C20B56AC64A60352027F069
          83F11363F8BB5D13E33AABB11A2418FE65884FFE7A1B6A6263747B04EFD0931E
          80AA603D7E445A06A4A130B692AD755EC37BD345F2A9A46DC7FC8B00D7B2867A
          DA524D49BB7FF3B0D85E403D50DC3DDBED4CA37FB78FE8CF11EC031BF58CF616
          D4921DCAD8D0AEF17A460400EDD1A85421134540387FE7E1F24F56424687A6F9
          70141BAC08D61D034DD6186FF71F6C5EAF0E519FB0822AD67E9322B81DB0AA0A
          242E4B947D2051292AFE5912703C26CD1F11D57AE75718601CA5EEEB5983E0E5
          00FA988EE77CB6A453C65296D60ECBD0E79A80CAEEA8DEB2F928435EF308179A
          331E4019FB45C6732467F951A527C87B05CB5092505890962C69D102B09485C0
          0AC15702D429D14A9FB738B213EA901A907299D3B97029E784AE088A8DAB2A2B

    ReplyDelete
  14. E35872402A428E6C494819E57E91B30B32045C2DD7E234A676A9261CD67C3E5F
          FFC54B2F3DE8743AAAF60B58EC1502A8A0C192C697C912AB15E94CD956931532
          362D43719A61B95A6195B2D54A0272970DFB8889B5A84CE84E9AD9735F7F1657
          9FFA4273F3E557EEFEE8A73FF906FDAEA827D48513C7F1E46B4F3FFDE3AB5FBC
          FABCB60AD7264BF282D2F37D384188F5E1D0E44649A702428CCB2B97E3F0B0A1
          7A7C5F0C23BE0545B179FDCA7202E44195137C9E0BE8148F7DE25183AB2C495D
          CB4072EDDAB5E4E6CD9B6D1C767676FAFBFBFB4F0E87C30B1B1B1B9B94F5417F
          B011F7E351AFDB1D4451348CC330EEF87E1805611846518FCEBD22CFAD9C0EE5
          C8EDF57AE852DF7F19159432BABC2630ED3A6EFDDDEF7CFB87B7EFDCF9195DDE
          A392AED3443847E4BE75F9F2659BEE6C52EC4E26930E69EE527B7B7B7B014316
          F32D7793BAB146190CD646711CF22C8BFBDCC880429C51B8C6DB04D779FDF53F
          FCE6C68D1B2F90C503DA16268CFC2700FF95481E5FBF7E5D6CA9E9746A1F1F1F
          3B7C0175397ABC16F0CEA54B97A6B76EDD62F13E94877256807F01138661B2B7
          102FC70000000049454E44AE426082}
        Position.X = 80.000000000000000000
        Position.Y = 80.000000000000000000
        Size.Width = 60.000000000000000000
        Size.Height = 60.000000000000000000
        Size.PlatformDefault = False
        TabOrder = 0
      end
    end

    I have found now that problem happends only if you load  an .ico into the timage, a standard bmp have no problems, but both are than saved as png, so probably it's something related to transparency,
    i'm downloading now xe7 with update1 from embarcadero and the ndk r10c, i'll let you know shortly if this fix something

    ReplyDelete
  15. Same problem with XE7 update 1 and ndk-r10c
    here is a copy of the demo project

    http://themonster.ch/Project2.zip

    tested on nexus7 2013 build lrx21p image,
    "Cannot load bitmap" Error and app hang

    on android 4.4.4 all works fine,

    i think the generated resource image is no more compatible with android 5.0

    ReplyDelete
  16. Hi! The bug is tracked, it depends on image format. That's why I couldn't reproduce it.

    ReplyDelete
  17. So this is an issue FMX has with apps running on L, a bit elusive (as it depends on the actual images) so we missed it in our testing. We'll work for a solution ASAP.

    ReplyDelete
  18. Tedit is making app crash in lollipop?

    ReplyDelete
  19. Hi, I wrote a blog post on how to apply the workaround provided by David Berneda with some code to ease the process: http://blog.delphiedintorni.it/2014/12/workaround-per-lerrore.html

    ReplyDelete
  20. This android lollipop bug might be related, I'm not 100% sure but it looks suspicious: https://code.google.com/p/android/issues/detail?id=80316

    ReplyDelete
  21. Paul McCombie An official hot fix is coming. We have a solution, need to do some more testing and we'll release it. As I mentioned earlier, the issue depends on the image, not all applications have the problem.

    David Berneda Yes, it looks the same. There really seems to be a bug in the release version of L, which wasn't there in previous betas.

    Google might offer a fix which will be good for compatibility with existing FMX apps (and many other applications written in java and other languages). In any case, we still need to release the hotfix, so that a Delphi developer can (easily, with no change in code) release an update that is Lollipop friendly.

    ReplyDelete
  22. Greetings everyone, any news on the update? I am curious on release date.

    Kind regards

    ReplyDelete
  23. This issue is finally closed thanks to the new delphi XE7 update http://cc.embarcadero.com/item/30110

    Marco Cantù Sergey Krasilnikov  I found a minor problem with the new libs,
    if you use const from jActivity like
    TJActivity.JavaClass.AUDIO_SERVICE
    or
    TJActivity.JavaClass.MODE_PRIVATE

    jni check will stop the program, you must replace class const,

    SharedActivity.getPreferences(TJActivity.JavaClass.MODE_PRIVATE)
    need to be changed to
    SharedActivity.getPreferences(0)
    and all is working properly

    p.s. i hope to get sources soon since i cannot apply a fix to load custom fonts on android..

    Anyway a big thankyou to embarcadero dev team is mandatory

    ReplyDelete

Post a Comment