AIDE “Unknown entity 'R'” Error with Andro

2019-04-16 21:07发布

I am trying to work on an Android App that I started writing with Android Studio using AIDE, but I have an issue with the project throwing an Unknown entity 'R' error in AIDE that I never saw in Android Studio. I would imagine that somehow, Android Studio uses Gradle to manage this and prevent this from being an issue, but since AIDE does not support Gradle, the project does not function properly.

What must I do to make the project work in AIDE while still maintaining compatibility with Android Studio? This seems to be an issue that others have experienced, but I have been unable to find a solution to the problem.

AIDE Project Screenshot

3条回答
姐就是有狂的资本
2楼-- · 2019-04-16 21:21

For me, it turned out that I was missing another error that was preventing AIDE from completing the build. It was buried at the bottom of the mass of "Unknown entity 'R'" errors. Once I fixed that , it built like a dream and auto-generated the R file like normal. Yay!

mass of errors

true error at bottom

查看更多
姐就是有狂的资本
3楼-- · 2019-04-16 21:31

Just add an import with R with the name of your Project. Like for example, my package name is - com.xyz.app then add an Import as import com.xyz.app.R;

查看更多
仙女界的扛把子
4楼-- · 2019-04-16 21:37

This will happen when the applicationId does not match the package name in the app's build.gradle file.

查看更多
登录 后发表回答