Missing setting.jar when importing a project to Android Studio - android

It was telling me that the module is not backed by Gradle and that it lacks a setting.jar file

I created other project and copy and pasted the setting.gradle file to the folder and then it

Related

After deleting jar file from lib getting error from gradle while building project

I have added a jar file inside app/libs folder. then right click and added jar file as library.The project builds perfectly. After that I have deleted the jar file from libs folder.
Now its showing a Failed to create MD5 hash for file.
using android studio - 2.3.1
I have checked this solution but didn't find anything inside my gradle file.
If you can see the above picture in Android Studio this would be your project structure. Check the Dependency and see if the Jar is still available in the Project

How to add existing Java code to Android Studio as a jar/library?

I have a jar file called PhoneGestures.jar which contains a bunch of java files I want to use in my project, which I have added to my project as a module using New->Module->Import .Jar :
I then added this jar module to my project dependencies like so:
and as you can see it is included in my project's build.gradle:
But now when I go to use one of the classes from my jar file, like "MobXRotate", for example, Android Studio does not recognise it:
Does anyone have any ideas why this might not be working? Thanks.
Make sure you have imported the class if the class isn't been found either,
try build your project first, that gradle copies the source code in your project structure!
There's no need to create a new module for a jar file.
Putting the jar file in libs folder will do the trick.

How to regenerate build.gradle file after deleting

I got an error with my Android project: Gradle project sync failed error, and then I searched the solution here. However, I deleted wrong file(build.gradle instead of .gradle in the user home directory). So how do I generate build.gradle file in Android Studio again?
Open your IDE and just create a file called build.gradlein the root folder if you deleted the top-level file, or inside a module if you deleted it.
It is a text file where you have to write your script.
You can copy the standard configuration, just copying from a new project. Of course you have to customize your file with your dependencies and your configuration.

Java folder in android project and the src is empty

I found a library on git. https://github.com/flavienlaurent/NotBoringActionBar
after imported to the eclipse, I noticed that the src folder is empty and there is a folder called java. Tried to run it anyway but it gave me an error.
Do I have to make some changes before running it?
The project you are trying to import is developed with Android studio, so there is some extra files in it.
To import it in your eclipse you need to import it as normal android project. now your src folder is empty and you have an extra folder named java
copy com package from java folder and paste it in src folder
Delete java and bin folder
Clean and build your project
Run on emulator or device
The Project you are trying to import is a project based on Gradle build system developed using Android Studio.
In such project everything related to code is in App/src/main
/java contains all .java files
/res same as res in eclipse
AndroidManifest.xml
So easiest solution is create a new project in eclipse and copy paste the file accordingly,
In you case
Copy the src/com directory in /src in eclipse
Copy the /res in to /res directory of created project
Replace AndroidManifest.xml
But it is strongly recommended to migrate from Eclipse to Android Studio instead of doing all these because now all the libraries available are migrating in to gradle.

NoClassDefFoundError when project imported to Eclipse?

I am working on an app which uses Commonslang.jar libraries. I was trying to setup it on a new system with newly installed Eclipse.The project is not showing any error But when I run the project it force closes with NoClassDefFoundError at each point where I use Commonslang lib.
I dont know how to fix this problem.Please help?
I think there are "lib" folder in your project directory so just change it "libs" instead of "lib" and clean project and check it..
> Note: No need to build path for any third party library
You need to create libs folder in your project and copy that jar file there. Then in eclipse, right-click on that jar file (which is in libs folder) select Build Path and then select Add to Build Path.
Remember: if you are using a jar file in your Android Library Project, and associating that library project with your regular UI
project, it won't be enough. You must need to include that jar file
(as described above) in both of your projects (Android Library and UI
project) to make it work.
Have you added the jar to the Java Build Path?
Go to the Properties for the Project and select Java Build Path -> Libraries tab then add the external jar there.

Categories

Resources