Android 打包apk时遇到的问题

Dbdj1201 2016-08-02 09:57:45
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tyz1201.mytablayout/com.example.tyz1201.medicalsystem.ui.WelcomeActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227)

是这样的,我一开始 compileSdkVersion 23
buildToolsVersion "23.0.3" 但是添加了 compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1' 这些依赖,所以会报一个the support libraries should not use 。。。的问题,个人理解就是因为版本不一样, 所以我就把上边的改成了 compileSdkVersion 24 buildToolsVersion "24.0.1",把带23的都改成了24,但是就报了上边这个错误,不知道怎么解决这个问题,求路过的大神指点一下,谢谢!
...全文
285 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dbdj1201 2016-08-04
  • 打赏
  • 举报
回复
问题解决了,,在file 目录下的project structure 里边把combilesdkversion 改成了24,下边的targetsdkversion 也改成24,clean project,再重建,,就ok了,build,gradle里边的代码我贴出来。 apply plugin: 'com.android.application' android { compileSdkVersion 24 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.tyz1201.medicalsystem" minSdkVersion 15 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:design:24.1.1' compile 'com.android.support:cardview-v7:24.1.1' compile 'com.android.support:appcompat-v7:24.1.1' }
moonFY 2016-08-03
  • 打赏
  • 举报
回复
你buildToolsVersion 才23 引用的库不能超过23
  compile 'com.android.support:design:24.1.1'
改成:
  compile 'com.android.support:design:23.2.1'
Dbdj1201 2016-08-03
  • 打赏
  • 举报
回复
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.tyz1201.fors" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile files('libs/volley.jar') compile 'com.android.support:design:24.1.1' } 这是build.gradle(Model:app) 的代码,会报错的地方就是compile 'com.android.support:design:24.1.1',不加这个依赖可以打包apk,加了这个就生成不了apk文件了,但是这个依赖我需要加,这怎么办。。
adfldk 2016-08-02
  • 打赏
  • 举报
回复
1, 直接这样改恐怕不行 2, 尝试楼上方法倒是可行
IT_ZJYANG 2016-08-02
  • 打赏
  • 举报
回复
楼主如果之前有成功运行过别的项目的话,可以试试新建一个项目,什么都不做,如果能运行,就根据你新建的项目的gradle的版本和设置去相应地更改你当前报错的这个项目

80,359

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