Android project requesting the same import that my library has - android

I Have a library that I've made, it imports the "androidx.biometric:biometric:1.0.0"
the library is a wrapper for Android biometric.
I've made an aar file and imported it to my project.
When I try to access the method in my library, it says that it can't find supertype "androidx.biometric" altough my library has it like this:
api 'androidx.biometric:biometric:1.0.0'
If I'm adding the same dependancy in my project, it success.
(api 'androidx.biometric:biometric:1.0.0') but the whole idea is that my aar library will take care of that.
Is there any fix for this?
am I doing something wrong here?

I can not comment on your question so I am just posting it here. Please check the link below it might answer your question: Generate AAR file with all dependencies

Related

Being to foolish to correctly implement a module library into my project

I recently started developing my really first Android Project using Android Studio 3.1.2.
Therefore I implemented a module library into my app, by cloning it from github, imported it as module library and added a dependency via right-click on app > module settings, switch to dependency tab, hit the +, select imported_module.
Additionally I checked my build.gradle(Module:app), if the dependency has been added correctly, there this line appeared:
dependencies {
...
implementation project(':imported_module')
}
Also in the settings.gradle file it says:
include ':app', ':imported_module'
Now if I want to access features of imported_module any of them can't be resolved. I browsed the official and the common forums for hours to find the one step I obviously missed but wasn't smart enough to find the solution.
Synching the project with gradle files didn't cause any visible effects
What do I still have to do to be able to use all the fancy stuff fro imported_module inside my app? Do I have to import it in a certain way?
Or do I have to modify my AndroidManifest of my app somehow? Thanks in forward!
EDIT: could it be that my app and imported_module obviously have different package names? The Project File Tree says com.domain.example.my_app for the app and com.domain.example.imported_module for imported_module. Do I have to squeeze the one into the other?
It could have been much easier, if you had mentioned what exactly you want to access in main app. May be access specifier of the member in your imported_module is private.
I kinda worked around the whole thing, by just adding a remote dependency in my build.gradle file of a new project, pasted my java classes and my res into this new project, synched it and now it runs. Nevertheless thanks for thy help!
That should be really all. Be sure to sync your project with Gradle files (File - Sync Project with Gradle Files).

How to add an Android library to my project's build.gradle files (in Android Studio)?

I'm trying to work with Instagram in my Android app and am looking to use this: library to make things smoother; however, in trying to import the library I'm having problems. What I've done so far is to unzip the downloaded file and place its contents in my app's libs folder. The problem I'm facing is when trying to add it as a dependency in my build.gradle. So far I've tried
compile 'net.londatiga.android.instagram:AndroidInstagram:1.0'
and its various permutations (removing 'instagram', removing 'android' etc.) to no avail. Because the exact compile statement isn't listed on the github page I'm unsure as to how to import the library.
Any help appreciated!
I think this library should solve your problem :
https://github.com/gorbin/ASNE

How to Use Android PagerSlidingTabStrip library or any other gradle built library in Eclipse

I have a problem importing the PagerSlidingTabStrip library into Eclipse, I get multiple errors and I know this happens because the library was built using gradle.
I tried to follow this answer but I can't find use as source folder in the build path menu.
I've never used gradle previously and don't know how to go about this in Eclipse. Please guys, help most of us who have this problem out of our dilemma. Would be very grateful.
Okay in the end this was what i did:
I checked the build.gradle file of the library for target and min sdks. I then put what i found in the android manifest.xml which I know Eclipse uses.
I deleted the build.gradle and gradle.properties files.
Made sure the project was marked as a library. And it works!
I think the most crucial step was to check the build.gradle for the sdks and whatever else the project requires and replicating that the way it should be in the manifest file.

Importing and using a library in android studio

I am using android studio to import this project called https://github.com/Pixate/pixate-freestyle-android. However when I import it into android studio the folder under samples, freestyleshowcase doesnt seem to build. The other 2 samples buld correctly. There is a red circle around the java file with a J (error) but there is no error in the file itself. COuld someone please help me out?
You are obviously missing some libraries but it is going to be hard for anyone to tell you which since we do not know the libraries the project needs.You can try Build-->Rebuild Project or Build-->Clean Peoject if it still doesn't work, close and open Android Studio.
If that doesn't work also then you have to go the hard way of identifying the libraries need by the project samples you imported and see if you have them.
When in doubt, you can try the Library Dependency option (using Maven) as demonstrated here:
https://www.youtube.com/watch?v=6BUcx9gGQ3o
That way, you won't have to manually edit the build.gradle file.

ERROR: "._android-support-v4.jar" in project FacebookSDK

Help needed!!!! Stuck for 2 weeks on this and help needed.
I've recently imported the facebook sdk for android and its projects into my workspace. It shows up errors and the problems:
Archive for required library: '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/libs/._android-support-v4.jar' in project 'FacebookSDK' cannot be read or is not a valid ZIP file
And the samples get errors along the line of:
The container 'Android Dependencies' references non existing library '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/bin/facebooksdk.jar'
The things I have done following the other discussions without any success are
cleaned project
set the Facebook SDK as library
looked at the build path section and added external jar consisting of facebook/libs
imported fb sdk like 20 times and into different folders.
made sure my java compiler was 1.6
HELP would be very greatly appreciated!!!!
Take the lastest version of android-support-v4.jar (in your sdk environement : sdk/extras/android/support/v4/android-support-v4.jar) and replace in your project and library project do not create conflict.
The steps to importing a library are:
Download the library
Place the library in the libs folder of the project.
Build the project
Do Not attempt to import the library using some import wizard.
I suspect either your download was corrupted, and you need to do it again, or you put the file into the wrong directly.
I think your problem is that the android.support.v4 versions are different, take the one from your project and replace the one in the Facebook sdk lib folder, it should dismiss the clash.
As per your question, I think you are not able to compile once you add the SDK to your project. Do you get an error saying unable to run as library?
If so that means you have included this as library and create your project as a library to be used further. It is a common mistake that I have seen many people do when they try to import a library to use and tick mark the checkbox is Library. This actually means you want this project to be treated as a library for future use. Just try to add the SDK and do not tick mark the checkbox and this project will run fine.
Many forums will just tell you to tick that checkbox and you will be stuck on this error for long time.
For any .jar file related issues you have to make the .jars files compatible as there hashing a problem and the two jars are not compatible with each other (a version issue).

Categories

Resources