google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 402 forks source link

Gradle build error ("minifyEnabled true" and "useProguard false") #316

Open pa01xhzvksbf opened 6 years ago

pa01xhzvksbf commented 6 years ago

When using this Gradle build setting causes an error.

Execution failed for task ':transformClassesWithNewClassShrinkerForRelease'.
> ProGuard configuration parser error: [path]/proguard.txt line 5:27 no viable alternative at input ','

When looking into the proguard file, 5:27 stands out: -keepclasseswithmembernames,includedescriptorclasses class com.google.ar.** {

buildTypes {
    debug {
        minifyEnabled true
        useProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
        jniDebuggable true
    }
    release {
        minifyEnabled true
        useProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
        signingConfig signingConfigs.release
    }
}

Although it is another plug-in, there was a case that similar problem was solved by fixing proguard.txt. Please refer. https://github.com/mapbox/mapbox-plugins-android/issues/541

pablisho commented 6 years ago

Hi thanks for the report. I added it to our internal tracker to fix it for next releases.

pa01xhzvksbf commented 6 years ago

Thank you for confirmation. We are waiting for the next release.

avirodov commented 6 years ago

Hello. This seems similar to this issue with play services. It seems that the built-in shrinker doesn't support the "includedescriptorclasses" clause.

  1. Can you please try to set "useProguard true" and see if this solves your issue?
  2. If it does, is there a reason you are explicitly disabling proguard? Just for my understanding of the usecase.
pa01xhzvksbf commented 6 years ago

Build succeeds by setting "useProguard true". However, when "useProguard true" is specified, the display classes such as error logs are obfuscated, making it difficult to debug.

Thanks.

chaosemer commented 5 years ago

As setting "useProguard true" fixing the issue, I'm going to mark this as a feature request.