2017-08-29 139 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

希望這有助於!