When I try to sign the apk, I get these two error messages:
com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher: can't find referenced method 'boolean isExternalStorageLegacy()' in library class android.os.Environment
com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher: can't find referenced method 'android.net.Uri setRequireOriginal(android.net.Uri)' in library class android.provider.MediaStore
I went through these two issues, but they are different error messages
Proguard error after adding Glide v4
https://github.com/bumptech/glide/issues/2807
Related
I have updated exoplayer and the exoplayer-extension-ima version from 2.11.1 to the latest one (2.18.2).
Checking the release notes I just saw this on the version 2.18.1 section:
This release corresponds to the AndroidX media3 1.0.0-beta02 release.
So I thought I had to upgrade my exoplayer imports from com.google.android.exoplayer2 to androidx.media3 and I followed this migration guide downloading the script for the 2.18.2 version and changing the LEGACY_PEER_VERSION variable from 2.18.1 to 2.18.2 and executing it withot getting any relevant error.
However after running the assembleRelease gradle script I'm facing the next errors:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'extension-level'. One of '{layoutlib}' is expected.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'extension-level'. No child element is expected at this point.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{codename, tag}' is expected.
:myproject.exoplayer:compileReleaseJavaWithJavac
ExoPlayerListener.java
package com.google.android.exoplayer2.ext.ima does not exist
cannot find symbol class TrackGroupArray
package com.google.android.exoplayer2.trackselection does not exist
cannot find symbol class DefaultEventListener
cannot find symbol class ImaAdsLoader
cannot find symbol class ImaAdsLoader
cannot find symbol class TrackGroupArray
cannot find symbol class TrackSelectionArray
cannot find symbol class ImaAdsLoader
method does not override or implement a method from a supertype
method does not override or implement a method from a supertype
method does not override or implement a method from a supertype
method does not override or implement a method from a supertype
cannot find symbol variable super
On my ExoplayerListener.java some exoplayer imports changed (placing the mouse over them displays a Cannot resolve symbol 'media3' error)
import androidx.media3.common.Player;
import androidx.media3.common.TrackGroupArray;
And some don't (placing the mouse over them displays a Cannot resolve symbol 'android' error)
import com.google.android.exoplayer2.ext.ima.ImaAdsLoader;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
Am I doing something wrong, or is it perhaps that my steps towards the migration aren't correct?
Mention that I haven't changed anything on the code, just changing the below imports on the build.gradle file from:
api 'com.google.android.exoplayer:exoplayer:2.11.1'
api 'com.google.android.exoplayer:extension-ima:2.11.1'
to:
api 'com.google.android.exoplayer:exoplayer:2.18.2'
api 'com.google.android.exoplayer:extension-ima:2.18.2'
And after the migration script changed to:
api 'androidx.media3:media3-exoplayer:1.0.0-beta03'
api 'androidx.media3:media3-exoplayer-ima:1.0.0-beta03'
I have to upgrade my build tool to com.android.tools.build:gradle:3.1.3 with gradle 4.4. My project worked well with proguard previously. But after upgrading, there are a lot of issues as the one below:
MainActivity: can't find referenced method 'void setAlpha(float)' in program class android.view.View
...can't find referenced method 'void execute(java.lang.Runnable)' in program class android.os.AsyncTask
...can't find referenced method 'void overridePendingTransition(int,int)'
...can't find referenced method 'boolean canPause()' in program class android.widget.VideoView
Warning: library class android.app.AlarmManager$AlarmClockInfo depends on program class android.os.Parcelable$Creator
Warning: library class android.graphics.drawable.AdaptiveIconDrawable extends or implements program class android.graphics.drawable.Drawable
What did I miss in my proguard file?
After taking a lot of time looking at the log cat, I saw that every referenced method was Added in API level 11 or above (I am using if/else check) and my min sdk was 15. Any suggestion?
Proguard version is updated with the buildtools, maybe this is an issue with that Proguard version. Have you tried to downgrade (or updgrade) manually your Proguard version to see if the error still occurs ?
override it like this
buildscript {
configurations.all {
resolutionStrategy {
force 'net.sf.proguard:proguard-gradle:x.x.x' //here use whatever version you'd like
}
}
}
and look up your proguard version like this
./gradlew buildEnvironment
This question already have been asked many times, but I am not able to resolve it. I am trying to export my app using eclipse for final release, but I am getting the below error.
I already added
-keep class com.afollestad.materialdialogs.*{ *; }
-dontwarn com.afollestad.materialdialogs.**
-dontshrink
Error resolved, but after running my app crashed.
please help me
this is the error:
Proguard returned with error code 1. See console
Warning: com.afollestad.materialdialogs.util.DialogUtils: can't find referenced method 'android.content.res.ColorStateList getColorStateList(int)' in class android.content.Context
Warning: com.afollestad.materialdialogs.util.DialogUtils: can't find referenced method 'int getColor(int)' in class android.content.Context
You should check if you need to specify additional program jars.
Warning: there were 2 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile them and try again.
Alternatively, you may have to specify the option
dontskipnonpubliclibraryclassmembers'.
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:321)
at proguard.ProGuard.initialize(ProGuard.java:211)
at proguard.ProGuard.execute(ProGuard.java:86)
When I try to export an .apk file it gives me this error:
[2013-06-10 13:46:47 -] Proguard returned with error code 1. See console
[2013-06-10 13:46:47 -] Warning: com.facebook.widget.FacebookFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class com.facebook.widget.FacebookFragment
What could be the reason for it? I dont understand what dontskipnonpubliclibraryclassmembers means?
Thanks
I am currently writing part of an Android application to upload a video to YouTube using the Google Data API. I have the latest version of the API from Google Code, and I have basically copied the example from their Developer's Guide for the time being.
Everything compiles with no warnings or errors, and the app runs fine. But when I call service.insert(...) I get the following stack trace:
ERROR/dalvikvm(19489): Could not find class 'com.google.gdata.data.media.MediaBodyPart$MediaSourceDataHandler', referenced from method com.google.gdata.data.media.MediaBodyPart.initMediaDataHandler
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method com.google.gdata.data.media.MediaBodyPart.initMediaDataHandler
ERROR/dalvikvm(19489): Could not find class 'javax.mail.internet.MimeBodyPart$MimePartDataHandler', referenced from method javax.mail.internet.MimeBodyPart.writeTo
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.attachFile
ERROR/dalvikvm(19489): Could not find class 'javax.mail.internet.MimeBodyPart$MimePartDataHandler', referenced from method javax.mail.internet.MimeBodyPart.getDataHandler
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.setContent
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.setContent
ERROR/dalvikvm(19489): Could not find class 'javax.activation.DataHandler', referenced from method javax.mail.internet.MimeBodyPart.updateHeaders
with a NoClassDefFoundError.
I have all the dependencies for the gdata API linked to my project in Eclipse (the two included in the deps directory of the API, and also javamail, activation and servlet-api), and I have tried adding all the jar files to the classpath in Eclipse. I have looked through the relevant jars and all the classes it claims it can't find are definitely there.
If anyone could help in any way - any ideas at this stage would be greatly appreciated.
Thanks
It turned out that the normal JavaMail/Activation packages currently don't work on Android. The solution was to use JavaMail for Android, which works perfectly.