找不到符号类SetContentView [英] Cannot find symbol class SetContentView
问题描述
将Eclipse项目导入android Studio之后我遇到了这个错误
After importing Eclipse project into android Studio I had this Error
代码:
import com.android.molley.SetContentView;
..
SetContentView setContentView =new SetContentView(context, activity);
错误:
错误:(14,26)错误:包com.android.molley不存在
Error:(14, 26) error: package com.android.molley does not exist
错误:(101,33)错误:找不到符号类SetContentView
Error:(101, 33) error: cannot find symbol class SetContentView
推荐答案
这是因为您的eclipse项目包含较旧的支持v4 lib jar文件,而您将其迁移到将使用com.android.support:support-v4自动编译的Studio:23.4.0按照模块的compileSdkVersion.
This is because your eclipse project contains older support v4 lib jar file while you migrate it to studio that will automatically compile with com.android.support:support-v4:23.4.0 as per your compileSdkVersion of module.
您必须应用与eclipse&相同的support-v4为此,您必须从模块的lib文件夹中手动应用依赖项
You have to apply same support-v4 as eclipse & for this you have to apply dependencies manually from your modules lib folder
compile files('libs/android-support-v4.jar')
并在迁移后从应用程序模块中删除此行
And remove this line from app module after migrate
compile 'com.android.support:support-v4:+'
这篇关于找不到符号类SetContentView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!