Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 前进线编号问题_Android_Proguard - Fatal编程技术网

Android 前进线编号问题

Android 前进线编号问题,android,proguard,Android,Proguard,我和proguard有一个棘手的问题。 在我的proguard rules.pro中,我已经设置了保留行号: # Keep line numbers -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable 在我的build.gradle中,我打开了minifyEnable,debug和release: buildTypes { debug { min

我和proguard有一个棘手的问题。 在我的
proguard rules.pro
中,我已经设置了保留行号:

# Keep line numbers
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
在我的
build.gradle
中,我打开了
minifyEnable
debug
release

buildTypes {
        debug {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'google-api-client.pro'

            signingConfig signingConfigs.debug

            ndk {
                abiFilters "armeabi-v7a", "arm64-v8a"
            }
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'google-api-client.pro'

            signingConfig signingConfigs.release

            ndk {
                abiFilters "armeabi-v7a", "arm64-v8a"
            }
        }
    }
但是当我遇到崩溃时,调试输出行号是正确的,但是发布行号是错误的。以下是使用
minifyEnable
进行调试的日志,行号正确:

java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference
        at com.frontrow.vlog.ui.personalpage.PersonalPageFragment.musicClicked(SourceFile:952) // The line number is the right position at my source code.
        at com.frontrow.vlog.ui.personalpage.PersonalPageFragment_ViewBinding$e.a(SourceFile:244)
        at butterknife.internal.b.onClick(SourceFile:18)
但是,在使用
minifyEnable
的版本中,行号不正确是错误的:

java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference
        at com.frontrow.vlog.ui.personalpage.PersonalPageFragment.musicClicked(SourceFile:1) // The line number is error.
        at com.frontrow.vlog.ui.personalpage.PersonalPageFragment_ViewBinding$e.a(SourceFile:1)
        at butterknife.internal.b.onClick(SourceFile:4)

我怎样才能解决这个问题,使发布输出可以采用正确的行号?

好吧,我想这就是R8的问题。 我在
gradle.properties
中设置了
android.enableR8=false
,行号正确。 gradle版本似乎大于
3.4.0
默认情况下将打开r8