Android Studio HoloCircularProgressBar Library - android-studio

I am trying to add the project https://github.com/passsy/android-HoloCircularProgressBar as a library to my project using android studio. I have added the project as a module and loaded it into the build.gradle file and added the dependency as well.
dependency {
compile project(':HoloCircularProgressBar')
}
No matter what it won't be able to find the attr 'cicularProgressBarStyle' and even in the xml it says unable to locate class file.
Would appreciate any help on this matter.
Thank you.

To import this plugin in Android Studio, complete the following steps:
Download the latest version of the plugin and extract the library directory
(rename it if you want - I've called mine circularProgressBar)
Create a new directory called libraries at the root of your project in Android Studio
Put the previously extracted library directory into into the new libraries directory
Go to your settings.gradle (also at the root of your project) and add the following:
include ':libraries:circularProgressBar'
Now go to File > Project Structure, select your module and click on the Dependencies tab, then click '+' and select 'Module Dependency'. You'll be prompted to select the holoCircularProgressBarModule. Select it and click OK.
Do a Gradle Sync and the project should be successfully imported.
This was completed using Android Studio 0.5.8

Related

Can't understand Gradle settings file,please add the path 'aar_file_name' manually error in flutter

I want to add .AAR file into my flutter project. How to add .AAR file ?? please help
I follow this steps in my android studio but it not work
File --> New --> New module --> import JAR/AAR package
it give this error
Can't understand Gradle settings file,please add the path
'aar_file_name' manually error in flutter
Open the andriod Module
enter image description here
Then import aar file in the andriod module.
I faced the same issue. In my case, it was missing settings.gradle file. Make sure that the file exists at your project root. If not, just create an empty file and try again. This worked for me.
In my project open android module in android studio was disabled due to lost of xxx_android.iml file in android directory After
adding xxx_android.iml file I could able to add my xxx.aar file in to project

Flutter: How to import existing Flutter project, as a gradle project

How to import existing Flutter project, as a gradle project? 'Import Project' wizard asking for Gradle home path.
I have gradle, installed in my system. But what (which path) needs to set here.
Here is, what I'm trying:
Error
I had also gone through this problem where I have to import the existing Flutter project in Android Studio. I was able to import the project following below steps:
Open Android Studio
Goto File -> Open -> In Open File or Project window select the project you want to import.
Once you have done above steps try to resolve warnings shown in the log window. Warnings may be like update dependencies used in the project, etc.
Hope it will help you out.
I faced the same issue.
The gradle home directory (on my Windows machine) is located under:
C:\Program Files\Android\Android Studio\gradle\gradle-4.1
(please check the gradle version).
This will allow you to open the project. Then, you will most certainly need to "upgrade to gradle".
If this does not fully work, you might also consider using Visual Studio Code, which makes the "import" much easier: simply open the folder where you project resides. Optionally, you will have to resolve missing packages (-> Fetch packages). It should then be possible to run the project.
Hope this helps.
File - Open - Select the project root directory
Open Flutter settings from the tip menu - Click the pull-down menu, then flutter sdk dir appeared
Run
Or you can just use the flutter run command after step 1.
If you first add the flutter plugin for Android studio, then you can directly import the project as an Android Studio project and it should work fine.
In my case, having Android Studio 3.4.2 and Flutter 1.7.8, I only needed to:
1 - Open the project with the option "Open an existing Android Studio project".
2 - Run "flutter pub get" to get the packages listed in the pubspec.yaml file.
3 - Run the project with "flutter run"
If you are using Google services, don't forget to add your google-services.json file in your project. In another case, the project will fail without a clear message when you try to run it.
For Import exiting Flutter project.
Please choose Import Project because of Android Native application mean import use of android app only.
So use File -> Open -> Select Project root directory.
After open if ask for dependencies then Choose to Get dependencies

unable to import library project in android studio

I have modified library project of finestwebview here
I tried to add this library project in to my android studio's project but I got several errors saying configuration with name 'default' not found android studio.need help. I wasted my 1 whole days trying this but unable to add.
what I tried is
I copied the library project into the libs folder of my root project,and added 'include:libs:finestwebview' in setting.gradle file.
Also going to
file->project structure->app->dependencies
added the module and sync the project but cannot achieve the desired outcome.
You are including a project, so for that you should add it as a module, and say compile project in your app's gradle dependencies to use it in your app module.
go to
File->New->Import module and add your library project folder
you will have to name your library project there
then you need to say
`compile project(':yourlibraryProjectname')`
in your gradle dependency

Why does Android Studio download gradle each time a new gradle project is imported?

Why does Android Studio download gradle every time I try to import a new project?
Initially, I imported one gradle project for which Gradle 2.1 was auto-downloaded. Subsequently, for a second project import, it downloaded Gradle 1.10. Now again while importing a third project, it has downloaded Gradle 2.2.1.
What is happening?
Projects can declare which Gradle they require to run (see gradle.properties file in gradle directory in the root of the project).
Android Studio uses this information to download and run the right version (it's actually not Android Studio, it's the Gradle Wrapper running inside it). And it's a good thing.
What you can do?
Wait. Once you have the version downloaded in ~/.gradle directory, it will be used for any project declaring the same version. It's one-time cache.
Disable the usage of the wrapper when you import the project. I really recommend against it! You project might not build because of that.
Same happens to me.
The answer of JBaruch is allright.
1.- When you're opening a file on the option Gradle project: select the build.gradle that cames on your project
2.- Select the option "Use local grade distribution" and in Gradle home option; go and select in C:\Program Files\Android\Android Studio\gradle\gradle-2.2.1
It will not ask you to download it again (except if needs other version)
...well, here's what I normally do to speed up the initial build on opening a project (target):
1- open a project you already have working and open the file gradle-wrapper.properties a copy the following line (your project most likely will have a different version):
distributionUrl=https://services.gradle.org/distributions/gradle-6.7-bin.zip
2- paste it and replace the code on the same file on the target project
3- open the file build.gradle (project code) from a project you already have working and copy the following classpath, (again, your project most likely will have a different version)
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0-alpha15'
// ...
}
4- paste it on the same file on the target project
This way you can speed up the build of the target project while avoiding the usual 100Mb or so Gradle download.
Basically it downloads the Gradle build files for your current project according to its version and this whole work is done by your gradle wrapper which actually looks towards the basic requirement for your project and downloads the files according to that so whenever you are going to use any another projects of same version or with same requirements then it will not download any additional file at that time.Its just a one time shot!!!!
It usually downloads the Gradle updated version & and external dependencies for each project rather than fetching it from the cache.
So follow these steps:-
Go to settings
Search for Gradle
Untick Download External Dependencies Option.

