Special android build problem

Hello. I get a problem when build for android. I search my problem and apply but no there solution for me.

ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[11:39:08]  ionic-app-scripts 3.2.2
[11:39:08]  build dev started ...
[11:39:08]  clean started ...
[11:39:08]  clean finished in 10 ms
[11:39:08]  copy started ...
[11:39:08]  deeplinks started ...
[11:39:08]  deeplinks finished in 89 ms
[11:39:08]  transpile started ...
[11:39:12]  transpile finished in 4.23 s
[11:39:12]  preprocess started ...
[11:39:12]  preprocess finished in less than 1 ms
[11:39:12]  webpack started ...
[11:39:13]  copy finished in 4.50 s
[11:39:17]  webpack finished in 5.03 s
[11:39:17]  sass started ...
[11:39:19]  sass finished in 1.11 s
[11:39:19]  postprocess started ...
[11:39:19]  postprocess finished in 12 ms
[11:39:19]  lint started ...
[11:39:19]  build dev finished in 10.60 s
[11:39:22]  tslint: C:/Data/kameraYonetim/src/services/helpers/helpers.ts, line: 28
            Property 'networkInterface' is declared but its value is never read.

      L27:  private toast: Toast,
      L28:  private networkInterface: NetworkInterface,
      L29:  private storage: Storage,

[11:39:22]  lint finished in 3.29 s
> cordova build android
cordova-android-support-gradle-release: Android platform: V6
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Data\kameraYonetim\platforms\android\build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Data\kameraYonetim\platforms\android\cordova-android-support-gradle-release\starter-cordova-android-support-gradle-release.gradle
cordova-android-support-gradle-release: Android platform: V6
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Data\kameraYonetim\platforms\android\build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Data\kameraYonetim\platforms\android\cordova-android-support-gradle-release\starter-cordova-android-support-gradle-release.gradle
ANDROID_HOME=C:\Users\omers\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_152
:wrapper

BU�LD SUCCESSFUL in 1s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_5mpcat99bje0wpj6bcyr2h888.run(C:\Data\kameraYonetim\platforms\android\build.gradle:143)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNat�ve_l�bsWithMergeJniLibsForDebug
:CordovaLib:transformNat�ve_l�bsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNat�ve_l�bsWithMergeJniLibsForRelease
:CordovaLib:transformNat�ve_l�bsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareAndroidArchCoreRuntime110Library
:prepareAndroidArchLifecycleLivedataCore110Library
:prepareAndroidArchLifecycleRuntime110Library
:prepareAndroidArchLifecycleViewmodel110Library
:prepareComAndroidSupportSupportCompat2711Library
:prepareComAndroidSupportSupportCoreUi2711Library
:prepareComAndroidSupportSupportCoreUtils2711Library
:prepareComAndroidSupportSupportFragment2711Library
:prepareComAndroidSupportSupportMediaCompat2711Library
:prepareComAndroidSupportSupportV42711Library
:prepareComCommit451PhotoView124Library
:prepareOrgApacheCordovaCordovaLib630DebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
C:\Data\kameraYonetim\platforms\android\res\xml\config.xml:45:53-81: AAPT: No resource found that matches the given name (at 'networkSecurityConfig' with value '@xml/network_security_config').

:processDebugResources FAILED
C:\Data\kameraYonetim\platforms\android\build\intermediates\res\merged\debug\xml\config.xml:45: error: Error: No resource found that matches the given name (at 'networkSecurityConfig' with value '@xml/network_security_config').



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BU�LD FAILED

Total time: 17.935 secs
Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\Data\kameraYonetim\platforms\android\res\xml\config.xml:45:53-81: AAPT: No resource found that matches the given name (at 'networkSecurityConfig' with value '@xml/network_security_config').

C:\Data\kameraYonetim\platforms\android\build\intermediates\res\merged\debug\xml\config.xml:45: error: Error: No resource found that matches the given name (at 'networkSecurityConfig' with value '@xml/network_security_config').



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
[ERROR] An error occurred while running subprocess cordova.

        cordova build android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

please help me.

The following link would help you.
networksecurityconfig and edit your config.xml accordingly.

1 Like

Thank you :slight_smile: