Search Unity

A java file uses or overrides depreciated API in Unity project (with Unity Editor 2019.4.29f1)

Discussion in 'Getting Started' started by jayw711kb, May 8, 2023.

?

Is my english poor

  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
  3. I dont have any idea about it.

    0 vote(s)
    0.0%
  1. jayw711kb

    jayw711kb

    Joined:
    Jun 28, 2021
    Posts:
    3
    Hello, everyone. I am new to Unity and NOT familar with it.

    I am using Unity Editor 2019.4.29f1.
    When I create a new empty project with Unity Editor 2019.4.29f1 which is named to TestProject_27
    (Shown in the following figures. Figure 1.) and build an Android Project, I met these errors. The first of the error tells me that the file
    "C:\Unity\TestProject_27\Packages\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java"
    uses or overrides a deprecated API.
    (Shown in the following figures. Figure 2.b)

    Figure 2.a depicts the build settings to build an Android project.

    Figure 1 (project_list_version_1.png)
    project_list_version_1.png

    Figure 2.a (build_screenshot_1.png)
    build_screenshot_1.png


    Figure 2.b (depreciate_API_2.png)
    depreciate_API_2.png

    According to the error message, I compile the file with -Xlint option with java compiler.
    (
    I typed the command in the DOS cmd prompt.
    javac -Xlint
    "C:\Unity\TestProject_27\Packages\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java"
    ).
    (
    The file UnityPlayerActivity.txt is attached to the Attached Files area. Sorry, I dont upload a .java file
    (See the following P.S. 1 for the reason)
    )
    I got these errors. Then I export the content in DOS cmd prompt into a text file, named it as "java_in_unity_error_2.txt".

    The error messages tell us that some android packages are missing.

    I dont know why they are missing.

    ----------------------------------------------------
    P.S.
    1:
    The reason why I uploaded "UnityPlayerActivity.txt" instead of "UnityPlayerActivity.java" is
    .java ext file is NOT allowed in Unity Forum.

    2:
    The reason why I dont upload the .7z file that contains all files of this project (named TestProject_27) is
    the .7z file is too large (over 1024 KB) even though I had zipped it with 7-zip manager.

    ---------------------------------------------------
    Extra NOTE:
    1:
    When I close and open the Unity project (named TestProject_27), then build Android project again.
    Then the issue dispear. (However, there are other issues. I will create other thread to discuss these issues)

    I dont know why. I think it is very strange. I hope anyone can give me explanation.

    ----------------------------------------------------
    Appreciation

    Any replies or solutions about this issue will be appreciated.

    ---------------------------------------------------
    Apology

    Finally, sorry for my poor English. My English may be poor since I am NOT a native speaker in English (I am Taiwanese.)

    Thank you for reading with your patentance.
     

    Attached Files: