Problem with Android Studio and Gradle for Native Android app

0
I finally got push notifications working on iOS and now I am having difficulties getting the android APK to build using nativebuilder or android studio (it has never not worked up until adding push notifications in the mix). The build phase routinely fails and I see the following error in android studio. I’m also not very familiar with Android Studio and any help is appreciated. Gradle sync failed: Could not find matching constructor for: org.gradle.api.internal.file.DefaultSourceDirectorySet(org.codehaus.groovy.runtime.GStringImpl, org.gradle.api.internal.file.BaseDirFileResolver, org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory) It points to line 20-21 in one of my build.gradle files currently under (:react-native-ble-plx)  def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } buildscript { repositories { jcenter() maven { url 'https://maven.google.com/' name 'Google' } } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:2.0.1' // classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0' } } ####Fails here it seems with groovyx.android##### apply plugin: 'com.android.library' apply plugin: 'groovyx.android' android { compileSdkVersion safeExtGet('compileSdkVersion', 27) buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3') defaultConfig { minSdkVersion 18 targetSdkVersion safeExtGet('targetSdkVersion', 27) } lintOptions { abortOnError false } } repositories { mavenLocal() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$projectDir/../../../node_modules/react-native/android" } maven { url 'https://maven.google.com/' name 'Google' } } The log from nativebuilder shows this error after the build fails 2020-07-17T03:47:07.2637620Z FAILURE: Build completed with 2 failures. 2020-07-17T03:47:07.2667940Z 2020-07-17T03:47:07.2668540Z 1: Task failed with an exception. 2020-07-17T03:47:07.2669840Z ----------- 2020-07-17T03:47:07.2670360Z * Where: 2020-07-17T03:47:07.2671440Z Build file '/Users/runner/work/1/s/node_modules/react-native-ble-plx/android/build.gradle' line: 20 2020-07-17T03:47:07.2673670Z 2020-07-17T03:47:07.2674140Z * What went wrong: 2020-07-17T03:47:07.2675170Z A problem occurred evaluating project ':react-native-ble-plx'. 2020-07-17T03:47:07.2676220Z > Failed to apply plugin [id 'groovyx.android'] 2020-07-17T03:47:07.2676940Z > Could not create an instance of type groovyx.internal.DefaultAndroidGroovySourceSet. 2020-07-17T03:47:07.2677990Z > Could not find matching constructor for: org.gradle.api.internal.file.DefaultSourceDirectorySet(org.codehaus.groovy.runtime.GStringImpl, org.gradle.api.internal.file.BaseDirFileResolver, org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory) 2020-07-17T03:47:07.2678860Z 2020-07-17T03:47:07.2679270Z * Try: 2020-07-17T03:47:07.2680410Z 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. 2020-07-17T03:47:07.2681260Z ============================================================================== 2020-07-17T03:47:07.2681790Z 2020-07-17T03:47:07.2682240Z 2: Task failed with an exception. 2020-07-17T03:47:07.2683510Z ----------- 2020-07-17T03:47:07.2684090Z * What went wrong: 2020-07-17T03:47:07.2685080Z A problem occurred configuring project ':react-native-ble-plx'. 2020-07-17T03:47:07.2685810Z > compileSdkVersion is not specified. Please add it to build.gradle 2020-07-17T03:47:07.2686280Z 2020-07-17T03:47:07.2686690Z * Try: 2020-07-17T03:47:07.2688260Z 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. 2020-07-17T03:47:07.2689130Z ==============================================================================  
asked
0 answers