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

Cannot find symbol Build.VERSION_CODES.O #30

Open
nodermatt opened this issue Dec 1, 2018 · 5 comments
Open

Cannot find symbol Build.VERSION_CODES.O #30

nodermatt opened this issue Dec 1, 2018 · 5 comments

Comments

@nodermatt
Copy link

Using react-native-filepicket version 0.0.12 I get an an error when I run react-native run-android

C:\Users\oderm\IdeaProjects\IP5_Fahrzeugdiagnose\Client\node_modules\react-native-file-picker\android\src\main\java\com\filepicker\FilePickerModule.java:208: error: cannot find symbol
                    String prefix = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? "file:///" : "content://";
                                                                                                                              ^
  symbol:   variable O
  location: class VERSION_CODES
1 error

Looking into the file I could confirm though that the necessary import takes place: import android.os.Build;

According to https://developer.android.com/reference/android/os/Build.VERSION_CODES that is the package that contains the Enum "0". Did I miss something ovious?

Here is an excerpt from the buildscript I'm using in android/build.gradle.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
@dmytropanontko
Copy link

same issue) Thanks for your job!

@vkandk
Copy link

vkandk commented Jan 10, 2019

Has anybody got any solution to this issue? I am facing similar build failure. What am I missing?

@joaosauer
Copy link

Just change the file android/build.gradle from:

    compileSdkVersion 23
    buildToolsVersion "23.0.1"

To:

    compileSdkVersion 26
    buildToolsVersion "26.0.2"

The O version only exist in version 26 or above....

@luisfuertes
Copy link
Owner

Upadate component with @joaosauer fix in v.0.0.13. Confirm all its ok plz

@vishal767
Copy link

My compileSDKversion is 27, but I'm still facing the issue

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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