Proguard 的 Admob Nativetemplates 错误

问题描述

我正要发布我的应用程序。我的应用程序使用以下包:

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.firebase:firebase-firestore:22.1.1'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.firebase:firebase-storage:19.2.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.android.support:recyclerview-v7:30.0.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.google.android.gms:play-services-ads:19.8.0'
implementation 'com.google.firebase:firebase-crashlytics:17.4.0'
implementation 'com.google.firebase:firebase-perf:19.1.1'
implementation project(':nativetemplates')
implementation 'com.google.firebase:firebase-core:18.0.2'

我打开了 Proguard,但一直收到连接到 nativetemplates错误

FAILURE: Build Failed with an exception.

* What went wrong:
Execution Failed for task ':nativetemplates:lint'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint,or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...
  
  Errors found:
  
  Path\nativetemplates\src\main\res\values\attrs.xml:4: Error: Resource named 'TemplateView' does not start with the project's resource prefix 'gnt_'; rename to 'GntTemplateView' ? [ResourceName]
    <declare-styleable name="TemplateView">
                       ~~~~~~~~~~~~~~~~~~~

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

我的 proguard.txt 看起来像这样:

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
 <init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

-keep public class com.google.firebase.analytics.FirebaseAnalytics {
    public *;
}

-keep public class com.google.android.gms.measurement.AppMeasurement {
    public *;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)