android-stepper icon indicating copy to clipboard operation
android-stepper copied to clipboard

How to run the library locally?

Open mspnr opened this issue 3 years ago • 9 comments

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?

mspnr avatar May 18 '21 15:05 mspnr

What is the issue when you try to do this?

acefalobi avatar Aug 03 '21 14:08 acefalobi

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.

mspnr avatar Aug 09 '21 00:08 mspnr

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

acefalobi avatar Aug 09 '21 02:08 acefalobi

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.

mspnr avatar Aug 09 '21 10:08 mspnr

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

acefalobi avatar Aug 09 '21 12:08 acefalobi

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?

mspnr avatar Aug 09 '21 12:08 mspnr

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

acefalobi avatar Aug 09 '21 13:08 acefalobi

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

KeeganDC avatar Jan 17 '22 01:01 KeeganDC

What exact issues did you have @NageekDC ?

acefalobi avatar Feb 11 '22 15:02 acefalobi