简体   繁体   中英

AIDL file in Android project: strange “package” syntax error

I create Android project with plugins. When I create simple AIDL file, the compilation breaks with strange errors and no interface class is generated.

My AIDL file:

package com.android.example.tryplugin
interface IResPlugin {
    Bundle onClick( in int id, in int state );
}

I have the following errors:

syntax error don't know what to do with "package"   
syntax error don't know what to do with "com.android.example.tryplugin" 
syntax error don't know what to do with "package"

I have also tried all advices from Google like "Try to clean and recompile", "Create new project with these files" etc. What is wrong with it?

I met the similar problem before, but the cause is not same with your, the AIDL file used the CR as line break on my Windows platform, the AIDL parser could not handle it and kept crashing. The parser worked well after I changed the CR to CR LF combination.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM