blinkid-android icon indicating copy to clipboard operation
blinkid-android copied to clipboard

cordova build android fails

Open francislagares opened this issue 3 years ago • 3 comments

Description

After upgrading to v5.15.0 cannot generate apk.

  1. cordova prepare android
  2. cordova build android

Throws me:

Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed /home/user/.gradle/caches/transforms-2/files-2.1/42f4abcd1335f10590e79520ce40d264/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

Environment Details

**BlinkID version: 5.15.0

**Device model: Android

**NodeJS: v16.30.0

**NPM: 8.3.0

francislagares avatar Jan 19 '22 14:01 francislagares

Hi @francislagares

The mentioned issue could be connected with the targetSdkVersion You can try placing the target SDK version to 31.

In your Cordova project, you can change this by going to the config.xml file. After the line <platform name="android">, you can add: <preference name="android-targetSdkVersion" value="31" />

Let me know if this helped.

mparadina avatar Jan 20 '22 14:01 mparadina

Hi @mparadina

Well I just did what you suggested, now I get another one:

Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve androidx.core:core:1.6.+. Required by: project :app > Failed to list versions for androidx.core:core. > Unable to load Maven meta-data from https://jcenter.bintray.com/androidx/core/core/maven-metadata.xml. > Could not get resource 'https://jcenter.bintray.com/androidx/core/core/maven-metadata.xml'. > Could not GET 'https://jcenter.bintray.com/androidx/core/core/maven-metadata.xml'. > Read timed out

I've even tried to remove android platform and re-added again with :

cordova platform rm android
cordova platform add android

This is my config.xml:

<platform name="android">
        <allow-intent href="market:*" />
        <resource-file src="google-services.json" target="app/google-services.json" />
        <preference name="android-minSdkVersion" value="23" />
        <preference name="android-targetSdkVersion" value="31" />
        <splash src="res/screen/android/splash.png" />
        <preference name="Orientation" value="portrait" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:usesCleartextTraffic="true" />
            <application android:allowBackup="false" />
            <application android:extractNativeLibs="true"/>
            <!-- <meta-data android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/notification" /> -->
            <application android:debuggable="true" />
        </edit-config>
        <custom-config-file parent="./application" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
            <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
        </custom-config-file>

        <!-- <hook src="scripts/build_android_release.sh" type="after_build" /> -->
        <!-- Generador de iconos: http://romannurik.github.io/AndroidAssetStudio/index.html -->
        <icon src="res/android/ic_launcher/res/mipmap-mdpi/ic_launcher.png" density="mdpi" />
        <icon src="res/android/ic_launcher/res/mipmap-hdpi/ic_launcher.png" density="hdpi" />
        <icon src="res/android/ic_launcher/res/mipmap-xhdpi/ic_launcher.png" density="xhdpi" />
        <icon src="res/android/ic_launcher/res/mipmap-xxhdpi/ic_launcher.png" density="xxhdpi" />
        <icon src="res/android/ic_launcher/res/mipmap-xxxhdpi/ic_launcher.png" density="xxxhdpi" />
        <!-- <resource-file src="res/android/notification/drawable-mdpi/ic_stat_caser.png" target="app/src/main/res/drawable-mdpi/notification.png" />
        <resource-file src="res/android/notification/drawable-hdpi/ic_stat_caser.png" target="app/src/main/res/drawable-hdpi/notification.png" />
        <resource-file src="res/android/notification/drawable-xhdpi/ic_stat_caser.png" target="app/src/main/res/drawable-xhdpi/notification.png" />
        <resource-file src="res/android/notification/drawable-xxhdpi/ic_stat_caser.png" target="app/src/main/res/drawable-xxhdpi/notification.png" />
        <resource-file src="res/android/notification/drawable-xxxhdpi/ic_stat_caser.png" target="app/src/main/res/drawable-xxxhdpi/notification.png" /> -->
        <resource-file src="res/android/notification/drawable-xxxhdpi/ic_stat_caser.png" target="app/src/main/res/drawable-nodpi/notification_icon.png" />

</platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <resource-file src="GoogleService-Info.plist" />
        <preference name="Orientation" value="portrait" />
        <preference name="DisallowOverscroll" value="true" />
        <splash src="res/screen/ios/Default@2x~universal~anyany.png" />
        <hook src="scripts/fixIosIcons.sh" type="after_platform_add" />
        <config-file target="*-Info.plist" parent="UIStatusBarHidden">
            <true/>
        </config-file>
        <config-file target="*-Info.plist" parent="UIViewControllerBasedStatusBarAppearance">
            <false/>
        </config-file>
    </platform>
    <engine name="android" spec="^9.0.0" />
    <engine name="ios" spec="^6.1.1" />
    <plugin name="cordova-plugin-statusbar" spec="3.0.0" />
    <plugin name="cordova-plugin-androidx" spec="^3.0.0" />
    <plugin name="cordova-plugin-androidx-adapter" spec="^1.1.3" />
    <plugin name="cordova-plugin-appversion" spec="^1.0.0" />
    <plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-whitelist" spec="1.3.5" />
    <plugin name="cordova-plugin-ionic-webview">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-ionic-keyboard" spec="2.2.0" />
    <plugin name="cordova-clipboard" spec="~1.3.0" />
    <plugin name="cordova-plugin-fingerprint-aio" spec="^5.0.1">
        <variable name="FACEID_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="blinkid-cordova" spec="^5.15.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="Camera permission is required for automated scanning" />
    </plugin>
    <plugin name="cordova-plugin-network-information" spec="3.0.0" />
    <plugin name="cordova-plugin-networkinterface" spec="2.0.0" />
    <plugin name="cordova-plugin-iroot" spec="3.1.0" />
    <plugin name="cordova-plugin-advanced-http" spec="./plugins-custom/cordova-plugin-advanced-http" />
    <plugin name="cordova-plugin-file" spec="6.0.2" />
    <plugin name="cordova-plugin-proguard" spec="2.2.0" />
    <plugin name="cordova-plugin-buildinfo" spec="4.0.0" />
    <plugin name="cordova-plugin-inappbrowser" spec="5.0.0" />
    <plugin name="cordova-plugin-cache-clear" spec="1.3.8" />
    <plugin name="cordova-plugin-clear-data" spec="1.0.0" />
    <plugin name="@havesource/cordova-plugin-push" spec="3.0.0" `/>

francislagares avatar Jan 20 '22 15:01 francislagares

@francislagares install android with the following command:

cordova platform add android@10

with that, you get no errors on build. problem solved.

premedios-i9 avatar Mar 14 '22 14:03 premedios-i9

This issue was closed because it has been inactive for such a long time. If the issue persists, please open a new one.

krizaa avatar Jan 02 '23 12:01 krizaa