Project has no default.properties file! Edit the project properties to set one

前端 未结 22 681
耶瑟儿~
耶瑟儿~ 2020-11-28 10:50

While configuring MJAndriod I have got an error as follows:

Project has no default.properties file! Edit the project properties to set one.

相关标签:
22条回答
  • 2020-11-28 11:24

    First Close your project.

    Open a Text File then Add target=android-your_Api_Level.

    Such as: target=android-7 And then Save that file as project.properties Then manually place project.properties file into your Project's Folder and then Reopen you project.

    The file generally looks like:

    # This file is automatically generated by Android Tools.
    # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
    #
    # This file must be checked in Version Control Systems.
    #
    # To customize properties used by the Ant build system use,
    # "ant.properties", and override values to adapt the script to your
    # project structure.
    
    # Project target.
    target=android-7
    
    0 讨论(0)
  • 2020-11-28 11:26

    If the project already contains a file default.properties you can open that file and edit+save it (add a space, save, remove that space, save). That worked for me.

    A note with the above discussion:

    R.java is getting generated automatically by doing the above described process. When I go and remove it, it gets generated again. Neither is it allowing me to edited the automatically generated one. – Compuser7

    With respect to the comment quoted above, R.java is indeed an automatically generated class that contains references to all the resources (in the res folder) that belong with your project.

    When Eclipse rebuilds, this file is regenerated, since most application (I mean Java code) rely on the fact that there are some resources (images, layouts and string values) available. When you remove the file R.java through Eclipse, Eclipse will see this change in the project as a reason to automatically rebuild (see the options under Project) the project, regenerating the R.java file.

    So DON'T try to remove R.java, because Eclipse will regenerate it as soon as you rebuild the project, which will result in a match of patience ;)

    0 讨论(0)
  • 2020-11-28 11:27

    import -> Existing Android Code Into Workspace should solve the problem.

    0 讨论(0)
  • 2020-11-28 11:27
    `# This file is automatically generated by Android Tools.
    # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
    #
    # This file must be checked in Version Control Systems.
    #
    # To customize properties used by the Ant build system use,
    # "ant.properties", and override values to adapt the script to your
    # project structure.
    
    # Project target.
    **target=android-7`**
    

    Change the target and save the file. Worked for me.

    0 讨论(0)
  • 2020-11-28 11:27

    In my case I went to My Project then to > Properties > Android > and checked Google API box. Clicking 'Okay' caused it to then work for me.

    0 讨论(0)
  • 2020-11-28 11:29

    In my case, it was because I was moving a project from Eclipse 7.1 to an older install of 7.0 on a different computer. You may want to check your eclipse versions.

    0 讨论(0)
提交回复
热议问题