Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision of R.Id between resource from my main and apklib (regression between 3.8.1 and 3.8.2) #382

Closed
atali opened this issue May 30, 2014 · 11 comments

Comments

@atali
Copy link

atali commented May 30, 2014

Hello,

I using AndroidAnnotations on my main project and I use an apklib. From my main project, I am using a resource coming from my apklib.

Until version 3.8.1, it was working perfectly but since the version 3.8.2 I got duplicate resource Id.

Have you changed something on the behavior ?

Best regards,

@mosabua
Copy link
Member

mosabua commented May 30, 2014

Yes... we switched to the behaviour of the SDK and the Gradle build system. You have to remove the duplicates.

@atali
Copy link
Author

atali commented May 30, 2014

Hello,
Maybe it 's a stupid question but how I can do it because it is generate
automatically by the maven android plugin ?

Atali
Le 30 mai 2014 21:13, "Manfred Moser" notifications@github.com a écrit :

Yes... we switched to the behaviour of the SDK and the Gradle build
system. You have to remove the duplicates.


Reply to this email directly or view it on GitHub
#382 (comment)
.

@mosabua
Copy link
Member

mosabua commented May 30, 2014

Try the latest 3.9.0-rc.2 and send us the log with more details.

@atali
Copy link
Author

atali commented May 31, 2014

05-31 05:58:42.495    1240-1240/com.zenittude E/AndroidRuntimeFATAL EXCEPTION: main
    Process: com.zenittude, PID: 1240
    android.view.InflateException: Binary XML file line #23: Error inflating class com.zenittude.wizardpager.ui.StepPagerStrip
            at android.view.LayoutInflater.createView(LayoutInflater.java:620)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at com.zenittude.v2.module.ordering.screen.CustomizationScreen.onCreateView(CustomizationScreen.java:53)
            at com.zenittude.v2.module.ordering.screen.CustomizationScreen_.onCreateView(CustomizationScreen_.java:58)
            at android.app.Fragment.performCreateView(Fragment.java:1700)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
            at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479)
            at com.zenittude.v2.common.NavigationManager.openNavigationRight(NavigationManager.java:181)
            at com.zenittude.v2.common.NavigationManager_.access$1401(NavigationManager_.java:16)
            at com.zenittude.v2.common.NavigationManager_$14.run(NavigationManager_.java:238)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:594)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at com.zenittude.v2.module.ordering.screen.CustomizationScreen.onCreateView(CustomizationScreen.java:53)
            at com.zenittude.v2.module.ordering.screen.CustomizationScreen_.onCreateView(CustomizationScreen_.java:58)
            at android.app.Fragment.performCreateView(Fragment.java:1700)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
            at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479)
            at com.zenittude.v2.common.NavigationManager.openNavigationRight(NavigationManager.java:181)
            at com.zenittude.v2.common.NavigationManager_.access$1401(NavigationManager_.java:16)
            at com.zenittude.v2.common.NavigationManager_$14.run(NavigationManager_.java:238)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f050000 type #0x3 is not valid
            at android.content.res.Resources.getDimensionPixelSize(Resources.java:623)
            at com.zenittude.wizardpager.ui.StepPagerStrip.<init>(StepPagerStrip.java:70)
            at com.zenittude.wizardpager.ui.StepPagerStrip.<init>(StepPagerStrip.java:59)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:594)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at com.zenittude.v2.module.ordering.screen.CustomizationScreen.onCreateView(CustomizationScreen.java:53)
            at com.zenittude.v2.module.ordering.screen.CustomizationScreen_.onCreateView(CustomizationScreen_.java:58)
            at android.app.Fragment.performCreateView(Fragment.java:1700)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
            at android.app.BackStackRecord.run(BackStackRecord.java:684)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
            at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479)
            at com.zenittude.v2.common.NavigationManager.openNavigationRight(NavigationManager.java:181)
            at com.zenittude.v2.common.NavigationManager_.access$1401(NavigationManager_.java:16)
            at com.zenittude.v2.common.NavigationManager_$14.run(NavigationManager_.java:238)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)

Extract from my library R.java

package com.zenittude.wizardpager;

public final class R {
    public static final class attr {
    .......
    public static final class dimen {
        public static final int step_pager_tab_height=0x7f050001;
        public static final int step_pager_tab_spacing=0x7f050002;
        public static final int step_pager_tab_width=0x7f050000;
    }
......

Extract from my main app R.java

package com.zenittude;

public final class R {

