Apk未在真实设备中安装



我已经用基本默认活动开始了我的新android项目。它在模拟器中运行良好应用程序无法安装错误在prelolipop设备和以上lolipop的设备应用程序将安装,但当我尝试打开应用程序时,它将关闭

有人能帮助解决这个问题吗?

构建.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.myapp.myapplication"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

您的代码很好,我猜您的APK不是完全构建的

构建您的APK:

  1. 在Android Studio上单击构建
  2. 然后单击构建APK

之后搜索您的调试APK并将其安装在您的设备上

如果失败,您可以尝试ADB,查看以下安装和使用指南:

  • 如何在windows 上安装

  • 如何使用ADB 安装apk

希望它能帮助

问题可能出在两件事上。

  1. 导航到"设置">"安全性",并确保选中"未知源">
  2. 确保你在电子邮件中下载了整个apk

希望这能有所帮助!

最新更新