Obsolete
Status Update
Comments
ko...@gmail.com <ko...@gmail.com> #2
Can you provide the below requested information to better understand the issue:
Can you please test with latest library and update result here.
https://developer.android.com/topic/libraries/support-library/revisions.html
If possible please provide a complete sample application.
Expected output
What do you expect to occur?
Current output
What do you see instead?
Can you please test with latest library and update result here.
If possible please provide a complete sample application.
Expected output
What do you expect to occur?
Current output
What do you see instead?
lb...@gmail.com <lb...@gmail.com> #3
This seems to be intended according to https://issuetracker.google.com/74278849 , the suggestion is to remove the extra logic to deliverResult() in onStartLoading().
sa...@gmail.com <sa...@gmail.com> #4
@gg..@google.com
Sample project is attached.
Steps to test:
1. Import, build and install apk
2. Notice "Number of 'onLoadFinished' calls: 1"
3. Click "Click me!" button to start Second Activity
4. Notice "Number of 'onLoadFinished' calls: 2"
EXPECTED: At stap 4 "Number of 'onLoadFinished' calls" should be 1.
ACTUAL: It's 2.
@ha...@gmail.com
That's not the solution because developers are not in control of all Loaders. For example CursorLoader from support libaray should be then fixed by google, not by developers.
And this is behavior change which is not documented, so suggestion on issuetracker is not good enough.
Sample project is attached.
Steps to test:
1. Import, build and install apk
2. Notice "Number of 'onLoadFinished' calls: 1"
3. Click "Click me!" button to start Second Activity
4. Notice "Number of 'onLoadFinished' calls: 2"
EXPECTED: At stap 4 "Number of 'onLoadFinished' calls" should be 1.
ACTUAL: It's 2.
@ha...@gmail.com
That's not the solution because developers are not in control of all Loaders. For example CursorLoader from support libaray should be then fixed by google, not by developers.
And this is behavior change which is not documented, so suggestion on issuetracker is not good enough.
lb...@gmail.com <lb...@gmail.com> #5
We have shared this with our engineering team and will update this issue with more information as it becomes available.
wu...@gmail.com <wu...@gmail.com> #6
Do you have any news ?
ch...@google.com <ch...@google.com> #7
@6 I think they changed the way it works, without much information about the change.
Try this solution I've written about (read the last part of the text too, as it talks about the changes) :
https://stackoverflow.com/a/22675607/878126
Try this solution I've written about (read the last part of the text too, as it talks about the changes) :
lb...@gmail.com <lb...@gmail.com> #8
@7 Thank you for your information. I still get the error when orientation change
lb...@gmail.com <lb...@gmail.com> #9
@8 I can't confirm. It works fine without any error .
Attached sample project, that "loads" content, and after 5 seconds returns a result, that will be returned on the current Activity.
Attached sample project, that "loads" content, and after 5 seconds returns a result, that will be returned on the current Activity.
ju...@gmail.com <ju...@gmail.com> #10
OK I'll check it again. Thx a lot!
lb...@gmail.com <lb...@gmail.com> #11
@9 Hello man, when orientation change the "onLoaderFinished" method, called again. Do you know how to stop calling this method?
ju...@gmail.com <ju...@gmail.com> #12
@11 It is called only once after onCreate is called, just as intended.
The reason is that after you load something, you wish to use it. After orientation change, all is destroyed, but the result is still available, so you can use it.
If you don't want to use the result, either ignore it, or check whether the loader (if existing) has a result or not.
But this loses the whole point of using a loader. By using a loader, you are supposed to use its result, even after an orientation change.
The reason is that after you load something, you wish to use it. After orientation change, all is destroyed, but the result is still available, so you can use it.
If you don't want to use the result, either ignore it, or check whether the loader (if existing) has a result or not.
But this loses the whole point of using a loader. By using a loader, you are supposed to use its result, even after an orientation change.
lb...@gmail.com <lb...@gmail.com> #13
@11 I hope Google will put the needed proguard rules inside its own libraries, instead of us trying to find what can fix it.
It should also warn about not adding them, and have the error saying that it might be the cause for it.
It should also warn about not adding them, and have the error saying that it might be the cause for it.
ch...@gmail.com <ch...@gmail.com> #14
@julien: It doesn't work for me. Do you put this in your proguard-rules.pro or in the default proguard-android.txt file? I have tried both, but it doesn't work :-(
lb...@gmail.com <lb...@gmail.com> #15
@13 Try what I did on @11 . I think it works fine. You are supposed to put it in proguard-rules.pro
ch...@gmail.com <ch...@gmail.com> #16
@14: Done this already but the same error. Tried it in proguard-rules.pro and proguard-android.txt! Always the same error :-(
ch...@gmail.com <ch...@gmail.com> #17
@14 Now it is working. Have cleaned up and retried. Works. Thanks.
lb...@gmail.com <lb...@gmail.com> #18
@16 I think only a small part of what I wrote is needed. Maybe even just one line.
sj...@gmail.com <sj...@gmail.com> #19
I got the above stacktrace only on release builds after updating my project to Play Services 8.1. For me, turns out it was caused by the accidental inclusion of dependency on Admod by Google in Google Play Services 8.1:
https://plus.google.com/+GoogleDevelopers/posts/HsSNWEQ6H4e
You can exclude the 'play-services-ads' module in build.gradle (and update proguard rules) to fix this - see this SO answer for details:
http://stackoverflow.com/a/33375306/937715
You can exclude the 'play-services-ads' module in build.gradle (and update proguard rules) to fix this - see this SO answer for details:
ch...@gmail.com <ch...@gmail.com> #20
@18: Ok, but it seems this is only if you are using Analytics.
ma...@gmail.com <ma...@gmail.com> #21
Google Play Services 8.3 was released today. Has somebody testet it yet? Right now im using following in my proguard rules;
-keep class com.google.android.gms.** { *; }
-keep public class com.google.android.gms.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
-dontwarn com.google.android.gms.**
and its working so far
-keep class com.google.android.gms.** { *; }
-keep public class com.google.android.gms.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
-dontwarn com.google.android.gms.**
and its working so far
lb...@gmail.com <lb...@gmail.com> #22
@20 It actually got me into more issues. This time it claims a resource can't be found, even though it really does exist inside the project.
Then, I did a clean-project, and got this error:
Error:Execution failed for task ':app:packageRelease'.
> Unable to compute hash of D:\android\Android studio Projects\...\app\build\intermediates\classes-proguard\release\classes.jar
So I've deleted the build folder, and restarted Android-Studio, and then it deleted by itself the whole project, including all source files. I can't restore the files, and I've made a lot of changes since the last time...
Now I need to somehow remember what I did and restore it all.
Then, I did a clean-project, and got this error:
Error:Execution failed for task ':app:packageRelease'.
> Unable to compute hash of D:\android\Android studio Projects\...\app\build\intermediates\classes-proguard\release\classes.jar
So I've deleted the build folder, and restarted Android-Studio, and then it deleted by itself the whole project, including all source files. I can't restore the files, and I've made a lot of changes since the last time...
Now I need to somehow remember what I did and restore it all.
lb...@gmail.com <lb...@gmail.com> #23
I've succeeded restoring the app, but now when I generate a singed APK, I got this crash error at runtime :
11-06 19:58:18.438 28937-28937/com.lb.app_manager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lb.app_manager, PID: 28937
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lb..../com.lb.app_manager.activities.main_activity.MainActivity}: android.content.res.Resources$NotFoundException: File res/layout/abc_screen_simple_overlay_action_mode.xml from xml type layout resource ID #0x7f030014
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2358)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: android.content.res.Resources$NotFoundException: File res/layout/abc_screen_simple_overlay_action_mode.xml from xml type layout resource ID #0x7f030014
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2843)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2798)
at android.content.res.Resources.getLayout(Resources.java:1143)
at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(SourceFile:381)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(SourceFile:280)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:254)
at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:109)
at com.lb.app_manager.activities.main_activity.MainActivity.onCreate(SourceFile:48)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.io.FileNotFoundException: res/layout/abc_screen_simple_overlay_action_mode.xml
at android.content.res.AssetManager.openXmlAssetNative(Native Method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:503)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2825)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2798)
at android.content.res.Resources.getLayout(Resources.java:1143)
at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(SourceFile:381)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(SourceFile:280)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:254)
at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:109)
at com.lb.app_manager.activities.main_activity.MainActivity.onCreate(SourceFile:48)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
11-06 19:58:18.438 28937-28937/com.lb.app_manager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lb.app_manager, PID: 28937
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lb..../com.lb.app_manager.activities.main_activity.MainActivity}: android.content.res.Resources$NotFoundException: File res/layout/abc_screen_simple_overlay_action_mode.xml from xml type layout resource ID #0x7f030014
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2358)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: android.content.res.Resources$NotFoundException: File res/layout/abc_screen_simple_overlay_action_mode.xml from xml type layout resource ID #0x7f030014
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2843)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2798)
at android.content.res.Resources.getLayout(Resources.java:1143)
at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(SourceFile:381)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(SourceFile:280)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:254)
at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:109)
at com.lb.app_manager.activities.main_activity.MainActivity.onCreate(SourceFile:48)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.io.FileNotFoundException: res/layout/abc_screen_simple_overlay_action_mode.xml
at android.content.res.AssetManager.openXmlAssetNative(Native Method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:503)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2825)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2798)
at android.content.res.Resources.getLayout(Resources.java:1143)
at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(SourceFile:381)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(SourceFile:280)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:254)
at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:109)
at com.lb.app_manager.activities.main_activity.MainActivity.onCreate(SourceFile:48)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
am...@gmail.com <am...@gmail.com> #24
Facing Same issue with ProGaurd
sa...@google.com <sa...@google.com> #25
Thank you for your feedback. We assure you that we are doing our best to address the issue reported, however our product team has shifted work priority that doesn't include this issue. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with latest bug report here https://goo.gl/TbMiIO .
Description
Version used:
compileSdkVersion 23
buildToolsVersion '22.0.1'
minSdkVersion 9
targetSdkVersion 22
...
compile 'com.android.support:appcompat-v7:23.1.0'
...
minifyEnabled true
shrinkResources true
Theme used:
dynamic, but based on Theme.AppCompat.Light.DarkActionBar or Theme.AppCompat (user choice)
Devices/Android versions reproduced on:
emulator with Android 6
In my app, I set the theme dynamically.
Recent update of appCompat (23.1.0) has caused new issues arise, as when I generate the signed APK, I get this error (which doesn't exist on non-signed APKs):
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lb.app_manager/com.lb.app_manager.activities.main_activity.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(SourceFile:309)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(SourceFile:278)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.setContentView(SourceFile:252)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.support.v7.app.AppCompatActivity.setContentView(SourceFile:109)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at com.lb.app_manager.activities.main_activity.MainActivity.onCreate(SourceFile:48)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-15 23:44:16.970 4918-4918/com.lb.app_manager E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
- Relevant code to trigger the issue.
setting the theme on onCreate method of the main activity, before the call to super.onCreate .
- A screenrecord or screenshots showing the issue (if UI related).
none, but note that even if I set android:theme inside the manifest, I still get this error.
Sadly, on a new project that I create, this issue cannot be reproduced. No idea why.