Android Studio 无法再真机运行项目 模拟器上可以正常运行

Target device: huawei-h60_l11-DU2TDM14CV024755

Installing APK: D:\study\workspace\android\ShareFile\app\build\outputs\apk\app-debug.apk

Uploading file to: /data/local/tmp/com.lhs.sharefile

Installing com.lhs.sharefile

DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.lhs.sharefile"

pkg: /data/local/tmp/com.lhs.sharefile



Launching application: com.lhs.sharefile/com.lhs.sharefile.MainActivity.

DEVICE SHELL COMMAND: am start  -n "com.lhs.sharefile/com.lhs.sharefile.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.lhs.sharefile/.MainActivity }

Error type 3

Error: Activity class {com.lhs.sharefile/com.lhs.sharefile.MainActivity} does not exist.

build.gradle配置如下:

apply plugin: 'com.android.application'

android {
   compileSdkVersion 23
   buildToolsVersion "21.1.2"

   defaultConfig {
       applicationId "com.lhs.sharefile"
       minSdkVersion 10
       targetSdkVersion 21
       versionCode 1
       versionName "1.0"
   }
   buildTypes {
       release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
   dexOptions {
       incremental true
   }
   compileOptions {
       sourceCompatibility JavaVersion.VERSION_1_7
       targetCompatibility JavaVersion.VERSION_1_7
   }
}

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   compile 'com.android.support:appcompat-v7:23.1.1'
}


求大神指导 手机是 Android 4.4版本 荣耀6 Android studio 1.5版本(1.4版本升级前可以正常真机运行)

blinkingme
浏览 3581回答 1
1回答

lynhao

android {   compileSdkVersion 23   buildToolsVersion "21.1.2"   defaultConfig {       applicationId "com.lhs.sharefile"       minSdkVersion 10       targetSdkVersion 21       versionCode 1       versionName "1.0"   }你的把  targetSdkVersion 21也改成你手机api对应的版本23试试,一般是可以的~
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android