APSL / react-native-version-number

Gets the version number and build number of your app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execution failed for task ':react-native-version-number:verifyReleaseResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt

AnilkumarDO opened this issue · comments

While trying to create apk file for anroid, its throwing following error.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-version-number:verifyReleaseResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

How to fix this?

same issue here

I uninstalled library from this project due to this issue since I did not found any solution for this.

is there any update on this issue?

I have fixed the issue by updating the build config.
`android {
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
lintOptions {
   warning 'InvalidPackage'
}

}`

I found a solution fortunately.

According to Afresh_Kedou, it was not originally a problem with the rn version. The reason is that the version of the Android SDK has been updated to 27 by 0.57.1, which is incompatible with most third-party plugins that use native code. Because the third-party updates are not timely, the SDK is still old. version.

Solution:

  1. First find the build.gradle in the error package in node_modules, for example, this is \node_modules\react-native-version-number\android\build.gradle;

  2. Modify this build.gradle to match the SDK version in android/build.gradle (and possibly android/app/build.gradle);

  3. Change compile in build.gradle to implementation because compile is obsolete.

android {
    compileSdkVersion 27 // 23 -> 27
    buildToolsVersion "27.0.3" // 23.0.1 -> 27.0.3

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26 // 22 -> 26
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    lintOptions {
       warning 'InvalidPackage'
    }
}

dependencies {
    implementation 'com.facebook.react:react-native:+' // compile -> implementation
}

Then re-release it.

credit - Afresh_Kedou (https://www.twblogs.net/a/5bd390a22b717778ac206d34)

below is what you need for react-native 0.59.5:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    lintOptions {
       warning 'InvalidPackage'
    }
}

dependencies {
    compile 'com.facebook.react:react-native:+'
}