NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
523 stars 134 forks source link

Specifying package name after migrating to 8.8 #1817

Closed dlcole closed 1 month ago

dlcole commented 1 month ago

Environment

✔ Component nativescript has 8.8.0 version and is up to date. ✔ Component @nativescript/core has 8.8.1 version and is up to date. ✔ Component @nativescript/ios has 8.8.1 version and is up to date. ✔ Component @nativescript/android has 8.8.0 version and is up to date.

Describe the bug

I'm updating my white label app from {N} 8.7 to 8.8. ns doctor shows all green checks. Ran ns clean and tried to run on Android. Updated Java from 11 to 21, then hit the error, Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported..

OK, so I modified app.gradle to include a namespace attribute:

android {  
  compileSdkVersion 33 
  defaultConfig {  
    generatedDensities = []
    namespace = "tech.govia.gvtbase"
    applicationId = "tech.govia.festivelo" 
    multiDexEnabled true
    minSdkVersion 21
    targetSdkVersion 33
    versionCode 36
    versionName "8.0.0"
  }  

But now I get the error AAPT: error: resource style/LaunchScreenTheme (aka tech.govia.festivelo:style/LaunchScreenTheme) not found.

I realize it's unusual to have a package name (or now namespace) that differs from the application ID, but that's what I need for a white label app.

Is there some different way to specify the package name, or does {N} 8.8 and @nativescript/android 8.8.0 no longer support this?

To Reproduce

Build any Nativescript Core app with {N} 8.8 that specifies package= in AndroidManifest.xml.

Expected behavior

Sample project

Additional context

dlcole commented 1 month ago

The error was due to style folders being absent. Not sure how that happened, but I reverted to 8.7 and encountered the same error.