Cannot set the value of read-only property 'jniFolders' when trying Instant Run of Android Studio 2.0

3,643 views
Skip to first unread message

Yuanjie Zhao

unread,
Nov 30, 2015, 11:40:08 AM11/30/15
to adt-dev
Hi, here is part of our app's build.gradle:

tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
    pkgTask.jniFolders = [new File(buildDir, 'lib')]
}

When I trying to use Instant Run, build failing with error:

Cannot set the value of read-only property 'jniFolders' on task ':app:packageProdDebug'.

Xavier Ducrohet

unread,
Nov 30, 2015, 11:51:12 AM11/30/15
to adt...@googlegroups.com
You should not be doing this. Why not add this to the sourceset instead?

android {
  sourcesets {
    main {
      jniLibs.srcDir new File(buildDir, 'lib')
    {
  }
}

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Yuanjie Zhao

unread,
Dec 6, 2015, 10:15:08 PM12/6/15
to adt-dev
Thanks! It works now.

在 2015年12月1日星期二 UTC+8上午12:51:12,Xavier Ducrohet写道:
Reply all
Reply to author
Forward
0 new messages