当前位置: 首页 > news >正文

Unity2019.2.x 导出apk 安装到安卓Android12+及以上的系统版本 安装出现-108 安装包似乎无效的解决办法

Unity2019.2.x 导出apk 安装到安卓Android12+及以上的系统版本 安装出现-108 安装包似乎无效的解决办法

导出AndroidStudio工程后 需要设置

build.gradle文件

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAINbuildscript {repositories {google()jcenter()}dependencies {classpath 'com.android.tools.build:gradle:4.1.0' //最低这个
}
}allprojects {repositories {google()jcenter()flatDir {dirs 'libs'}}
}apply plugin: 'com.android.application'dependencies {implementation fileTree(dir: 'libs', include: ['*.jar'])
}android {compileSdkVersion 34   //必须这个buildToolsVersion '30.0.2' //可选这个compileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}defaultConfig {minSdkVersion 16targetSdkVersion 34 //必须这个applicationId 'com.hemiao.mycabin'ndk {abiFilters 'armeabi-v7a', 'arm64-v8a'}versionCode 1versionName '1.0'}lintOptions {abortOnError false}aaptOptions {noCompress = ['.unity3d', '.ress', '.resource', '.obb']ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"}signingConfigs {release {storeFile file('D:/svn-MyCabin/接GooglePay/myCabin.keystore')storePassword '123456'keyAlias 'mycabin'keyPassword '123456'}}buildTypes {debug {minifyEnabled falseuseProguard falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'signingConfig signingConfigs.releasejniDebuggable true}release {minifyEnabled falseuseProguard falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'signingConfig signingConfigs.release}}packagingOptions {doNotStrip '*/armeabi-v7a/*.so'doNotStrip '*/arm64-v8a/*.so'}bundle {language {enableSplit = false}density {enableSplit = false}abi {enableSplit = true}}
}

如果要上gp的话 还要 设置AndroidManifest.xml  增加字段android:exported="true"

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hemiao.mycabin" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal"><supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" /><application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name"><activity android:label="@string/app_name" android:exported="true" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false" android:name="com.hemiao.mycabin.UnityPlayerActivity"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter><meta-data android:name="unityplayer.UnityActivity" android:value="true" /><meta-data android:name="android.notch_support" android:value="true" /></activity><meta-data android:name="unity.build-id" android:value="dbc63be6-bb66-47ab-b2ec-b8c3198b2086" /><meta-data android:name="unity.splash-mode" android:value="0" /><meta-data android:name="unity.splash-enable" android:value="True" /><meta-data android:name="notch.config" android:value="portrait|landscape" /></application><uses-feature android:glEsVersion="0x00020000" /><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" /><uses-feature android:name="android.hardware.touchscreen" android:required="false" /><uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" /><uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

配上Proejct Setting., 注target Api 要34

http://www.lryc.cn/news/317384.html

相关文章:

  • 创建SpringCloudGateWay
  • 鸿蒙Harmony应用开发—ArkTS声明式开发(基础手势:StepperItem)
  • 游戏盾SDK是如何实现智能加速的?
  • 西井科技参与IATA全球货运大会 以AI绿动能引领智慧空港新未来
  • RPC通信原理(二)
  • Redis 淘汰策略
  • 游戏数据处理
  • Qt+FFmpeg+opengl从零制作视频播放器-14.程序Ubuntu移植
  • Go 语言中的 Cond 机制详解
  • 如何使用vue定义组件之——子组件调用父组件数据
  • 如何使用ArcGIS Pro生成带计曲线等高线
  • 蓝桥杯C++大学B组一个月冲刺记录2024/3/13
  • 计算机网络——Internet结构和ISP
  • E.接龙数列【蓝桥杯】/动态规划
  • cv2.cvtColor()将二维转化为彩色图像
  • 为什么 VSCode 不用 Qt 而要用 Electron?
  • 环信ChatroomUIKit功能详解——超详细介绍
  • 怎么读取springboot中的properties.yml配置文件里的配置值(亲测有效)
  • 18、设计模式之解释器模式(Interpreter)
  • cpp qt 一个奇怪的bug
  • 第6章:MATLAB文本数据处理进阶篇的目录 (MATLAB入门课程)
  • 软件杯 深度学习 opencv python 公式识别(图像识别 机器视觉)
  • vscode通过多个跳板机连接目标机(两种方案亲测成功)
  • C++基础复习003
  • Docker Commit提交
  • 百度现在应该怎么去做搜索SEO优化?(川圣SEO)蜘蛛池
  • 登录凭证------
  • matplotlib系统学习记录
  • 【DL】ML系统学习笔记 1
  • ffmpeg视频处理常用命令