1. 程式人生 > >Unity專案匯出AndroidStudio打包出錯

Unity專案匯出AndroidStudio打包出錯

apk是可以正常打包,但是…在手機上執行的時候會出現以下錯誤。
報錯:

your hardware does not support this application,sorry!

= = 然後又是一通google,百度…幾番嘗試無果…
後來仔細查詢Log發現是進入不了Unity介面。出現錯誤。

Unable to find main (Error) 

又是經過一番查詢…可算是解決了…萬能的google…
這個好像是因為so檔案出現的錯誤。
我的專案中只用到了armeabi-v7a。當接入其他sdk的時候會包含其他的so檔案。

解決方案(一):
首先找到問題答案連結:Unable to find main (Error)


在gradle中新增:
意思是隻用armeabi-v7a 打包apk。

android{
    splits {

        // Configures multiple APKs based on ABI.
        abi {

            // Enables building multiple APKs per ABI.
            enable true

            // By default all ABIs are included, so use reset() and include to specify that we only
            //
want APKs for x86, armeabi-v7a, and mips. // Resets the list of ABIs that Gradle should create APKs for to none. reset() // Specifies a list of ABIs that Gradle should create APKs for. include "armeabi-v7a" } } }