android-studio-import

Report unused imports as error in Android Studio or IntelliJ

天大地大妈咪最大 提交于 2021-01-28 20:29:40
问题 Is there any way/setting in Android Studio to report the unused imports in java files as error? In Eclipse, lint reported this as error pretty easily. 回答1: Applies to Android Studio and IntelliJ You could go to File/Settings then browse to Editor/Inspections/Import. Change Severity of Unused Import to Error 回答2: try this. its automatically remove unused imports yourProject --> Right Click --> Optimize Imports lint : its also show unused imports in java files as error yourProject --> Right

Error:(1, 0) Plugin with id 'com.android.application' not found - no build.gradle file

こ雲淡風輕ζ 提交于 2019-12-25 09:05:11
问题 i have imported an Android Studio project, into Android Studio yet the error appears: First Screenshot Error:(1, 0) Plugin with id 'com.android.application' not found. It appears on import that the Build.gradle file for the project and the settings.gradle file were not created Second Screenshot this is log file : 2017-01-05 15:07:25,745 [ 381987] INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle for project 'app' failed: Plugin with id 'com.android.application' not found. Consult IDE

Could not find method android() for arguments

瘦欲@ 提交于 2019-12-17 04:30:15
问题 I've been trying to import a project to Android Studio and this is where I am stuck, there is a similar question on Stack Overflow but it did not provide a solution to my particular error. This is my error log: C:\<some location>\build.gradle Error:(24, 1) A problem occurred evaluating root project '<project name>'. > Could not find method android() for arguments [build_4fli1jm76ubcnxesnhqnhie47$_run_closure3@6e71db85] on root project '<project name>'. Information:BUILD FAILED The Gradle sync

how to resolve Multiple dex files error in Android studio

我与影子孤独终老i 提交于 2019-12-11 11:16:03
问题 I started using Android studio 1.2.0. My project dependent on 2 library projects. So, I imported eclipse project to Android studio and added 2 library projects. Gradle build is successful. When I try to run it, I am getting below error * What went wrong: Execution failed for task ':dexDebug'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: F:\AndroidStudioSetup\build-tools\22.0.1\dx.bat --dex --no-optimize --output F:\3.0 Studio Migrartion\SdkSample\platforms

How can Android project compile when imported class is missing in SDK?

删除回忆录丶 提交于 2019-12-06 20:27:35
问题 OK, perhaps it is very simple, but I just can not figure it out right now. I have imported google sample project Card Reader in Android Studio 1.5.1, it compiles at compileSdkVerison 23, it works on my Mobile. Then I walked through the SDK while came to source code to android.nfc.tech.BasicTagTechnology , I found TransceiveResult inside android.nfc.tech.BasicTagTechnology#transceive couldn't not be resolved then I found the class TransceiveResult is missing in my D:\Android\sdk\platforms

How can Android project compile when imported class is missing in SDK?

拥有回忆 提交于 2019-12-05 01:49:34
OK, perhaps it is very simple, but I just can not figure it out right now. I have imported google sample project Card Reader in Android Studio 1.5.1, it compiles at compileSdkVerison 23, it works on my Mobile. Then I walked through the SDK while came to source code to android.nfc.tech.BasicTagTechnology , I found TransceiveResult inside android.nfc.tech.BasicTagTechnology#transceive couldn't not be resolved then I found the class TransceiveResult is missing in my D:\Android\sdk\platforms\android-23\android.jar , but presents in Android source code here D:\Android\sdk\sources\android-23\android

Import eclipse project to Android studio - error “this project refers to Eclipse workspace…”

岁酱吖の 提交于 2019-12-03 14:48:52
问题 I tried to import an existing project eclipse to Android Studio, but I got a dialog message in import that I can't solve : "this project refers to Eclipse workspace relative path in its project metadata. To help import the project, please point to an Eclipse workspace directory." please check screenshots How I can solve it? Thanks so much in advance 回答1: Simply delete all the folders and files from your project except manifest res,src and then import it in Android studio using Import from

Project already contains module with this name — Android Studio

爱⌒轻易说出口 提交于 2019-12-03 09:23:59
I had successfully imported a Module in my Application project in Android Studio . Then I deleted or removed the module by following the below link: How to delete a module in Android Studio I also removed the project module from the dependencies of my build.gradle(app) file. Now, When I need to again include the same module project in my Andorid Application, it doesn't allows me, and gives the Project already contains module with the same name error. I had check in my Project, Package, Android Structure but the project module which i need to Import and add as a Module Project is not there but

Project already contains module with this name — Android Studio

我怕爱的太早我们不能终老 提交于 2019-11-30 14:27:29
问题 I had successfully imported a Module in my Application project in Android Studio . Then I deleted or removed the module by following the below link: How to delete a module in Android Studio I also removed the project module from the dependencies of my build.gradle(app) file. Now, When I need to again include the same module project in my Andorid Application, it doesn't allows me, and gives the Project already contains module with the same name error. I had check in my Project, Package,

How to build the native Android sources from Codename One's build server

僤鯓⒐⒋嵵緔 提交于 2019-11-29 22:46:14
问题 I'm using the new gradle build switch when sending an Android build for Codename One. One of the highlighted benefits of building with gradle is the ability to open/run in Android Studio and indeed the project opens for me but I'm getting the following error: Error:Unable to load class 'org.codehaus.groovy.runtime.StringGroovyMethods'. Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re