Android Studio: How to see class hierarchy for gradle dependencies - android-studio

I have included various dependencies in my build.gradle file. For example:
dependencies {
compile 'io.reactivex:rxandroid:1.0.1'
}
Is there any way to see the class hierarchy that this provides in Android Studio? e.g. the list of packages and classes.
If I include a .jar dependency in my libs folder, I can 'open it up' in the Project view to see what's in there.
Any similar functionality with gradle dependencies?

Yes you can. It's in this directory:
{yourModuleName}/build/intermediates/exploded-aar/io.reactivex/rxandroid/1.0.1/jars/
You can see it easily if you have the Project view open (AS defaults to Android view)

Related

Android Studio editor does not recognize changes in .aar dependency

I have added a dependency to an .aar library in my Android project like this:
dependencies {
implementation files('/home/user1/Schreibtisch/data/code/Android/StandardLib/StandardLib/standardlib/build/outputs/aar/standardlib-debug.aar')
}
(The code is a piece of my app build.gradle. Not the project build.gradle.)
The problem is that the editor does not recognize new versions of my .aar library.
For example when I add a new class to the .aar library it won't be recognized by the editor. The editor says that the new class does not exist.
Android Studio must have cached an old version of the .aar library somewhere.
I tried "Build > Clean Project" and "Build > Rebuild Project" but it doesn't work.
I can successfully build and run my project. The only problem is the editor which does not recognize changes in the .aar library.
Any ideas?

Android training for FragmentBasics won't import into AS 1.5.1

In trying to get the hang of Fragment, I imported into Android Studio 1.5.1 the unzipped folder FragmentBasics after extracting the downloaded file FragmentBasics.zip to that Folder.
Now I have Gradle problems and I have no clue what to do to be able to run the app. I don't know that the .zip file is from Eclipse as the message suggests.
I did move the folder FragmentBasics to C:\Users\Dov because of the space in "Google Drive" but got same error.
Gradle project sync failed . Basic functionality (e.g., editing, debugging) will not work properly.
Failed to sync gradle project 'FragmentBasics'
Error:Cause: failed to find target with hash string 'android-15' in: C:\Users\Dov\AppData\Local\Android\sdk
Open Android SDK Manager
ECLIPSE ANDROID PROJECT IMPORT SUMMARY
Risky Project Location:
The tools should handle project locations in any directory. However,
due to bugs, placing projects in directories containing spaces in the
path, or characters like ", ' and &, have had issues. We're working to
eliminate these bugs, but to save yourself headaches you may want to
move your project to a location where this is not a problem.
C:\Users\Dov\Google Drive\AndroidStudioProjects\FragmentBasics
-
Replaced Jars with Dependencies:
The importer recognized the following .jar files as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the .jar file in your project was of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the jar replacement in the import wizard and try again:
android-support-v4.jar => com.android.support:support-v4:18.0.0
Moved Files:
Android Gradle projects use a different directory structure than ADT
Eclipse projects. Here's how the projects were restructured:
AndroidManifest.xml => app\src\main\AndroidManifest.xml
res\ => app\src\main\res\
src\ => app\src\main\java\
Next Steps:
You can now build the project. The Gradle project needs network
connectivity to download dependencies.
Bugs:
If for some reason your project does not build, and you determine that
it is due to a bug or limitation of the Eclipse to Gradle importer,
please file a bug at http://b.android.com with category
Component-Tools.
(This import summary is for your information only, and can be deleted
after import once you are satisfied with the results.)
I installed sdk 15 but then had problems with Gradle griping about
gradle-wrapper.properties file having a line with
gradle-2.8-all.zip that needed to be changed to
gradle-2.1-all.zip, so I edited gradle-wrapper.properties file to contain 2.1 instead of 2.8.
Message said after making change, re-import project. And it works.
Before importing I only removed following line from AndroidManifest.xml
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
Worked with FragmentsBasics.zip in Android Studio 2.3.3

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

Gradle dependency error

I am using Gradle 2.4 and Android Studio 1.3. I have tried to use AppWarp's JAR file as a dependency in a libGDX project. I have got following error during Gradle sync:
Gradle DSL method not found 'compile()'
I put code below in allprojects section.
dependencies {
compile files('libs/App42MultiPlayerGamingSDK.jar')
}
You can't put "compile" in the allprojects section because that section does not have the java plugin applied, and therefore can only accept classpath dependencies. You could put apply plugin: "java" at the top of the allprojects block, but that will only lead you to the next problem...
Isn't that jar an Android-based library anyway? It will cause your other modules to fail to compile if you put it in allprojects. It needs to go in the android section's dependencies.
AppWarpMultiPlayerGamingSDK should be added to Android Studio as a module in the core project, by right click on project.
Select Module Setting
And SDK as a module library.
Thanks to AppWarp Support Team!

Android Studio HoloCircularProgressBar Library

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

Resources