No resource ident ifier found for attribute 'w

2019-07-07 07:27发布

widgetCategory was added in Android 4.2 SDK level 17. I decompiled an APK with apktool, added the widgetCategory attribute to a xml file, and recompiled.

The error is this:

No resource identifier found for attribute 'widgetCategory' in package 'android'

I have tried using the latest aapt and changing the sdk level in apktool.yml but neither solved the problem.

Is there anything I need to change to add support for Android 4.2 to apktool?

3条回答
We Are One
2楼-- · 2019-07-07 07:48

All the answers are geared towards someone using Eclipse and Java when the OP said he's using apktool. Most likely the problem is apktool is using a framework SDK file below level 17. https://code.google.com/p/android-apktool/wiki/FrameworkFiles

查看更多
叼着烟拽天下
3楼-- · 2019-07-07 07:52

Set build target to API 17. In Eclipse you can achieve this by right clicking on the project and choose Properties. Then, under Android, select Android 4.2 as build target. It's also possible to just open the file project.properties and set target to android-17.

You do not have to change either minSdkVersion or targetSdkVersion in the Android Manifest.

查看更多
Lonely孤独者°
4楼-- · 2019-07-07 08:03

I just ran into this issue myself. You need to update the MinSdkVersion of the App (in the manifest.xml) to 17.

If it uses a MinSdkVersion below 17, it will not recognize the widgetCategory resource.

Cheers!

查看更多
登录 后发表回答