Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run the library locally? #19

Open
mspnr opened this issue May 18, 2021 · 9 comments
Open

How to run the library locally? #19

mspnr opened this issue May 18, 2021 · 9 comments

Comments

@mspnr
Copy link
Contributor

mspnr commented May 18, 2021

I just stumbled on this problem. If I want to change a thing or two in the library and can attach to my app project it directly using the file system like this:

Add to settings.gradle

include ':android-stepper'
project(':android-stepper').projectDir = new File('../android-stepper/stepper')

Add to app/build.dependencies

dependencies {
  implementation project(':android-stepper')

With your library it does not work. Currently I am able to run it from maven version only.

Can you please describe how to a attach Android Stepper to an app project locally?

@acefalobi
Copy link
Owner

What is the issue when you try to do this?

@mspnr
Copy link
Contributor Author

mspnr commented Aug 9, 2021

Here you are. This error is coming out after performing all operations described above and doing gradle sync:

org.gradle.internal.exceptions.LocationAwareException: Build file '.../android-stepper/stepper/build.gradle.kts' line: 9
Script compilation error:

  Line 9:     id(PluginDependencies.ANDROID_MAVEN)
                 ^ Unresolved reference: PluginDependencies

The problem is obviously, that PluginDependencies is not accessible from the project, only stepper does. PluginDependencies is though defined in buildSrc folder. Should it also be included to the new project, why and how? This is not clear.

@acefalobi
Copy link
Owner

Yes, you'll need to add the Dependencies.kt file from the stepper project into your own project.

@mspnr
Copy link
Contributor Author

mspnr commented Aug 9, 2021

What do you mean by adding Dependencies.kt to my project?

Do you mean simply copy android-stepper/buildSrc/src/main/java/Dependencies.kt to MyApplication/app/src/main/java/com/example/myapplication/Dependencies.kt? Or there is another way to do it, e.g. as a reference?

Anyway copying does not work, the error stays the same.

@acefalobi
Copy link
Owner

No, I meant copying it to your buildSrc module (if you have one).

@mspnr
Copy link
Contributor Author

mspnr commented Aug 9, 2021

Nope, I don't have buildSrc in my project. I created my project by selecting in Android Studio: New project / Phone or tablet / Empty activity. All other settings are left as suggested by Android Studio. What do you suggest to do?

@acefalobi
Copy link
Owner

acefalobi commented Aug 9, 2021

In that case, I would suggest you create a buildSrc module or copy the contents of Dependencies.kt into the stepper build.gradle.kts

@KeeganDC
Copy link

Did anyone manage to import the library folder as an external module successfully? I have the same issues as OP

@acefalobi
Copy link
Owner

What exact issues did you have @NageekDC ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants