简体   繁体   中英

when using a custom namespace attribute in a library project, use the namespace “http://schemas.android.com/apk/res-auto” instead

I am trying to implement ijoomer advance in the android application. I am refering to the link : https://www.ijoomer.com/iJoomer-Advance/developer-manual.html

I have imported the ijoomer advance sdk and facebook sdk in my workspace. I have included both as library too. But in "IjoomerAdvance1.3\\res\\layout\\ijoomer_loading_dialog.xml" I am getting follwing error: 在此处输入图片说明

when I refer to the xml file I have following error: 在此处输入图片说明

When I use " http://schemas.android.com/apk/res-auto " the problem is solved but I have following error:

在此处输入图片说明

According to the above link, in manifest.xml file I have created activity tag with the java class from library file:

在此处输入图片说明

In my mainactivity.java file I have extended from smartApplication. 在此处输入图片说明

And included ijoomeradvace as library project. 在此处输入图片说明

Can anyone help me with my problem?

You need to use

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" />

According to android documentation:

Added support for custom views with custom attributes in libraries. Layouts using custom attributes must use the namespace URI http://schemas.android.com/apk/res-auto instead of the URI that includes the app package name. This URI is replaced with the app specific one at build time

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