Skip to content

using separate id's for ios/android in nativescript.config #10587

Closed
NativeScript/android
#1816
@tommag21

Description

@tommag21

Issue Description

In my app I have different app identifiers for Android and iOS. After updating to Nativescript 8.8.0, Android build fails with this Gradle error:

Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'com.tns.testapplication'

Command ./gradlew failed with exit code 1

My NativeScript config:

{
  appPath: 'app',
  appResourcesPath: 'App_Resources',
  android: {
    id: "com.company.androidapp",
    v8Flags: "--nolazy --expose_gc",
    markingMode: 'none'
  },
  ios: {
    id: "com.company.iosapp",
  }
}

If i move the id to the root of the object, the build succedes.

{
  id: "com.company.androidapp",
  appPath: 'app',
  appResourcesPath: 'App_Resources',
  android: {
    v8Flags: "--nolazy --expose_gc",
    markingMode: 'none'
  }
}

Seems to me it doesn't parse correctly the NativeScript config in @nativescript/android/framework/app/build.gradle. Works fine on iOS.

{N} CLI: 8.0.0
@nativescript/core: 8.8.1
@nativescript/android": "8.8.0"

Reproduction

No response

Relevant log output (if applicable)

NativeScript build output:

(node:32723) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Preparing project...
assets by path fonts/*.ttf 2.35 MiB
  asset fonts/fa-solid-900.ttf 385 KiB [compared for emit] [from: app/fonts/fa-solid-900.ttf] [copied]
  asset fonts/SourceSans3-Regular.ttf 349 KiB [compared for emit] [from: app/fonts/SourceSans3-Regular.ttf] [copied]
  asset fonts/SourceSans3-SemiBold.ttf 349 KiB [compared for emit] [from: app/fonts/SourceSans3-SemiBold.ttf] [copied]
  + 6 assets
assets by path assets/ 279 KiB
  assets by path assets/img/*.jpg 268 KiB 3 assets
  assets by path assets/img/*.png 6.3 KiB 2 assets
  asset assets/fontello.css 3.74 KiB [compared for emit] [from: app/assets/fontello.css] [copied]
assets by path *.js 16 MiB
  asset vendor.js 11.9 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 4.09 MiB [compared for emit] (name: bundle)
  asset runtime.js 13.2 KiB [compared for emit] (name: runtime)
asset tns_modules/inspector_modules.js 1.22 KiB [compared for emit] (name: tns_modules/inspector_modules)
Entrypoint bundle 16 MiB = runtime.js 13.2 KiB vendor.js 11.9 MiB bundle.js 4.09 MiB
Entrypoint tns_modules/inspector_modules 11.9 MiB = runtime.js 13.2 KiB vendor.js 11.9 MiB tns_modules/inspector_modules.js 1.22 KiB
runtime modules 2.84 KiB 9 modules
orphan modules 4.81 KiB [orphan] 7 modules
javascript modules 5.36 MiB
  modules by path ./app/ 1.14 MiB 605 modules
  modules by path ./node_modules/ 4.21 MiB 577 modules
  + 4 modules
json modules 273 KiB
  modules by path ./node_modules/mdn-data/css/*.json 242 KiB
    ./node_modules/mdn-data/css/at-rules.json 11.6 KiB [built] [code generated]
    + 2 modules
  modules by path ./node_modules/css-tree/ 30.7 KiB
    ./node_modules/css-tree/package.json 1.65 KiB [built] [code generated]
    ./node_modules/css-tree/data/patch.json 29 KiB [built] [code generated]

WARNING in ./app/app.scss
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 10, column 4 of file:///Users/tomg/repos/myapp/node_modules/@nativescript/theme/scss/core/primitives/_headings.scss:10:4:
Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

10 |     font-weight: normal;


node_modules/@nativescript/theme/scss/core/primitives/_headings.scss 11:5  @import
node_modules/@nativescript/theme/scss/core/primitives/_index.scss 4:9      @import
node_modules/@nativescript/theme/scss/core/_index.scss 5:9                 @import
node_modules/@nativescript/theme/core.scss 8:9                             @import
app/app.scss 1:9                                                           root stylesheet

 @ ./app/app.ts 2:0-20

WARNING in ./app/app.scss
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 19, column 4 of file:///Users/tomg/repos/myapp/node_modules/@nativescript/theme/scss/core/primitives/_index.scss:19:4:
Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

19 |     font-family: sans-serif;


node_modules/@nativescript/theme/scss/core/primitives/_index.scss 20:5  @import
node_modules/@nativescript/theme/scss/core/_index.scss 5:9              @import
node_modules/@nativescript/theme/core.scss 8:9                          @import
app/app.scss 1:9                                                        root stylesheet

 @ ./app/app.ts 2:0-20

WARNING in ./app/app.scss
Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 20, column 4 of file:///Users/tomg/repos/myapp/node_modules/@nativescript/theme/scss/core/primitives/_index.scss:20:4:
Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

20 |     font-size: const(font-size);


node_modules/@nativescript/theme/scss/core/primitives/_index.scss 21:5  @import
node_modules/@nativescript/theme/scss/core/_index.scss 5:9              @import
node_modules/@nativescript/theme/core.scss 8:9                          @import
app/app.scss 1:9                                                        root stylesheet

 @ ./app/app.ts 2:0-20

webpack 5.93.0 compiled with 3 warnings in 4235 ms
Webpack compilation complete.
Updating runtime package.json with configuration values...
Project successfully prepared (android)
Building project...
Gradle build...
         + applying user-defined configuration from /Users/tomg/repos/myapp/App_Resources/Android/before-plugins.gradle
         + applying user-defined buildscript from dependency /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-core/platforms/android/buildscript.gradle
         + applying user-defined buildscript from dependency /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-crashlytics/platforms/android/buildscript.gradle
         + applying user-defined buildscript from dependency /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-messaging-core/platforms/android/buildscript.gradle
         + applying user-defined configuration from /Users/tomg/repos/myapp/App_Resources/Android/before-plugins.gradle
         + setting applicationId
         + applying user-defined configuration from /Users/tomg/repos/myapp/App_Resources/Android/app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript-community/ui-image/platforms/android/ui_image.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/core/platforms/android/core.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/core/platforms/android/widgets-release.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-analytics/platforms/android/firebase_analytics.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-core/platforms/android/firebase_core.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-crashlytics/platforms/android/firebase_crashlytics.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/google-maps/platforms/android/google_maps.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@triniwiz/nativescript-couchbase/platforms/android/nativescript_couchbase.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-messaging-core/platforms/android/firebase_messaging_core.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/nativescript-ui-core/platforms/android/TNSCore-release.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript-community/ui-barcodeview/platforms/android/ui_barcodeview.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/nativescript-ui-gauge/platforms/android/TNSGauge-release.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/nativescript-ui-listview/platforms/android/TNSListView-release.aar
         + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript-community/gesturehandler/platforms/android/gesturehandler.aar

Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'com.tns.testapplication'

Command ./gradlew failed with exit code 1

Gradle build output:

Executing tasks: [:app:assembleDebug, :app:assembleDebugUnitTest, :app:assembleDebugAndroidTest] in project /Users/tomg/repos/myapp/platforms/android


> Configure project :
	 + failed to load gradle properties from "/Users/tomg/repos/myapp/platforms/android/additional_gradle.properties". Error is: /Users/tomg/repos/myapp/platforms/android/additional_gradle.properties (No such file or directory)
	 + applying user-defined configuration from /Users/tomg/repos/myapp/App_Resources/Android/before-plugins.gradle

> Configure project :app
	 + applying user-defined buildscript from dependency /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-core/platforms/android/buildscript.gradle
	 + applying user-defined buildscript from dependency /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-crashlytics/platforms/android/buildscript.gradle
	 + applying user-defined buildscript from dependency /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-messaging-core/platforms/android/buildscript.gradle
	 + applying user-defined configuration from /Users/tomg/repos/myapp/App_Resources/Android/before-plugins.gradle
	 + setting applicationId
	 + applying user-defined configuration from /Users/tomg/repos/myapp/App_Resources/Android/app.gradle
	 + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript-community/ui-image/platforms/android/ui_image.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/core/platforms/android/core.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/core/platforms/android/widgets-release.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-analytics/platforms/android/firebase_analytics.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-core/platforms/android/firebase_core.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-crashlytics/platforms/android/firebase_crashlytics.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/google-maps/platforms/android/google_maps.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@triniwiz/nativescript-couchbase/platforms/android/nativescript_couchbase.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript/firebase-messaging-core/platforms/android/firebase_messaging_core.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/nativescript-ui-core/platforms/android/TNSCore-release.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript-community/ui-barcodeview/platforms/android/ui_barcodeview.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/nativescript-ui-gauge/platforms/android/TNSGauge-release.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/nativescript-ui-listview/platforms/android/TNSListView-release.aar
	 + adding aar plugin dependency: /Users/tomg/repos/myapp/node_modules/@nativescript-community/gesturehandler/platforms/android/gesturehandler.aar
AGPBI: {"kind":"warning","text":"Using flatDir should be avoided because it doesn't support any meta-data formats.","sources":[{}]}
AGPBI: {"kind":"warning","text":"Using flatDir2 should be avoided because it doesn't support any meta-data formats.","sources":[{}]}
Configuration 'debugCompileClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'debugRuntimeClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:checkKotlinGradlePluginConfigurationErrors SKIPPED
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:injectCrashlyticsMappingFileIdDebug UP-TO-DATE
> Task :app:processDebugGoogleServices FAILED
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE

> Task :app:processDebugMainManifest FAILED
Incorrect package="com.company.androidapp" found in source AndroidManifest.xml: /Users/tomg/repos/myapp/platforms/android/app/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.company.androidapp" from the source AndroidManifest.xml: /Users/tomg/repos/myapp/platforms/android/app/src/main/AndroidManifest.xml.

> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:generateReleaseResValues UP-TO-DATE
> Task :app:injectCrashlyticsMappingFileIdRelease UP-TO-DATE
> Task :app:processReleaseGoogleServices FAILED
> Task :app:generateReleaseResources UP-TO-DATE
> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksRelease UP-TO-DATE

> Task :app:processReleaseMainManifest FAILED
Incorrect package="com.company.androidapp" found in source AndroidManifest.xml: /Users/tomg/repos/myapp/platforms/android/app/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.company.androidapp" from the source AndroidManifest.xml: /Users/tomg/repos/myapp/platforms/android/app/src/main/AndroidManifest.xml.

> Task :app:checkReleaseAarMetadata UP-TO-DATE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:checkReleaseDuplicateClasses UP-TO-DATE
> Task :app:mergeDebugArtProfile UP-TO-DATE
> Task :app:desugarDebugFileDependencies UP-TO-DATE
> Task :app:mergeExtDexDebug UP-TO-DATE
> Task :app:mergeLibDexDebug UP-TO-DATE
> Task :app:buildKotlinToolingMetadata UP-TO-DATE
> Task :app:javaPreCompileRelease UP-TO-DATE
> Task :app:desugarReleaseFileDependencies UP-TO-DATE
> Task :app:mergeExtDexRelease UP-TO-DATE
> Task :app:mergeReleaseArtProfile UP-TO-DATE
> Task :app:copyMetadataFilters UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs UP-TO-DATE
> Task :app:stripDebugDebugSymbols UP-TO-DATE
> Task :app:extractDebugNativeSymbolTables UP-TO-DATE
> Task :app:extractProguardFiles UP-TO-DATE
> Task :app:mergeReleaseJniLibFolders UP-TO-DATE
> Task :app:mergeReleaseNativeLibs UP-TO-DATE
> Task :app:stripReleaseDebugSymbols UP-TO-DATE
> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:mergeReleaseShaders UP-TO-DATE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
> Task :app:assembleDebugUnitTest UP-TO-DATE
> Task :app:preDebugAndroidTestBuild SKIPPED
> Task :app:checkDebugAndroidTestAarMetadata UP-TO-DATE
> Task :app:generateDebugAndroidTestResValues UP-TO-DATE
> Task :app:mapDebugAndroidTestSourceSetPaths UP-TO-DATE
> Task :app:generateDebugAndroidTestResources UP-TO-DATE
> Task :app:mergeDebugAndroidTestResources UP-TO-DATE
> Task :app:processDebugAndroidTestManifest UP-TO-DATE
> Task :app:processDebugAndroidTestResources UP-TO-DATE
> Task :app:javaPreCompileDebugAndroidTest UP-TO-DATE
> Task :app:mergeDebugAndroidTestShaders UP-TO-DATE
> Task :app:compileDebugAndroidTestShaders NO-SOURCE
> Task :app:generateDebugAndroidTestAssets UP-TO-DATE
> Task :app:checkDebugAndroidTestDuplicateClasses UP-TO-DATE
> Task :app:desugarDebugAndroidTestFileDependencies UP-TO-DATE
> Task :app:mergeExtDexDebugAndroidTest UP-TO-DATE
> Task :app:mergeLibDexDebugAndroidTest UP-TO-DATE
> Task :app:mergeDebugAndroidTestJniLibFolders UP-TO-DATE
> Task :app:mergeDebugAndroidTestNativeLibs NO-SOURCE
> Task :app:stripDebugAndroidTestDebugSymbols NO-SOURCE
> Task :app:validateSigningDebugAndroidTest UP-TO-DATE
> Task :app:writeDebugAndroidTestSigningConfigVersions UP-TO-DATE
> Task :app:validateAppIdMatch

Build completed with 4 failures.
No matching client found for package name 'com.tns.testapplication'

59 actionable tasks: 5 executed, 54 up-to-date

Environment

No response

Please accept these terms

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions