Android Studio and android.support.v4.app.Fragment: cannot resolve symbol

后端 未结 22 2838
眼角桃花
眼角桃花 2020-12-01 06:03

I am tryng out Android Studio instead of Eclipse. I install it and then start a completely new project and follow the wizard. I add no code of my own.

Then, I right-

22条回答
  •  旧时难觅i
    2020-12-01 06:29

    Hrrm... I dont know how many times this has happend so far: I test, try, google, test again and mess around for hours, and when I finally give up, I go to my trusted Stackoverflow and write a detailed and clear question.

    When I post the question, switch over to the IDE and boom - error gone.

    I can't say why its gone, because I change absolutely nothing in the code except for that I already tried as stated above. But all of a sudden, the compile error is gone!

    In the build.gradle, it now says:

    dependencies {
        compile "com.android.support:appcompat-v7:18.0.+"
    }
    

    which initially did not work, the compile errors did not go away. it took like 30 min before the IDE got it, it seems... hmm...

    === EDIT === When I view the build.gradle again, it has now changed and looks like this:

    dependencies {
        compile 'com.android.support:support-v4:18.0.0'
        compile "com.android.support:appcompat-v7:18.0.+"
    }
    

    Im not really sure what the appcompat is right now.

提交回复
热议问题