android - Android Studio 3.2 - Instant Run 执行了完整的构建和安装,因为设备上的安装与磁盘上的本地构建不匹配
问题描述
我正在按照 youtube 上的本教程学习制作 android 键盘。我按照其中的描述进行了所有操作。我能够成功构建项目,但每当我尝试运行它时,我都会收到以下错误 -
Instant Run 执行了完整的构建和安装,因为设备上的安装与磁盘上的本地构建不匹配
所以我搜索了一个解决方案并尝试关闭 Instant Run,然后没有出现上述错误。APK 已安装到我的设备上,但是当我尝试在设置中启用键盘时,却找不到它。我在设备和 2 个模拟器中尝试过,但问题到处都是。
我不知道该怎么办。我将复制我的 Android 清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tomsapp.keeskeyboard">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service
android:name=".KeesKeyboard"
android:label="@string/app_name"
android:permission="android:permission.BIND_INPUT_METHOD">
<meta-data android:name="android.view.im" android:resource="@xml/method"/>
<intent-filter>
<action android:name="android.view.InputMethod"/>
</intent-filter>
</service>
</application>
并在此处构建 Gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.tomsapp.keeskeyboard"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
请指出我在这里做错了什么。
解决方案
在您的 build.Gradle 文件中,将 minSDK 设置为 22n,使其与您的 android 虚拟设备匹配。
推荐阅读
- c - 如何从 C 函数创建 shell 命令
- python-3.x - ImportError:没有在 python 中命名的模块
- ruby-on-rails - 如何创建一个序列化器,它返回一个没有键的哈希数组?
- ios - 呈现警报控制器后,TableView(didSelectRowAt IndexPath)中的 Swift Continue Flow
- c# - Artefact Animator 的替代品
- objective-c - Swift 或 Objective C 中枚举器和迭代器的区别
- android - 查看寻呼机未正确显示
- asp.net - 如何在 aspx 页面的 TemplateField 中添加 DataFormatString?
- docker - 如何将“npm install”集成到 ASP.NET CORE 2.1 Docker 构建中
- php - 用户通过 POST 路由提交表单后立即注销