您好,生成签名的apk时出现此错误:

      Error:Execution failed for task ':app:lintVitalRelease'.
        > Lint found fatal errors while assembling a release target.
       To proceed, either fix the issues identified by lint, or modify your      build script as follows:
         ...
       android {
       lintOptions {
        checkReleaseBuilds false
          // Or, if you prefer, you can continue to check for errors in release builds,
         // but continue the build even when errors are found:
        abortOnError false
        }
       }

这是我的清单:
       <?xml version="1.0" encoding="utf-8"?>
       <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="android.OMMSoftware.Navsahydri">

       <uses-permission android:name="android.permission.INTERNET" />
       <uses-permission  android:name="android.permission.ACCESS_NETWORK_STATE"  />
       <uses-permission
       android:name="android.permission.ACCESS_FINE_LOCATION"
       android:protectionLevel="signature" />
       <uses-permission
       android:name="android.permission.ACCESS_COARSE_LOCATION"
       android:protectionLevel="signature" />

       <uses-library
       android:name="com.google.android.maps"
       android:required="true" />

       <application
        android:allowBackup="true"
        android:icon="@drawable/logo_circular"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/MyMaterialTheme">
       <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="AIzaSyDjqmmXd1d1yk7BtncDQgXSmya-NdBkc2w" />

        <activity android:name=".Splash">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        </activity>
        <activity android:name=".Home" />
        <activity android:name=".Gallery" />
        <activity android:name=".Contactus" />
        <activity android:name=".Placements"></activity>
        </application>
        </manifest>

代码是无错误的,即使apk正在构建,但是当我试图生成签名的apk时,它显示了上面的错误,我正在我的项目中使用google map。请帮助。

最佳答案

android gradle插件允许您使用模块级build.gradle文件中的lintOptions {}块配置某些lint选项,例如运行或忽略哪些检查。

  android {
  ...
  lintOptions {
            checkReleaseBuilds false
            abortOnError false
            ignoreWarnings true //false
              }
       }

然后清理重建并运行。

10-07 19:13
查看更多