{"__v":16,"_id":"548906c7c178b40b00aa3075","category":{"__v":5,"_id":"54890012f291f61400c02d36","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["54890033f291f61400c02d37","548906c7c178b40b00aa3075","548959f053c7810b0090a058","54895c8dfd3e570b00658fa7","54895e2a960cdf0b00f86570"],"reference":false,"createdAt":"2014-12-11T02:23:14.048Z","from_sync":false,"order":6,"slug":"build-run","title":"Build & Run"},"project":"543b9b0065bf840e00b473d5","user":"543b9aa865bf840e00b473d1","version":{"__v":11,"_id":"543b9b0065bf840e00b473d8","project":"543b9b0065bf840e00b473d5","createdAt":"2014-10-13T09:27:28.467Z","releaseDate":"2014-10-13T09:27:28.467Z","categories":["543b9b0065bf840e00b473d9","543b9ef065bf840e00b473e0","54890012f291f61400c02d36","54890902f291f61400c02d3e","54890c43f291f61400c02d44","54890d71c178b40b00aa3086","5508125c0c4d8c19008a5f83","55094050961f17170070abbd","550945111c38c50d006118ad","550a4c2e42fff40d00ae6049","55221c074801a40d00a77610"],"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2014-12-11T02:51:51.707Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"settings":"","try":true,"auth":"never","params":[],"url":""},"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Android SDK Required\",\n  \"body\": \"Follow the basic [list of steps](http://docs.unity3d.com/Manual/android-sdksetup.html) by Unity to setup your Android device first.\"\n}\n[/block]\n\n[block:embed]\n{\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fry8ozjN72Dk%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dry8ozjN72Dk%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fry8ozjN72Dk%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\",\n  \"url\": \"https://www.youtube.com/watch?v=ry8ozjN72Dk&feature=youtu.be\",\n  \"title\": \"Android App - Tutorial #10\",\n  \"favicon\": \"https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico\",\n  \"image\": \"https://i.ytimg.com/vi/ry8ozjN72Dk/hqdefault.jpg\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Get the Android SDK first\"\n}\n[/block]\nAre you encountering an issue regarding unity asking for the SDK root folder when building an Android app? Follow the [list of steps to setup your Android device](http://docs.unity3d.com/Manual/android-sdksetup.html) first.\n\nWe're running windows 7 and Mac. Here's a brief summary of how we fixed it on our Windows 7 computer. \n\nThe SDK default folder is this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"C:\\\\Users\\\\DemoAccount123\\\\AppData\\\\Local\\\\Android\\\\sdk\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/Hq4qNpbSRCfBWMp2zTEa\",\n        \"folder.jpg\",\n        \"800\",\n        \"600\",\n        \"#94aac8\",\n        \"\"\n      ],\n      \"caption\": \"SDK Folder\"\n    }\n  ]\n}\n[/block]\nMake sure your unity has the correct SDK root folder path by modifying unity preferences:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Put in your android sdk folder path on this menu:\\nUnity -> Edit -> Preferences -> External tools\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/hAkeeIKTYGzNeIHTvUL4\",\n        \"inside-unity.jpg\",\n        \"800\",\n        \"600\",\n        \"#121112\",\n        \"\"\n      ],\n      \"caption\": \"Edit > Preferences > External Tools\"\n    }\n  ]\n}\n[/block]\nAfter checking that you have the correct path, go to that folder and you should see an executable called \"Android SDK Manager\". Run it.\n\nNow make sure you have installed all the essential and latest packages.\n\nAlso, make sure you have the JDK installed. (If you haven't already)\n\nAfter updating everything, try to build the .apk again.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/214CfUGShqHOtUZb8Uli\",\n        \"install.jpg\",\n        \"800\",\n        \"600\",\n        \"#865a5e\",\n        \"\"\n      ],\n      \"caption\": \"Android SDK Manager\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Next, build and run\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/1kkD0J8fSeoBJtENMJK5\",\n        \"unity-android-app-development.jpg\",\n        \"562\",\n        \"607\",\n        \"#d69895\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n1. Open the Starter Kit in Unity. If you haven't already, import NGUI in a new empty scene, not directly in the Game.unity scene (throws a few internal NGUI specific errors otherwise). Safer to apply this to importing 2D ToolKit as well.\n\n2. Connect your Android device to your computer. If you haven't already, check that the Android SDK is properly installed. ([See how](http://docs.unity3d.com/Manual/android-sdksetup.html))\n\n3. In Unity, click **File** > **Build Settings**\n\n4. Click **Android** in the Platforms list, and then the **Build and Run** button.\n\n5. Unity will build your game using the Android SDK and install on your device. The first time you build a project for Android, or if Unity later fails to locate the SDK, you will be asked to locate the folder where you installed the Android SDK. Select the root folder of the SDK installation. ([Troubleshooting](http://docs.unity3d.com/Manual/TroubleShootingAndroid.html))\n\n**Watch: **[How to submit your Unity game to the Android App Store](https://www.youtube.com/watch?v=7XA3dtVpOYA) \n\n**Recommended App Marketplaces:**\n- [Google](https://play.google.com/store/apps?hl=en)\n- [Amazon](http://www.amazon.com/mobile-apps/b?node=2350149011)\n- [Samsung](http://seller.samsungapps.com/)\n- [SlideMe](http://slideme.org/developers)\n\n[Comparison of app store performance](http://www.onepf.org/appstores/)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Exceeded the 50MB Google Play APK Upload Limit?\"\n}\n[/block]\n There is a limit for .apk files of 50MB. The complex method is using the \"Split Application Binary\" option, but it's possible the important parts of the game won't work when you split the application binary. Such as the IAP I have added, and the sound. \n\nAlternatively you can save a few MBs by splitting the APK into two uploads. Google Play recommends uploading ARMv7 and x86 APKs separately in their Advanced mode.\n\nIn Unity, the default Android player settings include both ARMv7 and x86 support in the APK- with an empty project this gives an APK of ~14.4 Mb. If you build for only x86 or only ARM the APK is ~8.4 Mb (but if you exclude x86 your game won't run or will run poorly on the new generation of Intel Android devices, eg the Nexus Player).\n\nThe setting can be found under Edit->Project Settings->Player->(Android tab in Inspector)->Other Settings->Device Filter. You can often also shave off another ~1 Mb by increasing the Stripping level, if your game allows it.\n\nReduce the download size on Google Play using this, and use the option to upload multiple APKs targeted at CPU architectures so you can cover both ARM and x86. That's how we got our demo to under 50Mbs.\n\nReference: [http://developer.android.com/google/play/publishing/multiple-apks.html](http://developer.android.com/google/play/publishing/multiple-apks.html)","excerpt":"","slug":"android-sdk","type":"basic","title":"Android"}

