alibaba / atlas

A powerful Android Dynamic Component Framework.
Apache License 2.0
8.13k stars 1.48k forks source link

getIdentifier问题 #198

Closed whuthj closed 6 years ago

whuthj commented 7 years ago

public int getIdentifier(String name, String defType, String defPackage) { if(Build.VERSION.SDK_INT<=19){ return 0; }

这里限定API<19是什么原因,我这边遇到一个资源找不到问题,返回0x0

hwjump commented 7 years ago
@Override
public int getIdentifier(String name, String defType, String defPackage) {
    int id = super.getIdentifier(name, defType, defPackage);
    if(id!=0){
        return id;
    }else {
        return sResourcesFetcher.getIdentifier(name, defType, defPackage);
    }
}

在19以下 super.getIdentifier 这里就应该返回给你了,没有找到请再排查下打包的产物。 sResourcesFetcher限定是因为只有5.0以上 才会走到sResourcesFetcher