Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require support for gradel 8 (react-native 0.72.3) #354

Closed
AdarshJais opened this issue Aug 7, 2023 · 1 comment
Closed

Require support for gradel 8 (react-native 0.72.3) #354

AdarshJais opened this issue Aug 7, 2023 · 1 comment

Comments

@AdarshJais
Copy link

AdarshJais commented Aug 7, 2023

Currently, this library might be using transformApi which has been removed from grade 8 and hence incremental build breaks.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

Failed to notify project evaluation listener.
Could not create task ':app:transformClassesAndResourcesWithProguardTransformForRelease'.
> Cannot use @TaskAction annotation on method IncrementalTransformTask.transform() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
The configured variant 'release' does not exist

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

android>build.gradel
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33

    // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
    ndkVersion = "23.1.7779620"
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath 'com.guardsquare:proguard-gradle:7.1.0'
}

}


android>app>builld.gradel

apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'com.guardsquare.proguard'

react {
}

/**

  • Set this to true to Run Proguard on Release builds to minify the Java bytecode.
    */
    def enableProguardInReleaseBuilds = false

def jscFlavor = 'org.webkit:android-jsc:+'

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.rn_and_nativebase"
defaultConfig {
    applicationId "com.rn_and_nativebase"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0"
}
signingConfigs {
    debug {
        storeFile file('debug.keystore')
        storePassword 'android'
        keyAlias 'androiddebugkey'
        keyPassword 'android'
    }
}
buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        minifyEnabled false
        signingConfig signingConfigs.debug
    }
}

}
proguard {
configurations {
release {
defaultConfiguration 'proguard-android-optimize.txt'
configuration 'proguard-rules.pro'
}
}
}

dependencies {
implementation("com.facebook.react:react-android")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}

}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

  • Current Workaround: android.experimental.legacyTransform.forceNonIncremental=true inside gradel properties which indeed force not to use the incremental build but it has many drawbacks and is not a good practice.
@mrjameshamilton
Copy link
Collaborator

ProGuard Gradle plugin doesn't support AGP8; there are currently no immediate plans to support it but there is an existing issue to track it (#280) so I'll close this issue. The default shrinker in Android now is R8, which is compatible with ProGuard configuration.

@mrjameshamilton mrjameshamilton closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants