Search Unity

Unable to find Kernel32

Discussion in 'Android' started by Polo07, Dec 17, 2018.

  1. Polo07

    Polo07

    Joined:
    Sep 10, 2018
    Posts:
    6
    Hi I am trying to build a multiplayer . Everything runs fine until I get an error
    "Unable to find Kernel32" during game and just after that socket gets disconnected . I happens so frequently that in 4 mins game , I get disconnected around 8-9 times.
    I tried to switch unity version but of no use. I tried it on 2017.2 , 2018.2 and 2018.3 .
    Scripting runtime version is 4x equivalent and Scripting backend is Mono.

    I am using nakama for multiplayer but after doing some research I found that this is something related to Unity only.

    please help.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Can you paste more log? Alternatively try enable stacktrace logging to full (in PlayerSettings), maybe it will print a stacktrace from where it tries to access kernel32, though this is a window library.
     
  3. Polo07

    Polo07

    Joined:
    Sep 10, 2018
    Posts:
    6

    Logs are as followed:

    Code (CSharp):
    1. 12-18 12:08:55.933 28228 28461 E Unity   : Unable to find Kernel32
    2. 12-18 12:08:56.168  1135  1135 I DeviceIdleController: updateChargingLocked: charging=true
    3. 12-18 12:08:56.168  1135  1135 I DeviceIdleController: becomeActiveLocked, reason = charging
    4. 12-18 12:08:56.172  6462  6462 D AbstractProcessor: onBatteryChange Percent:56 State:2
    5. 12-18 12:08:56.425 28228 28242 I Unity   : shot no.15ball in pocket set to inpocketThisTurn
    6. 12-18 12:08:56.425 28228 28242 I Unity   :  #0 0xdff8627c (libunity.so) ? 0x46727c
    7. 12-18 12:08:56.425 28228 28242 I Unity   :  #1 0xe051ba7c (libunity.so) ? 0x9fca7c
    8. 12-18 12:08:56.425 28228 28242 I Unity   :  #2 0xe02023b8 (libunity.so) ? 0x6e33b8
    9. 12-18 12:08:56.425 28228 28242 I Unity   :  #3 0xe02022c0 (libunity.so) ? 0x6e32c0
    10. 12-18 12:08:56.425 28228 28242 I Unity   :
    11. 12-18 12:08:56.425 28228 28242 I Unity   : (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    12. 12-18 12:08:56.425 28228 28242 I Unity   :
    13. 12-18 12:08:56.425 28228 28242 I Unity   : shot no.15ball in pocket set to inpocketThisTurn
    14. 12-18 12:08:56.425 28228 28242 I Unity   :  #0 0xdff8627c (libunity.so) ? 0x46727c
    15. 12-18 12:08:56.425 28228 28242 I Unity   :  #1 0xe051ba7c (libunity.so) ? 0x9fca7c
    16. 12-18 12:08:56.425 28228 28242 I Unity   :  #2 0xe02023b8 (libunity.so) ? 0x6e33b8
    17. 12-18 12:08:56.425 28228 28242 I Unity   :  #3 0xe02022c0 (libunity.so) ? 0x6e32c0

    in this
    Code (CSharp):
    1. shot no.15ball in pocket set to inpocketThisTurn
    is just a dubug logs in unity.
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900

    No idea what 'shot no.15ball in pocket set to inpocketThisTurn' is . Still it's not clear where Kernel32 is being accessed. Did you really enable stacktrace logging to Full?
     
  5. Polo07

    Polo07

    Joined:
    Sep 10, 2018
    Posts:
    6

    'shot no.15ball in pocket set to inpocketThisTurn' was my logs . I was trying to check something else as well. Anyways I removed all my custom logs and now posting new logs .

    Code (CSharp):
    1. 12-20 13:09:02.216 10357 10778 E Unity   : Unable to find Kernel32
    2. 12-20 13:09:02.598   624   624 I MSM-irqbalance: Decided to move IRQ240 from CPU3 to CPU1
    3. 12-20 13:09:02.734  5249  6175 D PhoneInterfaceManager: [PhoneIntfMgr] getDataEnabled: subId=1 phoneId=0
    4. 12-20 13:09:02.734  5249  6175 D PhoneInterfaceManager: [PhoneIntfMgr] getDataEnabled: subId=1 retVal=true
    5. 12-20 13:09:02.736  4539  5327 D TelephonyManager: getDataEnabled: retVal=true
    6. 12-20 13:09:02.747  5249 15573 D PhoneInterfaceManager: [PhoneIntfMgr] getDataEnabled: subId=1 phoneId=0
    7. 12-20 13:09:02.748  5249 15573 D PhoneInterfaceManager: [PhoneIntfMgr] getDataEnabled: subId=1 retVal=true
    8. 12-20 13:09:02.751  4539  5327 D TelephonyManager: getDataEnabled: retVal=true
    Also by "enable stacktrace logging to Full" means making logging in player setting to full right? I have attached a screenshot of player setting Logging as well.

    Please tell me if I am missing something here.
     

    Attached Files:

  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Yes, that's correct. Maybe you're not using Development player then ? I think stacktrace resolving doesn't work in NonDevelopment player
     
  7. Polo07

    Polo07

    Joined:
    Sep 10, 2018
    Posts:
    6

    ok I tried this on development build and here are the logs:

    Code (CSharp):
    1. I/Unity   ( 1944): (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    2. I/Unity   ( 1944):
    3. E/Unity   ( 1944): javax.net.ssl.SSLHandshakeException: Connection closed by peer
    4. E/Unity   ( 1944):  #0 0xe1447474 (libunity.so) GetStacktrace(int) 0x44
    5. E/Unity   ( 1944):  #1 0xe1ff33ac (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x230
    6. E/Unity   ( 1944):  #2 0xe1f088a4 (libunity.so) TransportAndroid::ErrorCallback(void*, void*, long long, int, void*) 0x114
    7. E/Unity   ( 1944):
    8. E/Unity   ( 1944): (Filename: /Users/builduser/buildslave/unity/build/Platforms/Android/Modules/UnityWebRequest/Transports/TransportAndroid.cpp Line: 451)
    9. E/Unity   ( 1944):
    10. E/Unity   ( 1944): javax.net.ssl.SSLHandshakeException: Connection closed by peer
    11. E/Unity   ( 1944):  #0 0xe1447474 (libunity.so) GetStacktrace(int) 0x44
    12. E/Unity   ( 1944):  #1 0xe1ff33ac (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x230
    13. E/Unity   ( 1944):  #2 0xe1f088a4 (libunity.so) TransportAndroid::ErrorCallback(void*, void*, long long, int, void*) 0x114
    14. E/Unity   ( 1944):
    15. E/Unity   ( 1944): (Filename: /Users/builduser/buildslave/unity/build/Platforms/Android/Modules/UnityWebRequest/Transports/TransportAndroid.cpp Line: 451)
    16. E/Unity   ( 1944):
    17. D/Unity   ( 1944): Unable to lookup library path for 'Kernel32', native render plugin support disabled.
    18. E/Unity   ( 1944): Unable to find Kernel32
    19. I/Unity   ( 1944):

    unfortunately there are no other logs . I have enabled development build from build settings as well.
     
  8. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    You probably have a [DllImport("kernel32")] import somewhere which is not guarded by #ifdef.
     
  9. Piflik

    Piflik

    Joined:
    Sep 11, 2011
    Posts:
    292
    I get the exact same message in my logcat. I am currently on 2018.3.0f2. I don't know if it happened earlier.

    I do have some kernel32.dll (and user32.dll) imports in my code, but they are all behind #if UNITY_STANDALONE_WIN

    I can add to the information by @Polo07 that the two lines are not from the main thread. The thread in question doesn't post anything else to the log. Besides this and the main thread I only see the graphics thread posting about framebuffers and some shader issues.

    Code (CSharp):
    1.  
    2. 01-08 16:51:53.312 19688 19729 I Unity   : //some stuff I log
    3. 01-08 16:51:53.442 19688 20072 D Unity   : Unable to lookup library path for 'Kernel32', native render plugin support disabled.
    4. 01-08 16:51:53.442 19688 20072 E Unity   : Unable to find Kernel32
    5. 01-08 16:51:53.652 19688 19729 I Unity   : //some more stuff I log
    6.  
     
  10. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Interesting.

    Still, I can't see any other way of trying to import kernel32 besides from something in the code doing dllimport.
     
  11. Polo07

    Polo07

    Joined:
    Sep 10, 2018
    Posts:
    6
    @Piflik were you able to find any solution to this?? I found out that if I use
    Code (CSharp):
    1. api compatibility level to .Net Standard 2.0
    then the message "Unable to find Kernel32" is not printing but socket still gets disconnected frequently without logs.

    Also I deleted all library apart from nakama and json.Net(Newtonsoft) , but still the problem persists.
     
  12. Piyush300

    Piyush300

    Joined:
    Jun 5, 2017
    Posts:
    1
    @Polo07 i am facing same issue, did you find any solution?
     

    Attached Files:

  13. JJJJJJJJJJJJJJR

    JJJJJJJJJJJJJJR

    Joined:
    Sep 13, 2021
    Posts:
    1
    I had the same problem, how did you solve it?