Android Studio, aidl refusing to generate code from aidl file defining parcelable. Why?
2019-07-17 17:03
3367 查看
Test.java (Implements Parcelable):
package com.app.pack.classes; public class Test implements Parcelable { private int test = 33; protected Test(Parcel in) { test = in.readInt(); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(test); } @Override public int describeContents() { return 0; } public static final Creator<Test> CREATOR = new Creator<Test>() { @Override public Test createFromParcel(Parcel in) { return new Test(in); } @Override public Test[] newArray(int size) { return new Test[size]; } }; }
Test.aidl (Declares the class I want to send):
package com.app.pack.aidl; parcelable Test;
TestService.aidl (provides the method that returns a Test object):
package com.app.pack.aidl; import com.app.pack.aidl.Test; interface TestService{ Test getAll(in int[] listOfInts); }
这样写编译会报错:
refusing to generate code from aidl file defining parcelable couldn’t find import for class xxxxx
原因:
Test类的包名称,Test.aidl中的com.app.pack.aidl与Java代码中的com.app.pack.classes之间存在不匹配(不一样); 他们需要匹配(完全一样)。
相关文章推荐
- How to generate UML Diagrams from Java code in Eclipse
- use code to generate Silverlight Controls at run time, and serialize the control into XAML file
- why not use the following way to generate the CSV file?
- how to generate pb file from ckpt files?
- Why the volume so big after coping file from Linux to Windows?
- From Source Code to an Executalbe File ----- Learning of Gcc on Linux Operating Systems
- Error Domain=ASIHTTPRequestErrorDomain Code=8 "Failed to move file from"xxx/xxx"to"xxx/xxx"
- VBA code from template is linked to doc file. I need a copy
- VBA code from template is linked to doc file. I need a copy
- QA:Failed to deploy artifacts from/to snapshots XX Failed to transfer file Return code is: 405, ReasonPhrase:Method Not Allowed.
- 如何从EXCEL文件加载Hierarchy到BW (How to Load Hierarchy From Flat File)
- 解决:The virtual machine was unable to remove all stack frame runnning old code from the call stack.问题
- algorithm to generate unique code of 64 bit
- How to read a PCap file from Wireshark with C++
- Unity Vuforia项目打包XCode出现Failed to Copy File Directory from。。。/VuforiaPluginLoader.mm'
- android studio导入eclipse的library/ import libraries from eclipse to android studio
- Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4X
- 解决Unable to read TLD "META-INF/tlds/struts-bean.tld" from JAR file
- Android studio 更新版本2.3出现Error:Failed to open zip file
- How to unlock xcode file to make edits from different computers?