Build Failed with Exception React native

时间:2018-12-19 11:20:19

标签: android react-native build.gradle dynatrace

Implementing Dynatrace in ReactNative, When using the plugin getting error.

Below is configuration in build.graddle file

 buildscript {
    ext {
        googlePlayServicesVersion = "16.0.1"
    }
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.1.0'        
        classpath 'com.dynatrace.tools:android:7.2.+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } 
} 
apply plugin: 'com.dynatrace.tools.android' 
dynatrace {     
    defaultConfig {         
        applicationId 'shhsksksss-6ddf-djjs-skjs-383jkksks'
        environmentId 'sjhksjks'        
        cluster 'https://bf.dynatrace.com'  
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter {
            url "http://jcenter.bintray.com/"
        }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven { url "https://jitpack.io" }
    } 
 } 
 subprojects { 
     afterEvaluate { 
         project -> if (project.hasProperty("android")) { 
             android { 
                compileSdkVersion 28 
                buildToolsVersion '28.0.3' 
             } 
         } 
     }   } ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 16
    compileSdkVersion = 28
    targetSdkVersion = 28
    supportLibVersion = "28.0.0" }

Below is the error getting in the console when runnuing the command "react-native run-android"

Scanning folders for symlinks in /Users/absyz/Desktop/MyHub/myhub-app/node_modules (30ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/Dev/Desktop/appname/android/build.gradle' line: 23

* What went wrong:
A problem occurred evaluating root project 'ProjectName'.
> Failed to apply plugin [id 'com.dynatrace.tools.android']
   > Extension of type 'AppExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension, DynatraceConfig_Decorated]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more logoutput. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

0 个答案:

没有答案