Search Unity

Xiaomi build error

Discussion in 'Xiaomi' started by moldywarpe, Jul 24, 2018.

  1. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    31
    Hi,
    I'm attempting to build for Xiaomi for the first time and are getting the below errors referencing Xiaomi.
    I have added Xiaomi standalone SDK by adding the Xiaomi Mi Game Center in the build settings and can see this has been added in the Package Manager (Xiaomi SDK v1.0.2).

    I have also added the AppStoreSettings as per the guide here - https://unity3d.com/cn/partners/xiaomi/guide

    As the application does not use IAP I have also tried removing the IAP package from the application (as this post by @unityjingyao indicated that the standalone SDK was already included with IAP - https://forum.unity.com/threads/xia...s-defined-multiple-times.510042/#post-3350290) however this did not have any effect.

    The application runs fine in the editor.

    The errors relate to missing references however I assumed that the standalone SDK would have catered for these. I'm using Unity 2018.1.7f1.

    Has anybody come across this error or have any ideas where to look (have already scoured the net...) to resolve this problem?

    Cheers,
    moldywarpe

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreOnboardApi.cs(7,19): error CS0234: The type or namespace name `Connect' does not exist in the namespace `UnityEditor'. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreOnboardApi.cs Line: 7)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(4,19): error CS0234: The type or namespace name `Connect' does not exist in the namespace `UnityEditor'. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 4)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(15,40): error CS0246: The type or namespace name `Editor' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 15)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(61,17): error CS0246: The type or namespace name `SerializedProperty' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 61)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(62,17): error CS0246: The type or namespace name `SerializedProperty' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 62)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(63,17): error CS0246: The type or namespace name `SerializedProperty' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 63)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(65,17): error CS0246: The type or namespace name `SerializedProperty' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 65)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(66,17): error CS0246: The type or namespace name `SerializedProperty' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 66)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(67,17): error CS0246: The type or namespace name `SerializedProperty' could not be found. Are you missing an assembly reference?
    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 67)

    C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs(88,30): error CS0115: `AppStoresSupport.AppStoreSettingsEditor.OnInspectorGUI()' is marked as an override but no suitable method found to override

    (Filename: C:/Users/moldywarpe/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xiaomi@1.0.2/XiaomiSupport/Editor/AppStoreSettingsEditor.cs Line: 88)

    DisplayProgressNotification: Build Failed
    Error building Player because scripts had compiler errors
     
  2. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
  3. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    31
    Hi @unityjingyao ,
    Excellent - that has allowed me to progress...

    However I had to make a change to MiCamera @ line 356 which was using an obsolete method as follows:
    //cam.hdr = VrManager.Instance.IsHdrEnabled; *Removed as Camera no longer has a hdr field since 5.4*
    cam.allowHDR = VrManager.Instance.IsHdrEnabled; // Current method to set HDR

    Which overcame the compilation errors however... now getting the following near the end of the build process
    Duplicate file(s) in apk: 'C:\Unity\application_MiVR\Temp\StagingArea\android-libraries\OVRPlugin\libs'

    This doesn't occur on non-Xiaomi builds.
     
  4. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi @moldywarpe ,
    We've addressed the Xiaomi Mi Game Center compile issue and we'll release a new version soon.
    It's an issue in the Xiaomi package in PackageManager. We missed an 'asmdef' file in 'XiaomiSupport/Editor', which leading Unity Editor to compile the C# code in the 'Editor' folder when building an apk file.

    You can find more information about 'asmdef' on these pages below.
    https://blogs.unity3d.com/cn/2017/1...assembly-definition-files-and-transform-tool/
    https://docs.unity3d.com/2017.3/Documentation/Manual/ScriptCompilationAssemblyDefinitionFiles.html

    Thanks again for reporting the issue!

    Regarding the MiCamera issue, I'm sorry that I've never used this SDK. Please contact Xiaomi tech support for help.
     
  5. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    31
    Hi @unityjingyao
    Thanks! The issue related to Duplicate file(s) in APK *eventually* turned out to be caused by my inclusion of the Oculus SDK within the XR settings, SDK list. Removing this allowed the app to build, however I am unsure whether:
    • the VR SDK list should be left empty
    • set as none or
    • have Virtual Reality Supported left unchecked
    e.g.

    Any suggestions?

    So the app now builds and can be installed on the headset however it is throwing
    java.lang.SecurityException: Permission Denied
    and then crashing even after accepting all application permissions at startup???

    Also the following is found within the logcat:
    VRService: Checking permission failed in product mode

    Do you know what this means or are you aware of any issues in this area?
     
    Last edited: Jul 25, 2018
  6. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    31
    Further to the issue related to Permission Denied we created a test project containing only the sample scene provided in the MiVR VR SDK for Unity 1.8.5, switched platforms from x86 to Android, built and deployed to the MiVR standalone headset yet this sample also threw a : java.lang.SecurityException: Permission Denied
    Again all app permissions were granted.

    We cannot progress further with this integration to Xiaomi unless we get a resolution.
    Is this a bug with the SDK?
     
  7. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi @moldywarpe ,
    I'm sorry that I have no idea about Xiaomi VR, but I do find a developer who also got this issue.
    You got this issue because you haven't put the signature file in your project.
    You can get the signature file via your device serial number on this page: http://dev.xiaomi.com/vr/signature/index
    a) For Unity app, the signature file should be saved to "Project/Assets/Plugins/Android/assets/MiVR_sig/".
    b) For Android native app, the signature file should be saved to "Project/Assets/MiVR_sig/ ".

    This is the original post(Chinese only): http://blog.okbase.net/unity3d/archive/56670.html
    And this is the document for Xiaomi VR(Chinese only): https://dev.mi.com/console/doc/detail?pId=817
     
  8. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    31
    Ok, not so much a bug as a "lack of information" ...

    So it turns out that if using the MiVR Standalone SDK you must also create a signature file that is placed in the application assets.

    To create the signature file go to https://dev.mi.com/vr/signature/index and enter your headset serial number - I obtained using adb shell getprop and finding r0.boot.serialno

    It will download a signature file - drop it into Assets/Plugins/Android/assets/MiVR_sig (you may need to create the MiVR_sig directory), rebuild and voila no more Permission Denied when running the application.

    I do think the Xiaomi developer quick start guide - https://unity3d.com/partners/xiaomi/guide - should be updated to include this rather important requirement!
     
  9. ALTernative-MS

    ALTernative-MS

    Joined:
    Jul 10, 2013
    Posts:
    6
    How i can register dev account without a bank card opened in China's bank ?
     
  10. Drimway

    Drimway

    Joined:
    May 4, 2018
    Posts:
    4
    Hi! I just tried to push an apk (video game) to Xiaomi from Unity Cloud Build, and the Push failed. I wonder if this has been caused by any (or all) of these things:

    Unity version 2018.2.20f1

    My game doesn't need In-App-Purchases (IAP). I would like to set a buying price (is it that possible in Xiaomi, right?)

    I have added the Xiaomi Market SDK from here (https://assetstore.unity.com/packag...illing/unity-sdk-for-xiaomi-stand-alone-98044). I had it installed from the "Add" button in "Build Settings", but I have read that you recommend to install it from Asset Store.

    I have installed App Store Settings and it automatically connects with a existing project in my Unity Cloud. It seems ok, but maybe I shoud create a new blank project in Unity Cloud? By the way, the "Xiaomi App Settins" are blank, as I understand that these data are created by Xiaomi afterwards (but I don't know when or where are added -project or apk-)

    Build Settings are set to Android.

    Player settings> Publishing settings have activated "Use existing keystore" (in some places I have read that Cloud Build add its own keystores... I don't know.)

    I have uploaded the apk via Unity Website, as I don't have Unity Teams Advanced for uploading via Unity. Anyway, it is correctly updloaded.

    I am the owner of the organization that my project is under. I know this is compulsory when pushing to Xiaomi.

    I don't know if I have to create a Xiaomi account. And the https://developer.unity.mi.com/ is not working.

    And when I select "Push to Xiaomi" (in unity website or in Unity program, it works the same) I get "Push failed"...

    Thanks in advance!
     
  11. uralstuffy

    uralstuffy

    Joined:
    Nov 18, 2019
    Posts:
    1
  12. sanamonita

    sanamonita

    Joined:
    Jun 8, 2020
    Posts:
    1
    It's not occuring on Xiaomi.

    [INDENT][INDENT][COLOR=#ffffff][URL='[URL]https://www.look-movie.ag/tv-shows/[/URL]']lookmovie[/URL][/COLOR][/INDENT][/INDENT]​
     
  13. seyit25

    seyit25

    Joined:
    Sep 28, 2018
    Posts:
    13

    Hi, I want to ask a question?
    I am using 2018.2.10f1
    My android app work editor and samsung j7 phone or other phones correctly. But on Xiaomi Mi note dont work. When I examine the status; i saw StartCoroutine dont work on xiaomi phones. Why? Could you help?
     
  14. garudabhatnagar

    garudabhatnagar

    Joined:
    Jul 27, 2020
    Posts:
    1
    Yes it is working on my Huawei p30 lite but unable to process on xiomi