在没有重建项目的情况下在Android Studio中找不到符号

时间:2023-01-25 19:47:47

When I try to deploy my project to the emulator the compile fails with a bunch of Cannot find symbol errors. I have to rebuild the project then deploy everytime I make a change. This just started in 0.1.6 for me. Anyone else seeing this?

当我尝试将我的项目部署到模拟器时,编译失败了一堆无法找到符号错误。我必须重建项目,然后每次进行更改时进行部署。这对我来说只是0.1.6。有人看到这个吗?

8 个解决方案

#1


19  

As a temporary workaround, try turning off Preferences > Compiler > Use External Build.

作为临时解决方法,请尝试关闭“首选项”>“编译器”>“使用外部构建”。

(as suggested in this issue: https://code.google.com/p/android/issues/detail?id=56884)

(根据此问题的建议:https://code.google.com/p/android/issues/detail?id = 56884)

#2


6  

Clicking "Sync project with Gradle files" resolved this for me.

单击“使用Gradle文件同步项目”为我解决了这个问题。

在没有重建项目的情况下在Android Studio中找不到符号

#3


4  

I used the following answer and it worked great:

我使用了以下答案,效果很好:

https://*.com/a/19223269/1531683

You can do "File" -> "Invalidate Caches...", and select "Invalidate and Restart" option to fix this.

您可以执行“文件” - >“使缓存无效...”,并选择“无效并重新启动”选项来解决此问题。

#4


2  

Same here. Check this for updates: https://code.google.com/p/android/issues/detail?id=56884&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

同样在这里。检查以获取更新:https://code.google.com/p/android/issues/detail?id = 56884&solpec = ID%20Type%20Status%20Owner%20Summary%20Stars

#5


2  

As a workaround, deleting the out folder before rebuilding the project solves the problem!

作为解决方法,在重建项目之前删除out文件夹可以解决问题!

#6


2  

Just Click Build -> Clean Project. It will solve the problem of missing "R.java".

只需单击Build - > Clean Project。它将解决缺少“R.java”的问题。

#7


0  

Adding the following into the dependencies worked for me:

将以下内容添加到依赖项中对我有用:

compile 'com.android.support:appcompat-v7:20.+' compile 'com.android.support:support-v4:21.0.0'

编译'com.android.support:appcompat-v7:20.+'compile'c​​om.android.support:support-v4:21.0.0'

#8


0  

Using java 7 inner classes instead of lambda functions provided by retro-lambda solved my issue.

使用java 7内部类而不是retro-lambda提供的lambda函数解决了我的问题。

#1


19  

As a temporary workaround, try turning off Preferences > Compiler > Use External Build.

作为临时解决方法,请尝试关闭“首选项”>“编译器”>“使用外部构建”。

(as suggested in this issue: https://code.google.com/p/android/issues/detail?id=56884)

(根据此问题的建议:https://code.google.com/p/android/issues/detail?id = 56884)

#2


6  

Clicking "Sync project with Gradle files" resolved this for me.

单击“使用Gradle文件同步项目”为我解决了这个问题。

在没有重建项目的情况下在Android Studio中找不到符号

#3


4  

I used the following answer and it worked great:

我使用了以下答案,效果很好:

https://*.com/a/19223269/1531683

You can do "File" -> "Invalidate Caches...", and select "Invalidate and Restart" option to fix this.

您可以执行“文件” - >“使缓存无效...”,并选择“无效并重新启动”选项来解决此问题。

#4


2  

Same here. Check this for updates: https://code.google.com/p/android/issues/detail?id=56884&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

同样在这里。检查以获取更新:https://code.google.com/p/android/issues/detail?id = 56884&solpec = ID%20Type%20Status%20Owner%20Summary%20Stars

#5


2  

As a workaround, deleting the out folder before rebuilding the project solves the problem!

作为解决方法,在重建项目之前删除out文件夹可以解决问题!

#6


2  

Just Click Build -> Clean Project. It will solve the problem of missing "R.java".

只需单击Build - > Clean Project。它将解决缺少“R.java”的问题。

#7


0  

Adding the following into the dependencies worked for me:

将以下内容添加到依赖项中对我有用:

compile 'com.android.support:appcompat-v7:20.+' compile 'com.android.support:support-v4:21.0.0'

编译'com.android.support:appcompat-v7:20.+'compile'c​​om.android.support:support-v4:21.0.0'

#8


0  

Using java 7 inner classes instead of lambda functions provided by retro-lambda solved my issue.

使用java 7内部类而不是retro-lambda提供的lambda函数解决了我的问题。