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

Could not get unknown property 'flavorAware' for object of type io.sentry.android.gradle.SentryPluginExtension #257

Closed
2 of 5 tasks
zen0wu opened this issue Oct 10, 2017 · 6 comments
Assignees

Comments

@zen0wu
Copy link

zen0wu commented Oct 10, 2017

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

I have following issue:

Enabling io.sentry.android.gradle would cause the following error:

* Where:
Script '.../node_modules/react-native-sentry/sentry.gradle' line: 49

* What went wrong:
Could not get unknown property 'flavorAware' for object of type io.sentry.android.gradle.SentryPluginExtension.

It seems that enabling this plugin has overridden project.sentry property in gradle to point to something else.

https://github.com/getsentry/react-native-sentry/blob/master/sentry.gradle#L6

@HazAT HazAT self-assigned this Oct 10, 2017
@HazAT
Copy link
Member

HazAT commented Oct 10, 2017

Can you post your gradle config and version of react-native-sentry please?

@zen0wu
Copy link
Author

zen0wu commented Oct 11, 2017

For sure.

├─┬ react-native-sentry@0.26.0

And

apply plugin: "com.android.application"
apply plugin: "io.sentry.android.gradle"

import com.android.build.OutputFile

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = true

sentry {
    autoProguardConfig true
    autoUpload true
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"

    defaultConfig {
        applicationId "my.application"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0.1"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        debug {}
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile project(':react-native-sentry')
    compile project(':react-native-code-push')
    compile project(':react-native-navigation')
    compile project(':react-native-vector-icons')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

@HazAT
Copy link
Member

HazAT commented Oct 11, 2017

can you change

sentry {
    autoProguardConfig true
    autoUpload true
}

TO

sentry {
    autoProguardConfig true
    autoUpload true
    flavorAware false
    logLevel "error"
}

and see if the problem still exsists?

@zen0wu
Copy link
Author

zen0wu commented Oct 11, 2017

No that doesn't work.

* Where:
Build file '.../android/app/build.gradle' line: 98

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method flavorAware() for arguments [false] on object of type io.sentry.android.gradle.SentryPluginExtension.

HazAT added a commit that referenced this issue Oct 13, 2017
@HazAT
Copy link
Member

HazAT commented Oct 13, 2017

I've just released 0.28.0 which fixes the issue.

@zen0wu
Copy link
Author

zen0wu commented Oct 13, 2017

Thanks so much for the fast response and fix!

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