Search code examples
androidunity-game-engineandroid-emulator

Unity build error. [Failed to install the following Android SDK packages as some licences have not been accepted. ]


After I carried out some commands below on terminal to test my unity app with android emulators. My Unity project started failing build over and over again due to the same error in the pics below. If there is anybody who are familiar with this issue, would you give me advice to address it?

The command I carried out on terminal

1, export PATH=$PATH:/Users/userName/Library/Android/sdk/platform-tools

2, echo PATH=$PATH: /Users/userName/Library/Android/sdk

3, cd /Users/userName/Desktop/AppName.apk

4, adb install AppName.apk

The details of the error

enter image description here

enter image description here


Solution

  • For people who may face the same errors in the future,

    The problem was there is no licences file in /Users/username/Desktop/2019.2.9f1/PlaybackEngines/AndroidPlayer/SDK.

    So I copied the file from /Users/username/Library/Android/sdk and paste it to the unity directory above.

    The errors was successfully addressed.

    I wish nobody wasted their time anymore because of this error.