react-native-extra-dimensions-android
react-native-extra-dimensions-android copied to clipboard
Android build fail
Android build fail, please help
A problem occurred evaluating project ':react-native-extra-dimensions-android'.
Cannot get property 'compileSdkVersion' on extra properties extension as it do es not exist
Environment: OS: Windows 7 Node: 8.12.0 Yarn: 1.9.4 npm: 6.4.1 Watchman: Not Found Xcode: N/A Android Studio: Not Found
Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: ^0.55.4 => 0.55.4
Just getting ready for work. I can patch this as soon as I get on the train. Theres another open issue showing what I need to do. You can apply the same fix locally if you know how
I manually changed the build. gradle file to compile it, but now another issue occurred, It's work RN 0.55.4?
Hey Jeijie, did you manage to fix this? It looks like you've got ExtraDimensions installed twice looking at the 2 at the end of the name?
Did you fix it? I have same problem in React-Native v0.57
same problem in React Native 0.55.4
I'll look into this now - Just getting a coffee. In case this is the problem, try re-building the project
@Jeijie try this again with the latest master. Use
import { getRealWindowHeight } from ''react-native-extra-dimensions-android
otherwise send the whole code.
@EyMaddis ,thanks ,I try your method, but it not works.
my code: import { getRealWindowHeight } from 'react-native-extra-dimensions-android' componentDidMount() { console.warn('real width,height',getRealWindowHeight()); }
I have solved it by replacing build.gradle in node_modules/react-native-extra-dimensions-android/android
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
apply plugin: 'com.android.library'
def DEFAULT_COMPILE_SDK_VERSION = 27
def DEFAULT_BUILD_TOOLS_VERSION = "27.0.3"
def DEFAULT_TARGET_SDK_VERSION = 26
def DEFAULT_SUPPORT_LIB_VERSION = "27.0.2"
android {
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 16
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
}
dependencies {
implementation 'com.facebook.react:react-native:+'
}
just add these to root build.gradle
ext.supportLibVersion = '28.0.0'
ext.compileSdkVersion = 28
ext.buildToolsVersion = '28.0.3'
ext.minSdkVersion = 21
ext.targetSdkVersion = 28
Ahh crap I fixed this, but didn't publish on npm. fml.