Closed Therefore closed 6 years ago
Hello @Therefore. Which folder are you choosing when importing the library module? Make sure it's library
.
@makovkastar Would this be the best was to import? File>Import Gradle project> navigate to the library folder?
File -> New -> Import module.
@makovkastar I'm still receiving an error. File>import>new Module. I import the folder google-maps-clustering/library
but still receive: Error:(14, 0) Could not get unknown property 'compileSdkVersion' for root project 'ImportModule13' of type org.gradle.api.Project. <a href="openFile:C:\Users\UserName\Android Projects\ImportModule13\library\build.gradle">Open File</a>
OK, I see. You need to go to the build.gradle
file of the library module and replace compileSdkVersion, buildToolsVersion, minSdkVersion, targetSdkVersion, versionCode and versionName with the correct values (you can take them from the root build.gradle
file).
Due to the inactivity, I assume that you managed to import the library. Closing the issue.
@makovkastar sorry for the lack of responses. I was on vacation for a week and since the topic was closed I kept trying. Today I finally got it to work. here is a brief summary of my steps.
compile project(':NAME-OF-THE-LIBRARY
)`from what I have tried so far you can now use the libary as if you had imported it using the steps provided in the read-me.
The purpose for the import in the library was to add the .rotation(float) to the Marker Options.
I want to thank you for this awesome library. If it works how I am hoping it will be the corner stone of my app. I really appreciate you helping me day after day. All the best.
@makovkastar I need to modify some of the library classes such as QuadTree so I can pass additional variables to ClusterItem, but it says that the library is read only since I imported it with gradle.
So I followed guides trying to import it as a module, but always got build errors such as
Error:(11, 0) Could not find method compile() for arguments [project ':subProject:library'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. <a href="openFile:C:\Users\Nathan\Android Projects\ImportModule4\build.gradle">Open File</a>
and
Error:(18, 0) Could not find method android() for arguments [build_enfbvdz6abztfoiqie2qzfmjg$_run_closure1@58eced6f] on root project 'ModuleImport2' of type org.gradle.api.Project. <a href="openFile:C:\Users\Nathan\Android Projects\ModuleImport2\build.gradle">Open File</a>
I followed these guides: https://stackoverflow.com/questions/41764338/importing-module-in-android-studio and https://github.com/MagicMicky/FreemiumLibrary/wiki/Import-the-library-in-Android-Studio
Do you have a recommended method to adding your library to an existing project and be able to modify files?