Giter Site home page Giter Site logo

sanogueralorenzo / android-kotlin-clean-architecture Goto Github PK

View Code? Open in Web Editor NEW
1.8K 55.0 328.0 50.92 MB

Android Sample Clean Architecture App written in Kotlin

Kotlin 100.00%
android kotlin architecture sample testing clean-architecture clean-code

android-kotlin-clean-architecture's Issues

how navigation works

I don't understand your package name constant but, how setClassName works for passing postlist to postdetail? When I use your navigation, I have an ActivityNotFoundException with have you declared this activity in your AndroidManifest.xml?

Build error

C:\Android-Kotlin-MVI-CleanArchitecture\build\build-attribution\androidGradlePluginAttributionData: The process cannot access the file because it is being used by another process.

I get this error when I try to run the app on the master branch.

Question about injectFeature function

Hi! I tried to use Koin library with multi-feature modules, however, I don't know how to load koin modules properly from each features. Finally, I saw your blog post and get how to load koin modules in feature. The differences is "injectFeature"(loadFeature by lazy). I tried to load modules directly

It works as I expected,but I don't know why it is working. So, could you explain for this?

This Library

// Application
class App: Application() {
    override fun onCreate() {
        super.onCreate()

        startKoin { androidContext(this) } // it seems deprecated...
    }
}

// Modules.kt
fun injectFeature() = loadFeature

private val loadFeature by lazy {
    loadKoinModules(
        viewModelModule,
        useCaseModule,
        repositoryModule,
        dataSourceModule,
        networkModule,
        cacheModule
    )
}

// in Activity
onCreate() {
	super.onCreate()
	injectFeature()
}

What I tried

// Application
class App: Application() {
    override fun onCreate() {
        super.onCreate()

        startKoin(this, listOf(networkModule, analyticsModule))
    }
}

// in Activity One
onCreate() {
	super.onCreate()
	loadKoinModules(listOf(oneViewModelModule))
}
// in Activity Two
onCreate() {
	super.onCreate()
	loadKoinModules(listOf(twoViewModelModule))
}

it works, however, it throws Exception like this when calling loadKoinModules again...
org.koin.error.BeanOverrideException: Try to override definition with Factory [name='OneViewModel...

Cause: DefaultClassLoaderScope ... must be locked before it can be used to compute a classpath!

After updating gradle.property for the property org.gradle.configureondemand=true, it generate below error.

Cause: org.gradle.api.internal.initialization.DefaultClassLoaderScope@2c3c5fa9 must be locked before it can be used to compute a classpath!

It works when setting the value to false. In that case, the purpose for the property for the multimodule project won't get solved right?

I'm using Kotlin DSL with the same gradle wrapper version from the repository.
Also changed the java version from 8, 11 & 16 still it has the same error.

If it works with value true then how to resolve the above issue?

using .subscribeOn() and .observeOn() with the same thread

erro code

how to get code of error response

.subscribe(
                {
                    financialResult.setSuccess(it)
                    setLoading(false, "financialResult")
                },
                {

                    financialResult.setError**(it.code)**
                    setLoading(false, "financialResult")
                }
            )

Instrumentation tests in Feature modules

Expected:

  • define Koin application and mock dependencies in test's @Before

What's happening:

  • Feature module's injectFeature() is crashing the test because of duplicate dependencies

I'm curious if you've faced this issue and how you've solved it. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.