NativeScript / android

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

Gradle error while building with whitelisted self signed certificates #1687

Closed pacome2017 closed 2 years ago

pacome2017 commented 2 years ago

I'm trying to build a Nativescript application while whitelisting self-signed certificates for android. It use to work I'm pretty sure, but now I'm getting the following Gradle error :

`Platform android successfully added. v3.4.2

Support for Node.js 12.22.6 is not verified. NativeScript CLI might not install or run properly.

Executing before-prepare hook from /home1/local/jenkins/workspace/myApp/hooks/before-prepare/nativescript-dev-typescript.js Found peer TypeScript 2.6.2 Preparing project... Successfully prepared plugin nativescript-angular for android. Successfully prepared plugin nativescript-audio for android. Successfully prepared plugin nativescript-barcodescanner for android. Successfully prepared plugin nativescript-couchbase for android. Successfully prepared plugin nativescript-ripple for android. Successfully prepared plugin nativescript-sqlite for android. Successfully prepared plugin nativescript-theme-core for android. Successfully prepared plugin nativescript-toast for android. Successfully prepared plugin nativescript-toolbox for android. Successfully prepared plugin nativescript-ui-sidedrawer for android. nativescript-vibrate 5.2.0 for android is not compatible with the currently installed framework version 3.4.2. Successfully prepared plugin nativescript-vibrate for android. Successfully prepared plugin tns-core-modules for android. Successfully prepared plugin nativescript-intl for android. Successfully prepared plugin nativescript-permissions for android. Successfully prepared plugin nativescript-ui-core for android. Successfully prepared plugin tns-core-modules-widgets for android. Project successfully prepared (android) Building project... Gradle build...

/home1/local/jenkins/workspace/myApp/platforms/android/app/src/main/res/xml/network_security_config.xml:6:32-50: AAPT: No resource found that matches the given name (at 'src' with value '@raw/a7848a7ee.pem').

/home1/local/jenkins/workspace/myApp/platforms/android/app/build/intermediates/res/merged/F0F1F2F3F4F5/debug/xml/network_security_config.xml:5: error: Error: No resource found that matches the given name (at 'src' with value '@raw/digicert_egs.pem').

/home1/local/jenkins/workspace/myApp/platforms/android/app/build/intermediates/res/merged/F0F1F2F3F4F5/debug/xml/network_security_config.xml:6: error: Error: No resource found that matches the given name (at 'src' with value '@raw/a7848a7ee.pem').

FAILURE: Build failed with an exception.

nativescript version : 3.4.2 node version : 12.7.7

my network_security_config.xml file (in myApp/app/App_Resources/Android/res/xml/..) : `<?xml version="1.0" encoding="utf-8"?>

` with my two certificates inside myApp/app/App_Resources/Android/res/raw/.. and I updated AndroidManifest.xml with application tag attribute : android:networkSecurityConfig="@xml/network_security_config" Did something changed or are my paths uncorrect ? (I tried other paths without success, either I get error for the certificates or for my network_security_config.xml file)
triniwiz commented 2 years ago

It seems the files are not being copied, is it possible to try using an newer version of nativescript ?

triniwiz commented 2 years ago

Upgrade to a newer version of {N} to fix this issue