µÚÒ»²½£ºÔÚbuildÖÐÌí¼ÓÅäÖÃÈçÏ£º
projet Ŀ¼ÏµÄbuild.gradle
buildscript { |
moudleϵÄbuild.gradleÌí¼ÓÈçÏÂÄÚÈÝ£º
apply plugin: 'org.greenrobot.greendao' dependencies { } |
µÚ¶þ²½£ºÔÚmoudleÏ build.gradleµÄ¸ùĿ¼ÏÂÌí¼ÓÈçÏÂÅäÖãº
greendao { //Êý¾Ý¿âµÄschema°æ±¾£¬Ò²¿ÉÒÔÀí½âΪÊý¾Ý¿â°æ±¾ºÅ schemaVersion 1 //ÉèÖÃDaoMaster¡¢DaoSession¡¢Dao°üÃû£¬Ò²¾ÍÊÇÒª·ÅÖÃÕâЩÀàµÄ°üµÄȫ·¾¶¡£ daoPackage 'com.edu118.mytest.greendao.dao' //ÉèÖÃDaoMaster¡¢DaoSession¡¢DaoĿ¼ targetGenDir 'src/main/java' } |
Ìí¼ÓÍê³ÉÖ®ºóµã»÷syncһϹ¤³Ì£¡´Ëʱ±¨´í½ØͼÈçÏ£º
±¨´íÐÅÏ¢ÈçÏ£º
Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputFilePropertyBuilder;'. Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) <a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. <a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes. |
ÔÒò£º±¨Õâ¸ö´íÎóÖ÷ÒªÎÊÌâ³öÏÖÔÚgradle°æ±¾É϶ø²»ÊÇAndroid Studio¿ª·¢¹¤¾ß±¾Éí£¬ÎÒ֮ǰÓõÄgradle°æ±¾ÊÇgradle-2.14.1-allºÍAndroid studio2.3.0°æ±¾¡£
½â¾ö·½°¸£º
µÚ1²½£ºÐèÒªµ½ÏÂÁÐgradle¹ÙÍøµØÖ·ÉÏÏÂÔØgradle-3.5-all°æ±¾£¬ÏÂÔصØÖ·ÈçÏ£º
https://services.gradle.org/distributions/ |
µÚ2²½£º°ÑÏÂÔسɹ¦µÄgradle-3.5-all.zipѹËõ°ü½øÐнâѹËõ£¬ÈçÏ£º
µÚ3²½£ºÔÚAndroid studioÖУ¬File-->Settings-->Build,Execution,Deployment-->GradieÅäÖÃgradle£¬½ØͼÈçÏ£º
µÚ4²½£ºok£¬´íÎó¾Í½â¾öÁË£¡