2
回答
学习着网上的android热修复技术自己写了了测试的,在高版本手机可以成功运行,可是在低版本api18下运行报错,提示:invalid drawable tag vector 错误,google了很多资料,总是找不到原因
注册华为云得mate10,2.9折抢先购!>>>   
用的gradle版本是:
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




举报
jiaming_
发帖于1年前 2回/769阅
顶部