Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle: No resource identifier found for attribute when using flavors and packageName

I'm currently working to migrate our app from ant to gradle and managed to have everything working. Now I would like to use flavors with different packageName to be able to install our Production app alongside the development one. This is the flavors I made:

productFlavors {
        playstore {
            packageName='com.my.app'
            buildConfig "-- a bunch of build flags for ps --"
        }
        beta {
            packageName='com.my.beta.app'
            buildConfig "-- a bunch of build flags for beta --"

        }
        dev {
            packageName='com.my.dev.app'
            buildConfig "-- a bunch of build flags for dev --"
        }
    }

My problem is, we use some custom attributes for our custom view and I get the error:

Gradle: No resource identifier found for attribute

when I try to build with these flavors. I used:

xmlns:app="http://schemas.android.com/apk/res/com.my.app"

to import our custom attributes, I tried with res-auto but it seems to rewrite my xml with the base package name so this does not solve anything. I was wondering if somebody already ran into this problem and if there is a way to make this work.

Thanks for your time,

Martin

like image 619
MoAdiB Avatar asked Jul 10 '13 13:07

MoAdiB


1 Answers

Ok seems like the

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

work indeed but clicking the error in android studio opened the generated xml instead of the source one...

like image 109
MoAdiB Avatar answered Sep 28 '22 07:09

MoAdiB