Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Error on Trying to build for android

Discussion in 'Android' started by BronceDragon, Apr 1, 2018.

  1. BronceDragon

    BronceDragon

    Joined:
    Mar 27, 2018
    Posts:
    1
    Hi im working on an app for Android and work perfect in the Editor but when i try to build it it says it cant find the target platforms, i got both the java and the Android sdk and the links are correct.
     

    Attached Files:

    wolflike likes this.
  2. wolflike

    wolflike

    Joined:
    Apr 1, 2018
    Posts:
    3
    I am having the same issue. Any help would be amazing, below is my current build

    Build info:
    Unity
    - 2017.40f1
    Android Studio 3.1
    - SDK is enabled and loaded
    -Unity3d is linked to the SDK
    Java SE Dev kit 8u16
    - I downgraded from 10
    -Unity3d is linked to the SDK
     
    Last edited: Apr 1, 2018
  3. wolflike

    wolflike

    Joined:
    Apr 1, 2018
    Posts:
    3
    Update:
    Below are the 4 errors that I am getting when building for android. Thanks, in advance! Java_home error.jpg Java_home error 2.jpg Build error.jpg Build error 2.jpg
     
  4. wolflike

    wolflike

    Joined:
    Apr 1, 2018
    Posts:
    3
    After a lot of frustration, I have solved the above issues +… Below is how I did it. Hope it helps anyone who comes across this post. Good Luck!

    For windows 10 and I have added thumbnails below for a visual aide.

    JAVA_HOME Error:

    Go too ‘Environment Variables’

    - add the Variable ‘JAVA_HOME’

    - for the Value add the path too the Java JDK you are using (1.8.0_161 for me)

    - Under ‘Path’ use a semicolon ‘;’ and add the Java JDK path you used above to the end of the
    existing Value. It should look something like this: %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;D:\Program Files\Java\jdk1.8.0_161_


    Package Name Error:

    This YouTube video will walk through all you will need and a little bit more.




    Gradle Error:

    Use this Unity Manual.

    https://docs.unity3d.com/Manual/android-BuildProcess.html


    Setting up your Android phone:

    This YouTube video will walk through all you will need and a little bit more.



    Make sure Unity Remote is running when you push your build too your phone and VR building Shangri la awaits!


    -Wolflike

    Java_home fix 1 of 2.jpg Java_home fix 2 of 2.jpg
     
    Last edited: Apr 3, 2018
    enriqueflores likes this.
  5. enriqueflores

    enriqueflores

    Joined:
    Jul 25, 2014
    Posts:
    6
    you save my life!!! XD