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?
Related
I am not getting C++ code complete to work in Android Studio 2.1.2. I imported an existing aosp project with custom c++ and java modules. Android Studio can code complete the java code but not the c++.
I see the following error on top of the C++ file:
"The file has been added after the last project sync with Gradle. Please sync the project again for the NDK support to work properly."
"The project 'XXXX' is not a Gradle-based project."
I tried importing the project 2 different ways with no luck:
1. Generate an *.isr file and opened that. Pointed to NDK home. Then "Invalidate Caches/Restart"
2. from "Welcome to android Studio"
a. Import project(Eclipse, Gradle, etc.)
b. Select project to import
c. Import project from external model "Gradle"
d. Point Gradle home: "/opt/android-studio/gradle/gradle-2.10"
Any ideas?
To compile c/c++ files in Android Studio you should use NDK and then make calls from java to your native code using JNI.
Drop your native files into src/main/jni/ folder.
And then configure gradle.
Something like:
android {
ndk {
moduleName "mylibrary"
ldLibs "m", "log", "android"
} }
You would need to download and config ndk.
There are a lot sources how to do it, google "how to use c++ file in android studio". Top link from search
Or you could compile your c code not in Android Studio as .so library with proper JNI signatures(using javah) and drop it in JNIlibs folder.
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
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)
Hi in my project Iam using
compile 'com.android.support:support-v4:22.2.0'
for support library I don't want to use appcompat-v7 and mediarouter but they are getting generated under /exploded-aar/com.android.support.
My project was originally made for Ant build system and after I imported it in Android Studio it's been built for Gradle and it was working till I updated SDK (by mistake) and now I can't build project because of conflicts.
I tried to remove it from app.iml
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
But after I clean and rebuild project it's back again
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