Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Experimental Android 64-bit ARM support (a.k.a. ARM64, a.k.a. AArch64)

Discussion in 'Android' started by Ignas83, Jan 10, 2018.

  1. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Not earlier than 2017.4.28f1.

    You could try one of two things: modify each of the shaders you use (adding a space or a newline would work already). If this doesn't help, you can try killing the shader cache from Java, before Unity is initialized. Make sure you do it just once :)
     
    BrainSlugs83 likes this.
  2. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Looks like it's been over two weeks since 2017.4.27f1, so 2017.4.28f1 should be out soon I would assume. Are you saying the fix will be in Unity 2017.4.28f1?

    I'll try modifying all shaders in my project by adding a space, as you suggested. I'm assuming that will force the shaders to be re-cached when the game starts up, because Unity will see them as having been modified? I'll do some testing to confirm.

    For your other suggestion, deleting the shader cache from Java, before Unity is initialized...I don't currently know how to do that. If the first suggestion doesn't work, I'll look into it further - any pointers on where to look for some documentation about that? Is this the right place to look? https://docs.unity3d.com/2017.4/Documentation/Manual/AndroidUnityPlayerActivity.html
     
  3. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    I'm saying that it's definitely not earlier than that, but I can't say if it's going to be 2017.4.28 or later. 2017.4.29 is more likely.

    Yes, exactly. Please do that somewhere in the middle, though :) It might trim whitespace at the beinning and at the end.

    I'm not an expert on the Java side of Android things, so I can't say for sure. I would need to search for this myself :)
     
    BrainSlugs83 likes this.
  4. codeglue-dev

    codeglue-dev

    Joined:
    Jul 16, 2015
    Posts:
    21
    Hi, we're having an issue with Unity's 64-bit libraries not being included in the APK produced by our build server. However they do get included when we build locally (see screenshot: top list is libraries in local build, bottom in server build). What could be causing this? We haven't been able to find a clue in our build logs yet, and the Android SDK / NDK setups between our computers seem to be identical.

    We're on Unity 2017.4.26f1. Android API 28.
     

    Attached Files:

    • libs.jpg
      libs.jpg
      File size:
      94.7 KB
      Views:
      677
    Last edited: May 27, 2019
    duong-tranthai likes this.
  5. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Changing whitespace in any of the shaders in my project doesn't result in any modifications in UnityShaderCache on my Android test devices. I'm not sure what else to change in the shaders. to force a change, without breaking anything. Any suggestions?

    Even if I get that working, what about the Unity built-in shaders? I have 22 shaders in my project, and there are 68 files in UnityShaderCache on my device, so I think there must be additional shaders being compiled, other than the ones found in my project.
     
    BrainSlugs83 likes this.
  6. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Another idea: I've been using only OpenGLES 2 up until now.

    I just tried adding OpenGLES 3 before OpenGLES 2 (to use 3 if it's available, otherwise fall back to 2), and UnityShaderCache has 75 new files added after I run the game once. I'm thinking this might be enough to avoid the "black screen" issue on startup that players are seeing, because the game shouldn't use any of the cached shaders.

    Only downside is that it will only work on OpenGLES 3-compatible devices, although I think most devices that support ARM64 also support OpenGLES 3.

    I also have never tested my game with OpenGLES 3, so this might introduce additional issues.

    In theory, if this works, I could go back to OpenGLES 2 in a future update (if needed) after Unity adds a proper fix for the original "black screen" issue, ie: needing to clear UnityShaderCache on startup if the architecture has changed.
     
    BrainSlugs83 likes this.
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Yes, OpenGL ES 3 uses different shaders, so it will help in this case as well.
     
    BrainSlugs83 likes this.
  8. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Update: the fix is going to be in 2017.4.28f1.
     
    BrainSlugs83 likes this.
  9. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Awesome, thanks for letting me know!

    I'll hold off on an update for my game until this is available (probably safer than the solutions I was considering!).
     
  10. DorInception

    DorInception

    Joined:
    Jun 25, 2017
    Posts:
    10
    Any news about ARCore 64bit support?
     
  11. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    ARCore (both the Google ARCore SDK for Unity and Unity's ARCore XR Plugin) have supported 64 bit for some time. Can you provide more details on exactly which versions of Unity and plugin you are using?
     
  12. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Is there a rough estimate as to when this will be available? Just wondering if it's likely to be in a day or two, or a week or more, as I still have a very broken game for many players that I need to get fixed ASAP.
     
  13. DorInception

    DorInception

    Joined:
    Jun 25, 2017
    Posts:
    10
  14. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    According to the release management, it should be shipped today.
     
  15. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    I can see 2017.4.28f1 in the list now.

    I don't see any mention of the Android issue that I've been discussing in this thread, where the UnityShaderCache will cause a black screen on startup and make a game unplayable if a player had an ARMv7 APK installed, and then updates to an ARM64 APK.

    @aleksandrk You mentioned that the fix would be in 2017.4.28f1. Was it forgotten/missed? Or was it included but not mentioned in the release notes?
     
    Last edited: Jun 4, 2019
  16. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Looks like it was added in ARCore v1.5. Under "Other changes", I see
     
  17. codeglue-dev

    codeglue-dev

    Joined:
    Jul 16, 2015
    Posts:
    21
    I'd like to bump my question, we still haven't been able to figure this out :(
     
  18. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    @aleksandrk Can you confirm if the fix made it into Unity 2017.4.28f1? It's not in the release notes. Thanks!
     
    Last edited: Jun 4, 2019
  19. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @smithmj5 this is exactly the issue that you've been experiencing.
     
  20. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    My apologies, but I'm not sure what your comment means. What is "exactly the issue that I've been experiencing"?

    Is the bug I've been experiencing fixed in 2017.4.28f1?
     
    Last edited: Jun 5, 2019
  21. DorInception

    DorInception

    Joined:
    Jun 25, 2017
    Posts:
    10
    That seems strange to me as I'm pretty sure we are on 1.5 and ARCore is not working when building for 64bit
    But I will try to update to 1.9 and see if it makes any difference
     
  22. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @smithmj5 apologies I misread you - I thought you've found the relevant release note.
    Yes the fix for 64-bit upgrade and shader cache is in 2017.4.28f1. Unfortunately the developer who made the backport forgot to add the release note, I'm trying to get it sorted now.
     
  23. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    And now, the release notes have been fixed too.
     
  24. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Much appreciated, thanks for the confirmation, and for updating the release notes. :)
     
  25. ERisine

    ERisine

    Joined:
    Mar 3, 2017
    Posts:
    7
    Hello everyone,
    I am on the way to update our mobile application to add and support Android 64 bit version.
    Our unity version is already 2017.4.17 LTS, which is supposed to deal with that, but the 64 bit flag is defined as experimental.

    Is it safe using this version?
    Or do you think we'd better move to the lastest 2017.4.28f LTS version (for what reasons/changes) ?
     
  26. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    You absolutely need to go to 2017.4.28f1. Otherwise you're going to have the same show-stopping issue that I did, which is that some players that had an ARMv7 version of the game installed, and updated to an ARM64 version, will have the game freeze at a black screen as soon as the game is started.

    This bug is due to having 32-bit shaders cached in the cache/UnityShaderCache directory. It is fixed in 2017.4.28f1.
     
  27. ERisine

    ERisine

    Joined:
    Mar 3, 2017
    Posts:
    7
    Hi smithmj5,
    thanks for the reply, I'll use the 2017.4.28 version then.
     
  28. Aravind_Aby

    Aravind_Aby

    Joined:
    Jan 26, 2018
    Posts:
    6
    @smithmj5
    Hi,
    I was using Unity 2018.1.6f1 all this while. Now, I wanted to include a 64-bit version of the app. So, since it is available only from 2018.2 and upwards, I installed Unity 2019.1.4f1 and included the 64-bit version. But now the app is not launching on my mobile phone. Like you said,it shows a black screen and closes. The app is not even starting. I tried switching to 2018.2.0f2, but nothing changed. A black screen just flashes once when we click on the app icon. That's it! I have tried almost everything to fix it. Nothing seems to fix it. Could you please help me fix it, if you know how to? Thanks in advance!!
     
  29. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    To see if it's the same issue that I was having (incompatible cached shaders in UnityShaderCache), try clearing your cache:

    Close your game completely. Open the Android "Settings" app, tap on "Apps", tap on your app in the list, tap on "Storage", tap on "CLEAR CACHE".

    Now try opening the game again. If it works properly, then it's probably the same issue that I was encountering. If not, it is probably a different issue.
     
  30. Aravind_Aby

    Aravind_Aby

    Joined:
    Jan 26, 2018
    Posts:
    6
    @smithmj5

    I just tried that. App is still showing black screen. :(
     
  31. smithmj5

    smithmj5

    Joined:
    May 24, 2013
    Posts:
    143
    Have you looked at the logcat output? It should give some clues as to what is happening.

    Also you mentioned you upgraded to Unity 2019 and are trying to build for 64-bit. I would strongly suggest trying an ARMv7 build first, with mono (if that's what you used to use before you upgraded to 2019), and see if that works.

    Then switch to IL2CPP and do another ARMv7 build, and see if that works.

    Then do an ARM64 build, and see what happens.
     
  32. Aravind_Aby

    Aravind_Aby

    Joined:
    Jan 26, 2018
    Posts:
    6
    @smithmj5

    Thank you so much for the suggestions. I will try that and let you know how it goes. :)
     
  33. Aravind_Aby

    Aravind_Aby

    Joined:
    Jan 26, 2018
    Posts:
    6
    @smithmj5

    hey,
    I tried the ARMv7 build first with mono in Unity 2019.1.4f1 like you said. And that also didn't work. It was also showing that black screen. So now I know it is not the problem with 64 bit version. And when I checked the logcat, I could see the following warning:

    Failed getting available Android API levels. Make sure your android sdk tools version is 25 or higher and you have internet connection.
    System.Threading.ThreadHelper:ThreadStart()

    But my sdk tools version is 25.2.5. I have a steady internet connection. And my target API level is 26. Dont know why I am getting this warning. I checked the threads related to this issue. But couldn't find anything useful.

     
  34. Aravind_Aby

    Aravind_Aby

    Joined:
    Jan 26, 2018
    Posts:
    6
    Okay so the reason for the black screen flashing and exiting when clicked on the app was an admob issue. So I reimported the admob plugin and also in the Player settings-->Publishing settings-->Minify, I changed from proguard to none for release. This solved the issue!
     
  35. divmob

    divmob

    Joined:
    Apr 21, 2017
    Posts:
    5
  36. divmob

    divmob

    Joined:
    Apr 21, 2017
    Posts:
    5
    We have just found that these devices have 64 bit chip but running 32 bit OS (not sure for all of them)
     
  37. YoNeyers

    YoNeyers

    Joined:
    Feb 10, 2017
    Posts:
    32
    My game crash when using Unity 2019.1.8 in Android 9 . 8 . and 7?
    I'm having the same issue:(
    but in Android 6 and 5 it's Work fine .
    If use this version 2017.4LTS it resolves the problem ?
     
  38. duong-tranthai

    duong-tranthai

    Joined:
    Jan 5, 2016
    Posts:
    15
    I got same problem with Unity 2017.4.29 and still dont know how that happen. Could any one help, please ?
     
  39. divmob

    divmob

    Joined:
    Apr 21, 2017
    Posts:
    5
    After many test, we found that build il2cpp 32bit (we tried to build il2cpp 32bit and 64bit separately) is very lag and easy to crash.
     
  40. Dhiren_AI

    Dhiren_AI

    Joined:
    May 10, 2019
    Posts:
    16
    i have same problem,
    Unity 2019.2 IL2CPP build perfectly run in ARMv7 device but continuously lagging in ARM64 device.
    do you have any suggestion for this?