-
Notifications
You must be signed in to change notification settings - Fork 645
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
Android Studio 3.2.0 sync error: Failed to transform android.jar #46
Comments
Sync success with api28 |
I have this issue too. It seems to be some sort of new verification in Gradle 3.2.0. I changed my classpath back to 3.1.4 and it syncs fine. I wonder if there's a new Gradle setting to disable this or if we're out of luck. |
The old version is ok! Gradle 3.2.0 is error in Sync. |
Even I am facing a compilation issue with Android Plugin version 3.2.0 for latest Android Studio which forces Gradle version 4.6. It gives some translation issue with the SDK android.jar. Awaiting android.jar for API version 28 |
You can keep using 4.6. Just change the classpath from 3.2.0 to 3.1.4. |
I think the change responsible for this issue is this one or something related to it: Maybe it'll help figuring out how to workaround this |
I have managed to sync with android gradle plugin 3.2.1, 3.3 RC and 3.4 alpha with android.jar assembled from .class files built from AOSP sources. |
Of course it won't help with the issue of blacklisted APIs with the new Google policy. |
Here's android.jar for API level 28, which I use. |
Thanks. You make it. Gradle 4.10.3, gradle plugin: 3.2.1, compile successful, great job. 👍 😄 |
Hey guys, it does not work with Gradle >= 3.2 and SDK 27, still got the error :/ However, it is working with Gradle v3.1.4 |
NastuzziSamy this is OK. |
@henrichg could you please explain what versions are compatible with each others. I've tried the following configuration for the project and it didn't work:
And after
I got
|
Use android.jar from @daio, attached in comment on 26 Dec 2018. I'm using it with your confguration (except targetSDK = 27 and gradle 4.10.1) an working good. Builded in Android Studio 3.3.1. |
I get the error too, but i replace the Api28 android.jar with origin Api28 android.jar, it is ok |
I wonder how @daio manages to make it work?. |
@mleeaura I've assembled it from AOSP sources. Seems like pulling framework from device no longer works. |
Using the JAR from @daio works great for Pie. You can even bypass the hidden API restriction easily for your app, through Java or Kotlin. Subclass the Application class, add it to your manifest, and put this in the
https://stackoverflow.com/questions/55970137/bypass-androids-hidden-api-restrictions/55970138 |
I did the same, however mine is also not working. I wonder how you are merging framework.jar and existing android.jar. I just unzip them both on a folder and rezip them. What process are you following if you don't mind sharing? |
Sorry, kind of busy lately and I don't have the environment to repeat the process right now. When Android Q is released I'll probably do it again. |
Was it something described here https://stackoverflow.com/a/9118795 ? |
Something like that. As I remember, I also used MockableJarGenerator from the post above to determine which classes fail the transform. I could have removed some of those. |
Haha. Yeah that's where the money is. I haven't played with it but yours worked for me so I've been using it and it works great. |
I tried to reproduce the same steps I did last time with P for Q preview 5, but failed. |
Oh yeah, it doesn't have internal resources because I don't need them |
Receiving this kind of error from CI pipe.
|
@daio can you share one with the latest AOSP release Q-R1? I think a few APIs have changed |
�把api28下载下来的jar包替换成这个,这个后缀zip要改成jar,然后同步就没报错了 ��download this .zip file then rename suffix to .jar gradle/5.1.1 gradle tool:3.4.0 api28 |
@daio jar works fine for compilation but when I try to run unit tests, it fails. Does anyone try to fix that? I am using Android 28. |
@daio I want to compile all the APIs (@hidden,@Systemapi,@unsupportAppUse,etc) to android.jar for androidx(android Q), could you please share the means or steps? Thanks a lot, |
I've also been able to generate an android.jar with AOSP hidden API that works with newer Gradle versions (tested with 6.2). This week (probably tomorrow) I'll share the steps and even a script. |
Checkout this repo I've just created. It contains a modified android.jar with android 10 & also the steps the generate your own. |
@aeab13 Tested android.jar form https://github.com/aeab13/android-jar-with-hidden-api/ and working good for my application PhoneProfilesPlus. Thank you very much. |
You are welcome @henrichg . Let me know if you find any issues. |
DIsable lint check by adding the config works for me :
|
I fix it .
Create class method:
build project. Replace class located in details in https://blog.csdn.net/qq_26413249/article/details/109819624 |
Solved this issue by locating the Platforms folder on local machine @ C:\Users\user\Appdata\local\Android\sdk\platforms deleted the platform version that had issues in my case android-30 then reopened my IDE and proceeded to redownload the SDK again. The error dissappeared |
could not resilve all files for configuration ':apps: AndriodapisFailed to transform android.jar to match attributes {artifactType=android-mockable-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime, returnDefaultValues=false}. |
As 3.2.0 sync error with api27 in this repo:
The text was updated successfully, but these errors were encountered: