我的代码有问题。我的代码在Android Studio中被标记为错误代码,但成功构建了gradle并在设备上运行,如下所示:
当前配置:
我已经完成但尚未解决问题的活动:
编辑:似乎来自android支持的每个代码(例如recyclerview,CardView,APpCompact)都出错
这是我的缺点
dependencies {
compile project(':android-crop')
compile project(':RTEditor-Toolbar')
compile files('libs/apache-mime4j-0.6.jar')
compile files('libs/httpmime-4.1.3.jar')
compile files('libs/jetbrains-annotations.jar')
compile files('libs/gcm.jar')
//three party library
compile('com.crashlytics.sdk.android:crashlytics:2.5.1@aar') {
transitive = true;
}
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.vinaysshenoy:mugen:1.0.1'
compile 'com.github.clans:fab:1.5.5'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.curioustechizen.android-ago:library:1.3.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.github.chrisbanes.photoview:library:+'
compile 'com.subinkrishna:circularimageview:1.0.2'
compile 'me.leolin:ShortcutBadger:1.1.3@aar'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'cn.trinea.android.common:trinea-android-common:4.2.15'
compile 'com.sothree.slidinguppanel:library:3.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}
那么如何解决?感谢前进
这是非常常见的情况,每当我启动Android Studio时都会发生这种情况。确保已导入代码需要导入的所有内容后,请执行以下步骤。如果您不确定如何执行此操作,请查看我回答的最底端,它说可能正在发生更多问题。
您可以轻松地进行以下操作来修复它:
清洁项目
重建项目
重新启动IDE
更新SDK工具
这可能与您的代码无关,因此您不必为此担心。如果清理和重建不起作用,请等待一段时间。
给机器人工作室,同时成立,这可能需要几分钟的时间。通常,它甚至无需执行我上面列出的任何步骤即可自行修复。在尝试更新SDK或弄乱任何文件之前,请确保已执行此操作。如果这样做,建议您先进行备份。
我建议您看一下这个问题:
可能会发生的更多问题
另外,根据您的屏幕截图,我在某些相同的地方看到了很多错误。这可能是因为您没有导入正确的内容!单击上面带有红色波浪线的代码段之一,然后等待消息。它应该说些关于进口的东西。然后按ALT-> ENTER。这应该导入您需要的代码才能使该行代码起作用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句