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

Android build fail #47

Open
Jeijie opened this issue Mar 4, 2019 · 11 comments
Open

Android build fail #47

Jeijie opened this issue Mar 4, 2019 · 11 comments

Comments

@Jeijie
Copy link

Jeijie commented Mar 4, 2019

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

@Sunhat
Copy link
Owner

Sunhat commented Mar 4, 2019

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

@Jeijie
Copy link
Author

Jeijie commented Mar 4, 2019

I manually changed the build. gradle file to compile it, but now another issue occurred, It's work RN 0.55.4?

screenshot_2019-03-04-16-58-45

@Sunhat
Copy link
Owner

Sunhat commented Mar 4, 2019

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?

@Cumbermiao
Copy link

Did you fix it? I have same problem in React-Native v0.57

@fredikey
Copy link

same problem in React Native 0.55.4

@Sunhat
Copy link
Owner

Sunhat commented Mar 18, 2019

I'll look into this now - Just getting a coffee. In case this is the problem, try re-building the project

@EyMaddis
Copy link
Contributor

@Jeijie try this again with the latest master. Use
import { getRealWindowHeight } from ''react-native-extra-dimensions-android
otherwise send the whole code.

@Jeijie
Copy link
Author

Jeijie commented Mar 21, 2019

@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());
}

image

@Cumbermiao
Copy link

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:+'
}

@alexandrius
Copy link

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

@Sunhat
Copy link
Owner

Sunhat commented Mar 30, 2019

Ahh crap I fixed this, but didn't publish on npm. fml.

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

6 participants