Related
hello friends i am new to android studio(ver :3.6.1) and gradle(ver:6.0.3) i have just somehow installed it (means my gradle was not installing or taking time so i manually installed files in chrome and placed it in folder and everything is okay but due to version upgrade i am facing this issue) and when i used to sync it , it shows me error that the Deprecated Gradle features were used in this build, making it incompatible with
Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings then i did same build with --warning-mode all and i got this message --Executing Gradle tasks as part of an undefined build has been deprecated. This will fail with an error in Gradle 7.0. Consult the upgrading guide for further in
formation: https://docs.gradle.org/6.3/userguide/upgrading_version_5.html#executing_gradle_without_a_settings_file_has_been_deprecated
afterthat i went to the given link and then i found this
Have A look to Image
i don't know how to write the setting.gradle or setting.gradle.kts file and where to save it i once tries to save it in my gradle home folder but it gave me another error that the method i used to do so is not known i have attached my gradle project build log screenshots
have a look to image
thank u i hope u will help me please give me suggestions and help me to do it ππ
No need to hurry - as long as you don't upgrade to Gradle 7.0 nothing bad will happen. And since Gradle 6.3 has been released quite recently the next release is at least 5 to 6 weeks away...
If your project is a simple project without subprojects, the settings.gradle file can be an empty file (though it needs to exist).
You must place it into the same directory as your build.gradle file.
You need more content in the settings.gradle file if you start creating multi-project builds. The documentation about multi-project builds is part of the gradle documentation (what a surpise!): https://guides.gradle.org/creating-multi-project-builds/
Detailed information about the allowed settings are available at https://docs.gradle.org/current/dsl/org.gradle.api.initialization.Settings.html
I know this question has been asked here a few times before. But i haven't seen any possible solution yet.
Before i make the project 'Run as Android Application' , if i do not clean it, i receive the following error and have to restart Eclipse ... and clean again.
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define
Lcom/jstun/core/attribute/MessageAttributeInterface;
com.jstun.core... is a part of my src folder, of course i can't remove it. And even if i remove that package, another package will show up as an error like:
Unable to execute dex: Multiple dex files define
Landroid/support/v4/app/ActivityCompatHoneycomb;
I've seen this error since updating to ADT 15, i'm using Eclipse Galileo on Ubuntu
Do you have any idea? Thanks for any reply!
This is a build path issue.
Make sure your bin folder is not included in your build path.
Right click on your project -> go to properties -> Build Path.
Make sure that Honeycomb library is in your libs/ folder and not in your source folder.
Include the libraries in libs/ individually in the build path.
BTW, you may want to bring in the android-support-v4 library to get Ice Cream Sandwich support instead of the Honeycomb support library.
I have encountered a similar error today and the reason was that the support library was referenced by two library projects used by my app project but with different versions.
In more details:
My app depends on 2 library projects
FaceBookSDK 3.0 -> which is referencing android-support-v4
ActionBarSherlock -> which is referencing android-support-v4 but with a modified version to support maps.
To solve the problem I had to make FaceBookSDK library depend on ABS library instead of the support library directly.
Well for me, I deleted the file in the libs folder called android support v4.jar and it all worked out. Goodluck :)
I had the same error happening and every time I fixed it, it would come back after I restarted Eclipse.
First of all, as other people said, make sure you do not have multiple copies of the same .jar file around your projects.
In my case, I had a main project that used ActionBarSherlock (among other library projects). The trick that worked for me was going into ActionBarSherlock --> Properties --> Java Build path --> Order of Export and unselecting Android Private Libraries. Then going into Project -> Clean and now you should be able to build the project correctly.
Now, for some reason, every time I restart Eclipse, it automatically enables that checkbox, so I have to repeat this process again.
Hope this helps some lost soul out there :)
Go to Project/properties and Java Built Path and unchecked the Android Private Libraries
To me, just go to Project Properties >> Java Build Path >> Order and Export. Uncheck all external library, as the image bellow. It work for me. Hope this help.
I have also faced this problem in my project. AVD is not able to reload assets,lib,res and etc folder contexts.
problem :
Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.
Then,I created new projects and copied MainActivity.java,activity_main.xml, drawable context.
Then delete old project from package explore,restart your Eclipse and AVD.
My project is now working properly.... :)
I hope this steps will help u little bit folks..!!
I have same issue, what i tried is:
List item
Open Project Build Path,
Select "Libraries" tab,
Remove all library except the Android Library
Adding all required JARs Files,
And Done!
It works for me, thanks.
If some of you facing this problem with facebook-connent-plugin for phonegap
try to remove files in bin/class/com/facebook/android directory ! -> and rebuild
As others mentioned, this occurs when you have multiple copies of the same class in your build path, or elsewhere in your setup.
I had added android-support-v4.jar to my libs/ folder, and somehow eclipse added a second copy to bin/classes/android-support-v4.jar.
You can test for this with
grep -r YourOffendingClassName YourApp | grep jar
Deleting the extra copy in bin/classes solved the problem - unsure why Eclipse made a copy there.
I got this error for another reason. I was mistaking adding both the v4 AND the v13 support library. This was not necessary for me since my minSdkVersion is 15.
I fixed it by only including the v13 support library. Also, make sure to check mark the library in your exported library build path in eclipse. I also moved it to the top.
Even after going through multiple answers, no solution worked for me.
I deleted "Android Dependencies" from the build path.
Added all the jar files again to the build path and the error was gone.
Somehow eclipse seemed to cache the things.
I'm leaving this answer for someone who gets in this scenario as I did.
I stumbled here and there before noticing that I mistakenly dragged and dropped the Support Library JAR file into my src folder and it was lying there. Since I had no idea how it happened or when I dropped it there, I could never imagine something was wrong there.
I was getting the same error, I found the problem after sometime and removed it. Project is now working fine.
The Solution for me was just to do following things:
->lib directory in your project and delete any multiple elements.
Project->Properties->Java build Path and delete any Dependency Library was added automatically and not by you! ->Apply
Restart Eclipse IDE
Now Clean the project.
Run/Debug on Device/Emulator the project ...
Good Luck
My problem at first was:
Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
1) I Right click on my project -> Android Tools -> Add Support Library
(Run my app...Didn't work so I keep it going...)
2) Right click on my project again -> Properties -> Android -> Check Android 4.1.2 (16) on Project Build Target
(Run the app again...and get this:
Unable to execute dex: Multiple dex files define Landroid/support/v4/app/BackStackState;
3) So I went to the "lib" folder on my project and delete the "old" Android.support.library.jar
(Run the app and cross fingers and...)
Β‘IT WORKS!
Hope it helps someone...Thanks people!
I have had this issue and that doesn't mean, that the same library is loaded many times but System is trying to load a class with the same name and possibly same package name simultaneously, i.e.
com.pack1.de and Class Geometry of library1.jar
and another
com.pack1.de and Class Geometry of library2.jar.
How should you approach?
You should analyze which methods are being used, a method of library1.jar or library2.
There are 2 Solutions,
Rename a packagename and then dalvik interprets, that they are distinct classes
Or if you want to risk, purge the class, which doesn't contain the methode, which we really use.
I hope that has clarified this often asked question.
I removed Android dependencies from build path and it worked.
This error happened to me when in my app's project I referenced a Library project in my Eclipse workspace (in my case the Facebook SDK) and at the same time included the Facebook SDK as a jar in the libs folder. Removing the library reference but keeping the jar in the libs folder removed the error.
I had same problem. I had to delete the .apk file and then it worked.
For me I deleted android-support-v4.jar from lib folder and also removed from build path.
Right click on project and go to build Path>configuration build path
Select library tab and click on support-v4 library and click on remove
Click on OK
and then clean your project and run it will work :-)
In case anyone else bangs their head on this issue like I just did:
My case involved a chain of library projects. Simply doing a project clean on all of the libraries fixed everything
I found below solution in eclipse...hope it works for you :)
Right click on the Project Name
Select Java Build Path, go to the tab Order and Export
Unchecked your .jar library's
This problem occurs when a same library is added into your project multiple times. If you haven't added the library multiple times intentionaly, check out the dependency/private libraries of the libraries you have added in your project, most probably they have already included a library which is causing this conflict.
I was also struggling to find this is issue. In my case what happened is while copying the apk to email (drag drop) - by mistake the apk was pasted in src folder in one of the packages.
After removing the apk from source folder it worked fine.
I had this problem in Intellij and it was because the ActionBarSherlock library I added to my project defined the android-support-v4.jar as a compile dependency and this jar was already included in my project so there were multiple copies/version of DEX at compile time.
The solution was to change the ActionBarSherlock module dependency for this jar to be Runtime instead of compile, as my project was already providing it.
For me the issue was that, i had added a lib project(autobahn lib) earlier and later switched the to Jar file of the same library.Though i had removed references to the older library project, i was getting this error.
Following all the answers here i checked the build path etc. But i haven't added these libs to build path manually. So i had nothing to remove.
Finally came across this folder.
bin/dexedLibs
I noticed that there were two jar files with the same name corresponding to autobahn Android which was causing the conflict. So i deleted all the jar files in the dexedLibs folder and rebuild the project. That resolved the issue.
To add the myriad of other potential sources... I had updated all the libraries in my project's lib folder but then Eclipse "helpfully" reinstalled all the original libraries. There was no longer any reference inside Eclipse to these libraries but the external dex-maker program just grabbed all the files in the lib directory and thus got two versions of several library .jar files.
git status identified the new files and git clean -f got rid of them for me (though I sometimes had to wait or restart Eclipse on Windows because it still had the files open from the copy).
ULTRA simple solution and finest:
Remove everything in Right Click Main Project's Folder -> Properties -> Java Build Path except Android X.Y (where X.Y is the version in android). Clean, and Build. Done!
Make sure before of that to have a single android-support-v4.jar.
If you are using cordova, try cordova clean command
In android studio I keep getting this error message when building.
I've tried
deleting the .gradle file multiple times and restarting the IDE but the error doesn't seem to stop.
I made sure that I've updated EVERYTHING there is in SDK's and other things it required.
I've tried several solution -
First Solution: Go to File -> Invalid Chaches/Restart...
Second Solution: First, Build -> Clean Project and the Build -> Rebuild Project
Third Solution: First close the project and remove from workspace of Android Studio, then Go to C:\Users\user.gradle then delete .gradle folder. After that Open the project again.
But none of them worked! Then i got a solution, which worked in my case, the solution is bellow -
In my case, the problem was in gradle version. Check your Gradle version File -> Project Structure(Ctrl+Alt+Shift+S) and Plugin version also.
Delete the XXX.Lock file, and rerun the project. You should be able to find the location of this .lock file in the error message
is solved mine by downloading the latest version the latest version of gradle distribution.
https://services.gradle.org/distributions/
I've used KSOP2 in my project and it worked all these days. Recently I bought a new machine and moved my project to new machine and imported the ksoap library to project etc etc and when I try to run the application I get following error in the emulator
Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
this is the place where exception is thrown.
SoapObject request = new SoapObject(namesapce, methodname);
has is something to do with 64 bit machines??
How come the app that worked all these days stopped working all of a sudden?? Can someone enlighten me please. I'm stuck with this. Thanks for your time in advance.
I had similar problem, simply I forgot to check checkbox on kosoap2 library in Java Build Path options, Order And Export tab :)
I managed to solve the problem by
Creating a folder "libs" in the project
Copying the external jars in to the folder
Refresh the folder
Go to properties -> Build path -> Add Jar (not external JAR)
Clean the project
Restart Eclipse
Boom it worked for me. Hope it'll help others too.
This may be related to the latest Android plugin and tools (r17). I read somewhere that external jar files need to be run through the dx --dex tool (because of the different binary format of Java binaries in Android), but it didn't work for me. What I ended up doing was adding the project as source instead of compiled binaries (by linking to the source from the project and adding it as a source folder.) This way Eclipse builds it properly and Android finds it during runtime.
So I have a maven module (module-A) in IntelliJ. I recently moved some classes from it into another new maven module (module-B) and added a dependency to it. Once I had done this I also modified the signature of a method of one of the moved classes (now in module-B).
I re-imported the poms so that IntelliJ would pick up the dependency changes and ensured all Java imports for the affected files were correct again. Now when I attempt to run my webapp (which depends on the two modules) I get a compile error in a class in module-A calling the modified method of the class in module-B.
The error message is basically saying that that method doesn't exist but believes the old method still exists! I click on the 'make' error and it takes me to the line in a class in module-A calling the modified method...the weird thing is, IntelliJ knows it is fine in the file. i.e. The method is not underlined in red like a compile error would normally be, but the class file name is :(
I compiled it from the command line using 'mvn install' (having also installed module-B) and it is all successful. I have deleted the classes directory in the target of both module-A and module-B and also invalidated IntelliJ's caches and restarted...still happening...any ideas?
I found out that this might help:
File -> Invalidate Caches
Maven Projects -> Reimport should help.
I spent a few hours on this same issue. All of the cleans in the world didn't help.
I deleted my out and target directory in my project and recompiled - that cleared it.
Edit: There is also a magic feature under the file menu: "Invalidate Caches / Restart" This fixes a bunch of "intellij is confused" problems.
Change "Java Compiler" setting in IDEA (User compiler javac in-process) to fix the problem.
Try to mvn clean your projects and mvn install your project B.
The maven integration with intelliJ is kind of buggy when you use the make command directly provided by Intellij. You should directly use the mvn commands, or start them from the maven panel.
I ran across a very similar problem that was driving me insane.
My code would compile fine with the ant task I normally run, but it would not build in IntelliJ, complaining about "Cannot Find Symbol blah blah"
Turns out, you can add "Excluded" files for the compiler. My file somehow got added to that list.
This list is located in File > Settings > Compiler > Excludes (IntelliJ 13)
Following steps should fix this problem :
delete .IntelliJIdea12 / .IdeaIC12 older under c:/user/.../
Invalidate Intelli's cache: File > Invalidate Caches.
This re-indexes your workspace on start-up and also clears your local history. Before you do this, commit or back up all your uncommitted changes.
Once your workspace is back after indexing, do a maven clean install.
when the build is successful, click on Maven Re-imports
This worked for me, I think it should work for others too with a similar problem.
So just stated it up this morning and it's all working!
Last night what I did do was open a new project (intelliJ project) from module-A's and module-B's parent pom and successfully got it to build, possibly doing that and then opening my original project again fixed it somehow...very annoying though
The behavior I see is similar to the one described by the original author.
Error markers show up on the right side of the editor in Intellij 14 and less so in 13.
This happens also if using Scala instead of Java and using SBT instead of Maven.
Also noticed this occurs after the second project is loaded. The first is always fine.
(After much trial and error) Figured it might be caused by Intellij's internal caches becoming somehow corrupt. "Invalidate caches" worked sometime and sometimes did not.
I work with a number of projects using Play! Framework and they use different versions of Scala and lots of dependencies.
I hypothesized the caches become corrupt because the internal key Intellij uses is not good enough to handle situations when the same class, loaded multiple times in different jars, has different signatures, and this results in the editor errors while external builds work fine.
Then the "Changing Ivy Cache Location for sbt projects in IntelliJ IDEA?" post gave the idea to segregate the ivy cache SBT and Intellij use in the hope that the ivy path is part of the internal cache key.
Paul Phillips of TypeSafe provide the "SBT extras" tooling and here I found a way to instruct SBT to use a project based ivy home, cache and SBT boot:
https: //raw.githubusercontent.com/paulp/sbt-extras/master/sbt
declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy"
How to configure Intellij
: see http://content.screencast.com/users/SemanticBeeng/folders/Snagit/media/ec8ec491-6d0c-4691-9598-916a63ba65ef/12.02.2014-08.59.png
Then did the same for the external SBT build to work in sync
: see http://content.screencast.com/users/SemanticBeeng/folders/Snagit/media/dcb287c4-200f-47f3-a937-42865675a22b/12.02.2014-09.01.png
Finally got rid of the user home based .ivy2 and all the contents.
To be sure Intellij does not use this folder I made it readonly.
This was a mistake. Intellij seems to silently fail resolve dependencies if you do this.
This solved the errors and believe they will not come back. :-)
If Intellij guys hear this: please test your releases (Scala, SBT, editor) with all the Play Framework templates from TypeSafe. The problem becomes apparent quickly this way.
I just had a similar issue that was driving me insane. I had done all the other things mentioned in the answers above because I have used Intellij forever, but none worked. In the end I found out that in the maven projects portion of Intellij, one of my modules had been marked "ignore" a simple unignore command from the context menu did the trick.
In my case, I had manually marked a directory as "Test Sources Root" but IDEA marked it on a parent Maven project. Unmarking it in File->Project structure...->Modules fixed the problem.
This could happen if you are using different version of java while building outside IntelljJ. My IntelliJ had java10 and I was using java8 while building at terminal. Changing java version to IntelliJ fixed this issue for me.
I had a very similar behavior. Running (Scala-)tests would always fail due to errors in unrelated java classes during the 'make' step.
It turned out, I had included a 'global' SDK library that collided with one of the dependencies from the project. A proper helpful error message only showed up after I deleted the 'make' step from the test.
I then deleted the duplicate library, re-added the make step to the test and everything is now working fine.
I ran into this problem today after upgrading from 12 to 13.
Later I fixed issue as I used the same name for Project and Module and looks Intellij allows this but cannot handle it correctly.
No idea why setting will impact the compilation, although there is no error in java editor. Should be a bug in version 13.
I was facing a similar issue after upgrading from IntelliJ 12 to 13. After multiple uninstalls and re-installs (of multiple intelliJ versions), numerous cleans and .m2 repository clearing, I finally figured out what my issue was.
In my intelliJ settings, the repositories mentioned in my main POM file could not be connected to. this was in turn due and alternate repository that was mentioned as a part of my pom file.
Once the POM was made to point to the correct repository, all my classes had their compilation issues resolved.
To check if your repositories are being connected to, go to File -> Settings -> Maven -> Repositories
Here, your indexed maven repositories should be connected to successfully. If they are not, then intelliJ will not be able to resolve most 3rd party and module dependencies.
I'm embarrassed to say, but we also had this problem, but it was due to a mistake in our package name.
When creating the packages for a new project I accidentally created a package called "org.package".
My project then had a directory structure like:
/src/main/java/org.package/
Which caused all sorts of havoc with IntilliJ.
Once the correct folder structure was created on the file system, IntelliJ worked great.
/src/main/java/org/package/
Note the difference in /org.package/ vs /org/package/
The fix was i made it javac instead of Ajc and i put 1.8 of course according to your jdk version.
for some reason when i invalidate and restart intellij it was set to be the default !
my version is
This happened to me...what fixed it was realising there was an extra main.iml file in the source directory. Deleting that instantly made the compile errors go away.
None of the above answers worked for me.
In my case, I had to finally create an explicit Maven Run Configuration for the module (with Command Line as "clean install") and then run it.
It is in Run > Edit Configurations
close the project
go-to the project folder and delete idea project file and .iws file
run mvn idea:idea
restart the project.
seems idea keeping the old project dependencies without cleaning even though we run file -> invalidate caches
Setting the proper Java SDK solves the issue
Right click on the project and select "Open Module Settings"
Check if you have the right Java SDK under platform settings
Check the SDK under Modules
Rebuild the project from "Build" menu
Delete the installation directory.
Remove the following directories:
~/.config/JetBrains/
~/.cache/JetBrains/
~/.local/share/JetBrains/
This will remove each and every configuration plus installation of jetbrains tools, be it IDEA, goland,etc.
Now install everything from scratch.
That's the only way it worked for me