Adding Support Libraries to Android project

后端 未结 9 1577
孤街浪徒
孤街浪徒 2020-12-31 00:43

Why am I having such a hard time getting into the swing of Android development? I\'ve been developing in various languages over the years and, for some reason, just can\'t s

9条回答
  •  感动是毒
    2020-12-31 01:11

    OK, I guess I should post an answer as I've eventually managed to solve my own problem.

    It turns out I have to use a build target of Android 4.2.2, regardless of the fact that I'm specifically developing for Android 2.3.3 - I mean, that's why I'm using support libraries after all. I imagine it might be possible that some other lower target (but higher than 2.3.3) would still work I just used the highest one I have installed and it solved the problem.

    How I was supposed to know this from following the step-by-step instructions on the Android Developers website is a mystery to me. The reason I decided to try changing the targetSdkVersion was because of the final section in the page referenced in the question. It reads "If you are increasing the backward compatibility of your existing application to an earlier version of the Android API with the Support Library, make sure to update your application's manifest." Now I'm not increasing the backward compatibility of my existing application. I'm changing an existing application that targets 2.3.3 to be able to include an Action Bar (seems more like "forward compatibility"). I tried upgrading the targekSdkVersion though as I was out of ideas and lo and behold, it worked.

提交回复
热议问题