为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

blinkingme 2015-12-12 15:20:04
Target device: huawei-h60_l11-DU2TDM14CV024755Installing APK: D:\study\workspace\android\ShareFile\app\build\outputs\apk\app-debug.apkUploading file to: /data/local/tmp/com.lhs.sharefileInstalling com.lhs.sharefileDEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.lhs.sharefile" pkg: /data/local/tmp/com.lhs.sharefileLaunching 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.LAUNCHERStarting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.lhs.sharefile/.MainActivity }Error type 3Error: 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版本升级前可以正常真机运行)
查看完整描述

1 回答

已采纳
?
lynhao

TA贡献81条经验 获得超57个赞

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试试,一般是可以的~

查看完整回答
1 反对 回复 2015-12-12
  • 1 回答
  • 0 关注
  • 3580 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号