classpath 'com.android.tools.build:gradle:1.3.0'
build.gradle:
android {
compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "com.example.andhotfixex" minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }
buildTypes {
release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }
}
applicationVariants.all { variant ->
variant.dex.dependsOn << processWithJavassist // 在执行dx命令之前将代码打入到class中 }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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:23.0.1' testCompile 'junit:junit:4.12' compile project(':hotfixlib')
compile project(':hackdex')
}
报的关键错误:
org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> tag requires viewportWidth > 0
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.andhotfixex/com.example.andhotfixex.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f02004f
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f02004f
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
Android Studio
Gradle
Apache Groovy
Android
你用的哪个热修复框架,就去看下他们的文档,应该是会有支持版本的信息。
如果低版本不支持热修复,那你就在代码判断版本是否执行热修复就好了