Skip to content

RN 0.61.1 android 编译release错误 #4

Description

@bashen1
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

能否改下模块的bulid.gradle

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'
    }
}

apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
    compileSdkVersion safeExtGet("compileSdkVersion", 25)
    buildToolsVersion safeExtGet("buildToolsVersion", '25.0.2')
    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 16)
        targetSdkVersion safeExtGet('targetSdkVersion', 25)
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    api 'androidx.appcompat:appcompat:1.0.0'
    api 'com.facebook.react:react-native:+'
    api 'com.aliyun.openservices:aliyun-log-android-sdk:0.4.0'
    api 'com.alibaba:fastjson:1.1.71.android'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'androidx.annotation', module: 'annotation'
    })
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions