2017-08-29 132 views
0

我已经开始我的新的Android项目与基本的默认Activity.IT在模拟器中运行良好。我试图安装iy在实际设备上pre lolipop和abovr lolipop设备,但得到错误 应用程序不能在prelolipop设备和以上lolipop设备应用程序安装错误将安装,但是当我尝试打开应用程序将关闭Apk没有安装在真实设备

任何人可以帮助如何解决这个问题?

的build.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' 
} 
+0

Post crash LogCat .. – AlexTa

+0

我可以看到确切的错误消息 – MrAppMachine

+0

当点击安装应用程序时,它会显示错误,因为X应用程序未安装 – iCoders

回答

2

你的代码是正确的,我的猜测是,你APK没有完全建立

建立你的APK:

  1. 在Android工作室点击Build
  2. 然后点击生成APK(S)

该搜索为您调试APK后,如果失败,你可以尝试ADB设备

上安装它,看看在对安装和使用以下指南:

希望它可以帮助

+0

你节省了我的时间。为新来者提供了很好的建议。非常感谢 – iCoders

0

有两件事可能是问题。

  1. 导航到设置>安全性并确保选中未知来源。
  2. 请务必在电子邮件中下载完整的APK

希望这有助于!