以前没用过数据开头的包名,今天遇到了,一直报以下错误
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed /Users/x/x_project/build/app/intermediates/packaged_manifests/release/AndroidManifest.xml:2: AAPT: error: attribute 'package' in <manifest> tag is not a valid Android package name: 'com.package.x'. * 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 BUILD FAILED in 3s |
配置文件肯定是正常的,百思不解,最后找到答案是包名不能以数字开头,官方说法:
A full Java-language-style package name for the Android app. The name may contain uppercase or lowercase letters ('A' through 'Z'), numbers, and underscores ('_'). However, individual package name parts may only start with letters. While building your app into the an application package (APK), the build system uses the package attribute for two things
https://developer.android.com/guide/topics/manifest/manifest-element.html#package
原文连接:Android包名不能以数字开头
所有媒体,可在保留署名、
原文连接
的情况下转载,若非则不得使用我方内容。