Safeargs library doesnt generate direction class

前端 未结 19 949
孤街浪徒
孤街浪徒 2021-02-01 11:44

I use navigation library and safeargs for passing data. I define argument to fragment like that.



        
19条回答
  •  情话喂你
    2021-02-01 12:25

    I faced a similar issue working with android studio 4.2 preview.

    The issue was that the IDE somehow was not picking the source folders where the generated direction classes where being placed by the plugin. So adding the following to my app build.gradle file resolved the issue for me.

    sourceSets {
        main {
            java {
                srcDirs += 'build/generated/source/navigation-args'
            }
        }
    }
    

    Hope this helps!

提交回复
热议问题