Android Studio: Module won't show up in "Edit Configuration"

I've imported a project to Android Studio with several subprojects.
I want to run a subproject.
I successfully made this subproject's build.gradle as a module.
In order to run it, I went to Run > edit configurations > + > Android Application.
Problem: When I try to select a module, none show up in the drop down list.
Why is this?
EDIT: it shows up as a module under Groovy but not showing under Android Application. How do I get it to show up under Android Application?
Make sure your build.gradle is
apply plugin: 'com.android.application'
not
apply plugin: 'com.android.library'
After you have changed, please sync your gradle again.
I had similar issue when I selected parent directory of my project, I resolved by Close Project -> Delete Project from Android Studio -> Import Project by selecting right build.gradle file.
Make sure you select right build.gradle file while import.
I fixed this by adding facets in Module settings. They were missing.
right click on project > open Module settings > Facets > Add facets ( "+" sign at the top ) > Android.
After adding facets you will have modules.
UPDATE:
For latest version of gradle, Facets have been removed, you can directly add modules now.
right click on project > open Module settings > Add module ( "+" sign at the top ) > Phone and Tablet Application (Now you can create a new module and configure it).
In Android Studio 3.1.2 I have faced the same issue. I resolved this issue by click on "File->Sync Project with Gradle Files".This works for me. :)
resolved this issue by clicking on "File->Sync Project with Gradle Files"
New project. Fixed this issue by clicking on "File->Sync Project with Gradle Files"
I have tried all the options with no luck. So I have ended up with my working solution. Just make following steps:
Close android studio if open.
Copy module(project) in your current workspace.
Start android studio.
You will see added module in project structure.
Open settings.gradle of your project and include ':YOUR_MODULE_NAME'.
Sync gradle and you can see module is successfully added to your project.
Try,
Files > Sync Project with Gradle Files
or
Files > Sync with File System
Should do the trick.
goto Android >> Gradle Scripts>>Build Gradle(Module :app)
make sure the first line of this file is like this.
apply plugin: 'com.android.application'
not like this
apply plugin: 'com.android.library'
The following worked for me:
edit the overall project's 'settings.gradle' file and add a line at the bottom to include your new module (include ':myNewModule') - e.g:
include ':myNewModule'
Synch gradle.
Add a build.gradle file into your new module directory. You need to make sure the first line says 'apply plugin: 'com.android.application'. Simply copying a build.gradle from another module in your project, if you have one, seems to work.
Synch Gradle
Your module should now show up in 'Edit Configurations'
This mainly happens when you copy a library project and try to build it. The solution would be to add
apply plugin: 'com.android.application'
in the build.gradle file, instead of
apply plugin: 'com.android.library'
Then do a gradle sync
This worked for me: File > Project Structure... > Modules > Green Plus Symbol > Import > Then Select The Project
In your module build.gradle file make sure you have the correct plugin set. it should be
apply plugin: 'android'
No configuration was deteched because IDE was unable to detech modules (<no module>).My compileSdkVersion and buildToolsVersion was 28 in build.gradle (app module)
android {
.
.
compileSdkVersion 28
buildToolsVersion 28
.
.
}
But SDK was not installed. So then I installed it first and it worked for me !!!
It appears different solutions work for difference people, for me just closing the project and importing it again resolved the problem.
I finally figure out why the module is not showed up when I add configuration for AndroidTests for a com.android.library module.
If you include your library module in your application's build.gradle like this:
compile project(':yourlibrary')
Since for library module it is compiled with release mode by default, you can't run Android Tests for it, that's why it won't show up in the module list.
I fixed it with following modification:
Add following configuration to the build.gradle of your library module:
publishNonDefault true
By make following changes, you can debug compile your library by editing the build.gradle of your application module like following:
- compile project(':yourlibrary')
+ debugCompile project(path: ':yourlibrary', configuration: 'debug')
+ releaseCompile project(path: ':yourlibrary', configuration: 'release')
Then sync it and you'll find it shows in the list.
Android Studio 4+
1- File -> Close project
2- Delete .idea folder
3- Open project again
It was fixed for me after removing and re-adding the Android and Android-Gradle Facets in the Module Settings dialog.
I managed to fix it in Android Studio 1.3.1 by doing the following:
Make a new module from File -> New -> New Module
Name it something different, e.g. 'My Libary'
Copy an .iml file from an existing library module and change the name of the file and rename references in the .iml file
Add the module name to settings.gradle
Add the module dependency in your app's build.gradle file 'compile project(':mylibrary')'
Close and reopen Android Studio
Verify that Android Studio recognises the module as a library (should be bold)
Rename module's directory and module name by right clicking on the newly created module.
Enjoy :)
The following are methods to help you:
Close and Open Project again
Close and Open Android Studio
Clean Project
Rebuild Project
Instantiate and Restart
Make sure you have included :app
Import the Project
I added this line to my app.iml file and it works
orderEntry type="library" exported="" name="appcompat-v7-19.1.0" level="project" />
For me it was fixed by simply restarting Android Studio.. Like the good old days of Eclipse
In my case problem was from a higher (or not downloaded) compileSdkVersion and targetSdkVersion in build.gradle(app).
This was happened because of cloning project in another pc that not downloaded that sdk image.
Close all Android Studio projects
Remove the project from the recent projects in Android Studio wizard
Restart Android Studio
Use import option (Import project- Gradle, Eclipse ADT, etc.) instead of open an existing
Project AS project
File -> Sync project with gradle files
Sometimes the errors exists in Android-manifest because of that there
is cross like image over run/debug configuration hence try to look
over if Android-manifest has any errors in just case.
For my case, a newbie I boogered up my project, not sure how but it would not longer run and complained about the manifest, the R, everything. I realized that some how in my settings.gradle did not have include ':app' once I added this, I was back on my way.
Well, nothing worked for me from all the answers. Finally, I clicked Run > Edit Configuration. On the left, u can choose a new main module and remove to deleted ones.
Add your module in your applications .iml file like:
orderEntry type="module" module-name="yourmoudlename" exported=""
It works for me.
If all the above doesn't work. Try to update your Android studio version.
Steps:
1. In Android Studio, select File > Settings (or Android Studio > Preference on Mac).
2. In the left pane, select Appearance & Behavior > System Settings > Updates.
3. Be sure that Automatically check for updates is checked, and then select a channel from the drop-down list.
4. Click OK.
For me it was:
Right click on app project folder & select Load/Unload Modules...
Select app module, click Unload >, & click OK
Right click on app again & select Load/Unload Modules...
Select app module, click < Load, & click OK
app then appeared for me in the configurations list again.

Resources