简体   繁体   中英

Imports in Android Studio/IntelliJ13 not working, gradle command line running just fine

I´m trying to get a gradle project running on my Mac, command line building works just fine. When I open the Project, all Android classes seem not to be found.

As a reference I also tried with this open source project ( https://github.com/ligi/PassAndroid ) of a friend of mine. Same problem there.

屏幕截图示例-我的项目

PassAndroid的BarcodeHelper

I´ve tried with the sample code (BasicMediaRouter), provided with the SDK, and I only had to change the android plugin version that it was referencing, so everything seemed normal.

Building and running also works, it´s just Android Studio that is broken.

I have the same problems with IntelliJ CE13.

Did you click 'sync project with gradle files'? (you can find it using cmd+shift+a and write it) What happens if you position cursor on the red word (for example Bitmap) and click Alt+Enter?

It looks like you did not set up Android SDK path. You can set in up in FIle->Project Structure->SDK Path (or similar depending on what version of Android Studio you have)

What ended up helping is using the import Project function on the build.gradle file.

File -> Open on the build.gradle file led to the problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM