Abh*_*eet 3 android google-maps android-manifest
您好我在生成签名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
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的表现:
<?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>
Run Code Online (Sandbox Code Playgroud)
代码是没有错误的,即使是apk正在构建,但是当我尝试生成签名的apk时,它显示上面的错误,我在我的项目中使用谷歌地图.请帮助.
Int*_*iya 11
Gradle的Android插件允许您使用模块级build.gradle文件中的lintOptions {}块来配置某些lint选项,例如要运行或忽略的检查.
android {
...
lintOptions {
checkReleaseBuilds false
abortOnError false
ignoreWarnings true //false
}
}
Run Code Online (Sandbox Code Playgroud)
然后清洁 - 重建和运行.
将 lintOptions 设置为忽略错误或警告并不是解决此问题并等待应用程序在发布版本中崩溃的方法。
解决此问题的理想方法是确保我们在构建 APK 之前修复错误。您可以从 Android Studio ( Android Studio Main Menu > Analyze > Inspect Code) 中运行“检查代码”实用程序。选择检查范围为Whole Project并运行该实用程序。修复所有报告的错误,您应该能够构建 APK。
请注意,如果您想摆脱这个问题,就必须修复每个错误。还有一点要注意:Lint 实用程序会自动为您提供修复错误的选项(在大多数情况下)。使用您的判断来使用/不使用它们。
旁注:如果您正在使用任何自定义模块并且您可以访问源代码,请确保没有使用与您正在编译和定位的 SDK 版本相反的不推荐使用的 API。
在解决了所有潜在的导致崩溃的错误并且您仍然遇到问题之后,然后将 lintOption 设置abortOnError为false,但将选项保留checkReleaseBuilds为true,这样您就可以继续构建 APK 并在构建时仍然看到错误并根据需要修复它们.
| 归档时间: |
|
| 查看次数: |
5988 次 |
| 最近记录: |