    public static final class animator {
        public static final int card_flip_left_in=0x7f050000;
        public static final int card_flip_left_out=0x7f050001;
        public static final int card_flip_right_in=0x7f050002;
        public static final int card_flip_right_out=0x7f050003;
        public static final int slide_in_left=0x7f050004;
        public static final int slide_out_right=0x7f050005;
    }

While debugging, the resource takes into account is card_flip_left_in instead of step_pager_tab_width.

@william-ferguson-au
Copy link
Contributor

You're going to need to provide us with a link to a cut down project
containing both modules.
On May 31, 2014 4:06 PM, "Atali" notifications@github.com wrote:

05-31 05:58:42.495 1240-1240/com.zenittude E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.zenittude, PID: 1240
android.view.InflateException: Binary XML file line #23: Error inflating class com.zenittude.wizardpager.ui.StepPagerStrip
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.zenittude.v2.module.ordering.screen.CustomizationScreen.onCreateView(CustomizationScreen.java:53)
at com.zenittude.v2.module.ordering.screen.CustomizationScreen_.onCreateView(CustomizationScreen_.java:58)
at android.app.Fragment.performCreateView(Fragment.java:1700)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479)
at com.zenittude.v2.common.NavigationManager.openNavigationRight(NavigationManager.java:181)
at com.zenittude.v2.common.NavigationManager_.access$1401(NavigationManager_.java:16)
at com.zenittude.v2.common.NavigationManager_$14.run(NavigationManager_.java:238)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at com.zenittude.v2.module.ordering.screen.CustomizationScreen.onCreateView(CustomizationScreen.java:53) at com.zenittude.v2.module.ordering.screen.CustomizationScreen_.onCreateView(CustomizationScreen_.java:58) at android.app.Fragment.performCreateView(Fragment.java:1700) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062) at android.app.BackStackRecord.run(BackStackRecord.java:684) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447) at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479) at com.zenittude.v2.common.NavigationManager.openNavigationRight(NavigationManager.java:181) at com.zenittude.v2.common.NavigationManager_.access$1401(NavigationManager_.java:16) at com.zenittude.v2.common.NavigationManager_$14.run(NavigationManager_.java:238) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f050000 type #0x3 is not valid
at android.content.res.Resources.getDimensionPixelSize(Resources.java:623)
at com.zenittude.wizardpager.ui.StepPagerStrip.(StepPagerStrip.java:70)
at com.zenittude.wizardpager.ui.StepPagerStrip.(StepPagerStrip.java:59) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:594) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at com.zenittude.v2.module.ordering.screen.CustomizationScreen.onCreateView(CustomizationScreen.java:53) at com.zenittude.v2.module.ordering.screen.CustomizationScreen_.onCreateView(CustomizationScreen_.java:58) at android.app.Fragment.performCreateView(Fragment.java:1700) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062) at android.app.BackStackRecord.run(BackStackRecord.java:684) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447) at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479) at com.zenittude.v2.common.NavigationManager.openNavigationRight(NavigationManager.java:181) at com.zenittude.v2.common.NavigationManager_.access$1401(NavigationManager_.java:16) at com.zenittude.v2.common.NavigationManager_$14.run(NavigationManager_.java:238) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

Extract from my library R.java

package com.zenittude.wizardpager;
public final class R {
public static final class attr {
.......
public static final class dimen {
public static final int step_pager_tab_height=0x7f050001;
public static final int step_pager_tab_spacing=0x7f050002;
public static final int step_pager_tab_width=0x7f050000;
}......

Extract from my main app R.java

package com.zenittude;
public final class R {

public static final class animator {
    public static final int card_flip_left_in=0x7f050000;
    public static final int card_flip_left_out=0x7f050001;
    public static final int card_flip_right_in=0x7f050002;
    public static final int card_flip_right_out=0x7f050003;
    public static final int slide_in_left=0x7f050004;
    public static final int slide_out_right=0x7f050005;
}

While debugging, the resource takes into account is card_flip_left_in
instead of step_pager_tab_width.


Reply to this email directly or view it on GitHub
#382 (comment)
.

@atali
Copy link
Author

atali commented May 31, 2014

Hi,

I tried to create a project from scratch but I was unable to reproduce the issue.

But what I have noticed is in my target directory the lib R.java is not generated anymore to my main app.

target
|
|-------generated-sources
                     |------- r
                                |------- mylib
                                |          |------- NO R.java ( but it's generated in 3.8.1)
                                |------- R.java

Hope that can help.

@william-ferguson-au
Copy link
Contributor

Post the project in which it's failing otherwise we really have nothing to
go on.
On May 31, 2014 6:40 PM, "Atali" notifications@github.com wrote:

Hi,

I tried to create a project from scratch but I was unable to reproduce the
issue.

But what I have noticed is in my target directory the lib R.java is not
generated anymore to my main app.

target
|
|-------generated-sources
|------- r
|------- mylib
| |------- NO R.java ( but it's generated in 3.8.1)
|------- R.java

Hope that can help.


Reply to this email directly or view it on GitHub
#382 (comment)
.

@Shusshu
Copy link
Contributor

Shusshu commented May 31, 2014

Are you really sure you use 3.9.0-rc.2 ?
Because this is a known 3.8.2 problem which is fixed in 3.9.0-rc.2 (also in the first rc but you shouldn't use it anyway)

@atali
Copy link
Author

atali commented May 31, 2014

@william-ferguson-au Unfortunately I can't post my project :-(

@Shusshu as you can see on the following screenshot, I am in version 3.9.0-rc.2

screenshot-project

@william-ferguson-au
Copy link
Contributor

Just cut out whatever you want to keep hidden. If you can't provide a cut
down project showing the error then we are at an impasse because we can't
verify, let alone attempt resolution.

If that's the case you should close the issue.
On May 31, 2014 7:27 PM, "Atali" notifications@github.com wrote:

@william-ferguson-au https://github.com/william-ferguson-au
Unfortunately I can't post my project :-(

@Shusshu https://github.com/Shusshu as you can see on the following
screenshot, I am in version 3.9.0-rc.2

[image: screenshot-project]
https://cloud.githubusercontent.com/assets/369628/3138683/8ee9c7c4-e8a5-11e3-900f-baa42273c0d5.png


Reply to this email directly or view it on GitHub
#382 (comment)
.

@atali
Copy link
Author

atali commented May 31, 2014

Ok I understand it's difficult without the source code, it will take to much time to cut down the project.
I am gonna to close the issue and stay on version 3.8.1.

Thanks a lot for your time

@atali atali closed this as completed May 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants