{"id":2148,"date":"2018-01-30T08:37:05","date_gmt":"2018-01-30T08:37:05","guid":{"rendered":"http:\/\/blog.zhukunqian.com\/?p=2148"},"modified":"2018-01-30T08:37:05","modified_gmt":"2018-01-30T08:37:05","slug":"unity-install-location%e6%9c%80%e5%a5%bd%e8%ae%be%e7%bd%ae%e4%b8%baautomatic","status":"publish","type":"post","link":"https:\/\/blog.zhukunqian.com\/?p=2148","title":{"rendered":"unity install location\u6700\u597d\u8bbe\u7f6e\u4e3aAutomatic"},"content":{"rendered":"<p>Unity install location\uff0c\u6839\u636e unity \u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/docs.unity3d.com\/Manual\/class-PlayerSettingsAndroid.html<\/p>\n<pre class=\"brush: bash; gutter: true\">Install Location \tSpecifies application install location on the device (for detailed information, refer to Android Developer documentation on install locations.\r\n        Automatic \tLet the operating system decide. User will be able to move the app back and forth.\r\n        Prefer External \tInstall the application to external storage (SD card) if possible. The operating system does not guarantee it; if not possible, the app will be installed to internal memory.\r\n        Force Internal \tForce the application to be installed to internal memory. The user will be unable to move the app to external storage.<\/pre>\n<p>\u9879\u76ee\u7ec4\u6700\u521d\u9009\u62e9\u7684\u662f Prefer External\uff0c\u672c\u610f\u662f\u60f3\u5c3d\u91cf\u5b89\u88c5\u5728SD\u5361\u4e0a\uff0c\u4e0d\u5360\u7528\u73a9\u5bb6\u624b\u673a\u5185\u5b58\u50a8\u3002<\/p>\n<p>\u4eca\u5929\u5728\u4e00\u53f0\u624b\u673a\u4e0a\uff0c\u7a0b\u5e8f\u6b7b\u6d3b\u5b89\u88c5\u4e0d\u4e0a\u53bb\uff0c\u6293\u5230Log\uff1a<\/p>\n<pre class=\"brush: bash; gutter: true\">01-30 15:17:33.801 3109-3242\/? D\/PackageManager: return install result to caller: 1141892560\r\n\r\n01-30 15:17:33.801 3109-3242\/? D\/PackageManager: returnCode: -18<\/pre>\n<p>\u627e\u5230PackageManager.java\u7684\u6e90\u7801:https:\/\/android.googlesource.com\/platform\/frameworks\/base\/+\/534a67c\/core\/java\/android\/content\/pm\/PackageManager.java<\/p>\n<pre class=\"brush: bash; gutter: true\">    \/\/ ------ Errors related to sdcard\r\n    \/**\r\n     * Installation return code: this is passed to the {@link IPackageInstallObserver} by\r\n     * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if\r\n     * a secure container mount point couldn&#039;t be accessed on external media.\r\n     * @hide\r\n     *\/\r\n    public static final int INSTALL_FAILED_CONTAINER_ERROR = -18;<\/pre>\n<p>\u7136\u540e\u5728google\u4e0a\u641c\u7d22 INSTALL_FAILED_CONTAINER_ERROR<br \/>\nhttp:\/\/www.cnblogs.com\/lovecode\/articles\/3658211.html<\/p>\n<p>https:\/\/stackoverflow.com\/questions\/5744298\/what-does-this-mean-failure-install-failed-container-error<\/p>\n<p>\u83b7\u5f97\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n\r\nChange the install location from\r\n\r\nandroid:installLocation=&quot;preferExternal&quot;\r\n\r\ninto\r\n\r\nandroid:installLocation=&quot;auto&quot;\r\n\r\nin your project&#039;s AndroidManifest.xml.<\/pre>\n<p>\u4fee\u6539\u540e\u91cd\u65b0\u51fa\u5305\uff0c\u5b89\u88c5\uff0c\u6210\u529f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unity install location\uff0c\u6839\u636e unity \u5b98\u65b9\u6587\u6863\uff1ahtt &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/blog.zhukunqian.com\/?p=2148\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts\/2148"}],"collection":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2148"}],"version-history":[{"count":1,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts\/2148\/revisions"}],"predecessor-version":[{"id":2149,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts\/2148\/revisions\/2149"}],"wp:attachment":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}