Closed hanxiaofeng closed 2 years ago
请检查是否正确加载插件: 根目录下:build.gradle app目录下:build.gradle 请检查是否正确配置打印方法: timeMethod = [ [ 'time' : 100L, 'owner': 'com/google', ] ]
请检查是否正确加载插件: 根目录下:build.gradle app目录下:build.gradle 请检查是否正确配置打印方法: timeMethod = [ [ 'time' : 100L, 'owner': 'com/google', ] ]
直接在你项目里测试的,新建了个module,build.gradle代码如下:
`plugins { id 'com.android.application' id 'miaow' }
android { compileSdk 32
defaultConfig {
applicationId "com.android.asmtest"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
miaow { //方法耗时打印 timeMethod = [ [ 'time' : 0L, 'owner': 'com/android/asmtest', ], // [ // 'time' : 100L, // 'owner': 'com/google', // ] ] }`
期望可以打印onCreate的耗时,logcat筛选System.out,但没任何打印输出
我在onMethodExit打印了下,执行到了的,但是就是没输出
通过上述的信息我没有办法帮你排查到具体问题,你可以参考README中的字节码文章。
哈喽,已经对AGP 7.0做适配,请拉取最新代码查看
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_home)
筛选execution time,onCreate和showMainName都没有输出执行时间,求解惑!