【发布时间】:2018-06-15 11:07:27
【问题描述】:
真的很奇怪,我创建了一个新的空项目,然后我将文件设置 compileSdkVersion 从 27.1 Oreo 更改为 android-P,然后我将应用程序重构为 AndroidX,如果我在模拟器上运行它或通过 adb connect with 运行它,它工作正常我的设备。但是当我尝试构建 apk 并将其安装在我的手机上时,会出现问题 - “未安装应用程序”。但在我更改 compileSdkVersion apk 之前安装正常。
清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.scapegoats.myapplicationmmmm">
<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">
<activity
android:name=".main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
分级:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "ru.scapegoats.myapplication"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-alpha3'
implementation 'com.google.android.material:material:1.0.0-alpha3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
}
【问题讨论】:
-
清理项目并构建apk
-
您要安装哪个操作系统版本的 APK?
-
4.4.2 kitkat 超过 minsdk
-
清洁没有帮助
-
可能是 AS 3.2 预览的问题?
标签: android