Android


[block:callout] { "type": "warning", "title": "Android SDK Required", "body": "Follow the basic [list of steps](http://docs.unity3d.com/Manual/android-sdksetup.html) by Unity to setup your Android device first." } [/block] [block:embed] { "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fry8ozjN72Dk%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dry8ozjN72Dk%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fry8ozjN72Dk%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>", "url": "https://www.youtube.com/watch?v=ry8ozjN72Dk&feature=youtu.be", "title": "Android App - Tutorial #10", "favicon": "https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico", "image": "https://i.ytimg.com/vi/ry8ozjN72Dk/hqdefault.jpg" } [/block] [block:api-header] { "type": "basic", "title": "Get the Android SDK first" } [/block] Are you encountering an issue regarding unity asking for the SDK root folder when building an Android app? Follow the [list of steps to setup your Android device](http://docs.unity3d.com/Manual/android-sdksetup.html) first. We're running windows 7 and Mac. Here's a brief summary of how we fixed it on our Windows 7 computer. The SDK default folder is this: [block:code] { "codes": [ { "code": "C:\\Users\\DemoAccount123\\AppData\\Local\\Android\\sdk", "language": "text" } ] } [/block] [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/Hq4qNpbSRCfBWMp2zTEa", "folder.jpg", "800", "600", "#94aac8", "" ], "caption": "SDK Folder" } ] } [/block] Make sure your unity has the correct SDK root folder path by modifying unity preferences: [block:code] { "codes": [ { "code": "Put in your android sdk folder path on this menu:\nUnity -> Edit -> Preferences -> External tools", "language": "text" } ] } [/block] [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/hAkeeIKTYGzNeIHTvUL4", "inside-unity.jpg", "800", "600", "#121112", "" ], "caption": "Edit > Preferences > External Tools" } ] } [/block] After checking that you have the correct path, go to that folder and you should see an executable called "Android SDK Manager". Run it. Now make sure you have installed all the essential and latest packages. Also, make sure you have the JDK installed. (If you haven't already) After updating everything, try to build the .apk again. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/214CfUGShqHOtUZb8Uli", "install.jpg", "800", "600", "#865a5e", "" ], "caption": "Android SDK Manager" } ] } [/block] [block:api-header] { "type": "basic", "title": "Next, build and run" } [/block] [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/1kkD0J8fSeoBJtENMJK5", "unity-android-app-development.jpg", "562", "607", "#d69895", "" ] } ] } [/block] 1. Open the Starter Kit in Unity. If you haven't already, import NGUI in a new empty scene, not directly in the Game.unity scene (throws a few internal NGUI specific errors otherwise). Safer to apply this to importing 2D ToolKit as well. 2. Connect your Android device to your computer. If you haven't already, check that the Android SDK is properly installed. ([See how](http://docs.unity3d.com/Manual/android-sdksetup.html)) 3. In Unity, click **File** > **Build Settings** 4. Click **Android** in the Platforms list, and then the **Build and Run** button. 5. Unity will build your game using the Android SDK and install on your device. The first time you build a project for Android, or if Unity later fails to locate the SDK, you will be asked to locate the folder where you installed the Android SDK. Select the root folder of the SDK installation. ([Troubleshooting](http://docs.unity3d.com/Manual/TroubleShootingAndroid.html)) **Watch: **[How to submit your Unity game to the Android App Store](https://www.youtube.com/watch?v=7XA3dtVpOYA) **Recommended App Marketplaces:** - [Google](https://play.google.com/store/apps?hl=en) - [Amazon](http://www.amazon.com/mobile-apps/b?node=2350149011) - [Samsung](http://seller.samsungapps.com/) - [SlideMe](http://slideme.org/developers) [Comparison of app store performance](http://www.onepf.org/appstores/) [block:api-header] { "type": "basic", "title": "Exceeded the 50MB Google Play APK Upload Limit?" } [/block] There is a limit for .apk files of 50MB. The complex method is using the "Split Application Binary" option, but it's possible the important parts of the game won't work when you split the application binary. Such as the IAP I have added, and the sound. Alternatively you can save a few MBs by splitting the APK into two uploads. Google Play recommends uploading ARMv7 and x86 APKs separately in their Advanced mode. In Unity, the default Android player settings include both ARMv7 and x86 support in the APK- with an empty project this gives an APK of ~14.4 Mb. If you build for only x86 or only ARM the APK is ~8.4 Mb (but if you exclude x86 your game won't run or will run poorly on the new generation of Intel Android devices, eg the Nexus Player). The setting can be found under Edit->Project Settings->Player->(Android tab in Inspector)->Other Settings->Device Filter. You can often also shave off another ~1 Mb by increasing the Stripping level, if your game allows it. Reduce the download size on Google Play using this, and use the option to upload multiple APKs targeted at CPU architectures so you can cover both ARM and x86. That's how we got our demo to under 50Mbs. Reference: [http://developer.android.com/google/play/publishing/multiple-apks.html](http://developer.android.com/google/play/publishing/multiple-apks.html)