My android app has a package name com.a.b, but I am using different appId = com.c.d in gradle as I plan to have one source code for different flavours, so many customized apps could be published to Google Play with different applicationIds but having same package name:
productFlavors {
...
production {
applicationId "com.c.d"
buildConfigField('String', 'SERVER_URL', props["production.server.url"])
buildConfigField('String', 'SERVER_NAME', props["production.server.name"])
}
}
When I launch ./gradlew :app:publishProductionRelease, I am getting an error:
> A failure occurred while executing com.github.triplet.gradle.play.tasks.GenerateEdit$Generator
> 404 Not Found
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"message" : "Package not found: com.c.d.",
"reason" : "notFound"
} ],
"message" : "Package not found: com.c.d",
"status" : "NOT_FOUND"
}
It seems it checks the real package name when trying to publish, so the question is how can I publish app using appId diffing from real package name?
This approach works fine when using Firebase App Distribution.
Also Google Play account doesn't have any app uploaded yet, I am trying to upload it for the first time using GPP.
Versions
- Gradle Play Publisher: 2.7.3
- Gradle Wrapper: 6.2
- Android Gradle Plugin: 3.6.2
Log retrieved by launching with --info key:
-------------- REQUEST --------------
POST https://www.googleapis.com/androidpublisher/v3/applications/com.c.d/edits
Accept-Encoding: gzip
Authorization: <Not Logged>
User-Agent: gradle-play-publisher Google-API-Java-Client/1.30.9 Google-HTTP-Java-Client/1.34.2 (gzip)
x-goog-api-client: gl-java/1.8.0 gdcl/1.30.9 mac-os-x/10.15.5
Content-Encoding: gzip
curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: <Not Logged>' -H 'User-Agent: gradle-play-publisher Google-API-Java-Client/1.30.9 Google-HTTP-Java-Client/1.34.2 (gzip)' -H 'x-goog-api-client: gl-java/1.8.0 gdcl/1.30.9 mac-os-x/10.15.5' -H 'Content-Encoding: gzip' -d '@-' -- 'https://www.googleapis.com/androidpublisher/v3/applications/com.c.d/edits' << $$$
-------------- RESPONSE --------------
HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
Alt-Svc: h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Server: ESF
X-Content-Type-Options: nosniff
Content-Encoding: gzip
Vary: Referer
Vary: X-Origin
Vary: Origin
X-XSS-Protection: 0
Date: Wed, 22 Jul 2020 09:54:13 GMT
Content-Type: application/json; charset=UTF-8
Total: 276 bytes
{
"error": {
"code": 404,
"message": "Package not found: com.c.d.",
"errors": [
{
"message": "Package not found: com.c.d.",
"domain": "global",
"reason": "notFound"
}
],
"status": "NOT_FOUND"
}
}
My android app has a package name
com.a.b, but I am using different appId =com.c.din gradle as I plan to have one source code for different flavours, so many customized apps could be published to Google Play with different applicationIds but having same package name:When I launch
./gradlew :app:publishProductionRelease, I am getting an error:It seems it checks the real package name when trying to publish, so the question is how can I publish app using appId diffing from real package name?
This approach works fine when using Firebase App Distribution.
Also Google Play account doesn't have any app uploaded yet, I am trying to upload it for the first time using GPP.
Versions
Log retrieved by launching with
--infokey: