开发者

aapt not finding

I have this problem in Eclipse. Did I install everything correctly?

Error executing aapt. Please check aapt is present at C:\Program Files\Android\android-sdk\platform-tools\aapt.exe

I also have this problem:

public void onCreate(Bundle savedInstanceState) {
        super.onCr开发者_Go百科eate(savedInstanceState);
        setContentView(R.layout.**main**);
        text = (EditText) findViewById(1);

    }

It seems that main in not known.


Problem 1: Go to the folder C:\Program Files\Android\android-sdk\platform-tools\ , do you the file 'aapt.exe'? If it's there, check that you have specified this location in Eclipse (Window -> Preferences, choose 'Android' in the left pane and verify that the 'SDK Location' is C:\Program Files\Android\android-sdk\ If this is all correct and you're on a computer using Windows, I know some people get errors when the 'android-sdk'-folder is inside 'Program Files'. This is probably due permission constraints in that folder. You could try to move the folder to another location. Remember to update the location in Eclipse if you do so.

Problem 2: As commented, setContentView is used to set a layout. I'm not sure if the stars are even legal to use. A valid name such as 'R.layout.main' refers to the file 'main.xml' in the folder 'layout' which can be found in the left pane of Eclipse.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