AppCode showing invalid errors/warnings that Xcode does not

Answered

I'm using AppCode 2017.3 EAP (Oct 17) and Xcode 9.0.1.

I'm not sure if it's when we switched to using an xcworkspace instead of an xcodeproj, or if it's when I upgraded to Xcode 9, but for the past several weeks AppCode is showing several errors/warnings in every file and Xcode is showing none of these.

(AppCode does compile/run w/o any issues.)

A lot of the errors are like this:

"Can't resolve variable title"

NSString* title = nil;

 

13 comments
Comment actions Permalink
Official comment

Hi,

Please try File | Invalidate Caches and Restart and let us know if it helps.

Comment actions Permalink

that didn't help, unfortunately...

another issue I see a lot of is NSAsserts...
"Error after macro substitution: Can't resolve variable '__assert_file__'"

I believe those are the only 2 types of errors that I'm seeing (hundreds of times throughout the project, so I can't be sure if there aren't other types).

I do see warnings (only in AppCode, not in Xcode) for some imports like "Cannot find protocol 'MyProtocol', conformed by protocol 'MyOtherProtocol'".

 

0
Comment actions Permalink

Would you be able to submit a sample project with examples of those issues to our support email (appcode-support@jetbrains.com)?

0
Comment actions Permalink

Also it might be worth to check which Xcode version is selected in Preferences | Tools | Xcode (I presume, that should be 9.0.1),  which target the problematic files belong to (i.e. iOS/macOS/etc), what target is selected in Run Configuration dropdown and which resolve context is used ("Context: ..." in bottom right). Logs from Help | Show Log in Finder would be also useful, if you can send them over to support email.

0
Comment actions Permalink

sample project will take time, unfortunately...and yes, the correct Xcode is selected in prefs>tools...thx

0
Comment actions Permalink

AppCode 2018.1.1 还是有不能解析类型、方法等内容。

can not resolve variable

can not find declaration

Help | Show Log in Finder

==>

2018-04-13 14:33:55,846 [ 330991] INFO - cidr.xcode.XcodeBuildFramework - 2018-04-13 14:33:55.843 BuildService[64261:3553242] [MT] IDEIndexing: Disabling index for workspace 'XXXXXXXXX'.
2018-04-13 14:33:55,846 [ 330991] INFO - cidr.xcode.XcodeBuildFramework - 2018-04-13 14:33:55.843 BuildService[64261:3553242] [MT] IDEIndexing: Failed to create IDESourceKitWorkspace: (null)

是否有方法去设置开启index

where enable?

pod update

可以编译成功并安装到iPhone。

compile success.

 

0
Comment actions Permalink

try File | Invalidate Caches and Restart , but still error.

试了invalidate caches,但是还是有问题。

0
Comment actions Permalink

Hi Qhk83.

Please disregard the INFO messages:

2018-04-13 14:33:55,846 [ 330991] INFO - cidr.xcode.XcodeBuildFramework - 2018-04-13 14:33:55.843 BuildService[64261:3553242] [MT] IDEIndexing: Disabling index for workspace 'XXXXXXXXX'. 
2018-04-13 14:33:55,846 [ 330991] INFO - cidr.xcode.XcodeBuildFramework - 2018-04-13 14:33:55.843 BuildService[64261:3553242] [MT] IDEIndexing: Failed to create IDESourceKitWorkspace: (null)

They have no relation to the issue you're seeing.

If you're still seeing the problem after invalidating caches - please report an issue in our tracker, include information about selected Xcode (from Preferences | Tools | Xcode) and sample project where you see that persistently (any basic project created from scratch), if possible. Also would be useful to attach idea.log (Help | Show Log in Finder).

0
Comment actions Permalink

This also happened to me after upgrading to AppCode.2018.3 from AppCode.2018.2 this morning.

I have a xcworkspace with a pods project and my app project. One of the pods is a development pod. The types in the development pod are resolved fine. But the framework types in my app can't resolve.

 It can't resolve any framework type.
can't resolve class 'NSObject'

I tried the following and nothing seems to work:

  1. Invalidating cache.
  2. Reinstalling AppCode from scratch.
  3. Removing my preferences folder (~/Library/Preferences/AppCode2018.3/) and choosing to start from scratch.
  4. Removing my cache folder (rm -rf ~/Library/Caches/AppCode2018.*).
  5. xcode-select --install
  6. Duplicating my Xcode in the Application project and choosing it as the Xcode version I want to work with in AppCode.

 

0
Comment actions Permalink

Hi,

Could you please contact our support: appcode-support@jetbrains.com, attach a couple of screenshots that demo the problem, and your Podfile contents (if there is any sensitive information, please strip it out).

0
Comment actions Permalink

Just sent it.

0
Comment actions Permalink

What was the issue? It would be nice to know :)

0
Comment actions Permalink

The root cause was that I'm not using "use_frameworks!" in my pod file (and I'd like to keep it that way).

They gave me a workaround. Build your app for the "iOS Device" target instead of simulator and restart AppCode. Had to do it once or twice since.

The issue is tracked here: https://youtrack.jetbrains.com/issue/OC-18010

0

Please sign in to leave a comment.