Android Studio: can no longer see dependencies javadoc - android

Android Studio v3.0 Canary 4,
but happens for me on Android Studio v2.3.3 too
I'm not sure since when this started to happen, what version or configuration I've made (if any), but I can no longer see libraries/dependencies javadoc:
for instance, RxJava:
Even though, Android SDK does show the javadocs correctly:
This is true for all libs I have, I looked everywhere on the net for this issue, and it seems like I'm the only one.

As a workaround, you can manually specify JavaDoc.
Navigate to jar file, select "Library Properties", click "Specify Documentation URL".
For RxJava 2.x: http://reactivex.io/RxJava/2.x/javadoc/
For RxJava 1.x: http://reactivex.io/RxJava/1.x/javadoc/
Detailed how-to can be found here

It's a bug. Allegedly it was fixed last month, but from what I've seen some extra monkeying is needed to get the correct behavior back - I downloaded the latest Android O artifacts from the SDK Manager, then temporarily changed all build.gradle settings to support Android O, then switched back, and now I see the javadoc again even without supporting O. Here's the bug report: https://issuetracker.google.com/issues/37140074

What you can do as a workaround is to inspect a class in the dependency, and it'll give you the decompiled byte code with an option to "Download...". Click that, source is downloaded, and now you have javadocs. You have to do this for each dependency, but it persists through cleans and resyncs.

Related

Unsupported kotlin version

My gradle build completes successfully, but I get:
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.5.31` that
might work differently than in the requested version `1.6.10`.
All of my build.gradle.kts scripts refer to using version 1.5.31. The only association my project has with version 1.6.10 is that Android Studio has the Kotlin version 1.6.10 plugin added. If I try to disable that plugin, I get a message that several other plugins will be disabled. If I accept that, android studio crashes and will not start up again. It won't start up again even if you reinstall android studio again. The solution is to find the file named "disabled-plugins.txt" and delete that file. It's in your AppData folder and in a JetBrains subdirectory. It turns out that it's one or more of those other disabled plugins that prevents Android Studio from starting up again.
The question I have is how do I fix this version mismatch issue. I can't delete the plugin from Android Studio for the reasons I mentioned above. If I try to update my project to using version 1.6.10 I get literally 100's of unresolved dependencies. And it seems from opinionated investigation that 1.6.10 still have too many issues for general use.
By the way, when I look at the gradle window for the project I can see where the dependencies come from. Usually when I look at the gradle window I just see sub project folders that I can drill into for more information, but for this project, it has an additional folder name dependencies. I don't know how they get into my project. But when I look at their version numbers that's where the 1.6.10 mismatch happens.
So, I think I understand why the warning message is valid, I'm at a lost on what I need to do to correct this situation. For the moment, I'm just ignoring the warning, and so far I'm not finding any issues in proceeding that way. But that's means I'm proceeding, without an understanding of what's going on here! Sometimes that's okay and at other times that's a bad judgment The error message itself seems inverted. I would think that 1.6.10 is the embedded kotlin and kotlin-dsl since it an android studio plugin, but the error message seems to say it in the opposite way. So anyway, if someone can bring some clarity as to what's going on, and how I'm thinking wrongly about this problem would be greatly appreciated.
I'll accept the following as the answer to what's going on about the unsupported kotlin version:
https://github.com/gradle/gradle/issues/13020
So, for the moment, I'll go on like this is just a nuisance warning and ignore that.
What I just did was to re-create my Android Studio from a blank brand new project. I copied and pasted stuff from the previous project into the new project. I copied the source and build.script.kts files, so essentially everything is a copy of the disabandoned project. This new project didn't give me the WARNING message anymore. And in additional, I'm now able to upgrade my project to using kotlin 1.6.10, which I previously couldn't do because of the literally 100's of dependencies resolution issues. Whatever, that issue went away, and a lot of others things started working as expected once I recreated the project. I can't say what got my project into that weird state. Deleting the .gradle and .idea folders, wouldn't fix the problem. I didn't try deleting the JetBrains cache, I wish I would have tried that.

Crashlytics libraries not recreated in my project using eclipse

I'm using Crashlytics (part of Fabric now) in my eclipse Android project. The four automatically added Crashlytics libraries don't get recreated in my project after deleting them from file system.
Restart eclipse doesn't help
Reinstalling Fabric plugin doesn't help
The plugin says it's installed correctly, but I can't import:
io.fabric.sdk.android.Fabric;
com.crashlytics.android.Crashlytics;
Has anybody come to a similar situation?
Detailed description of how that happened for me:
When I installed the plugin for the first time, the plugin integrated into my project. It added a couple of .properties files and also 4 libraries (nested them weirdly to my project folder under /kit-libs/ and also added them to my workspace even though just one was set as a library project to my project).. Uhh, well, can't say I like this way of integration.
Anyway, I removed these automatically created libraries because I switched to an old commit of my project which hadn't used Fabric at that time and I needed to make a build quickly. I don't use any build tools for this project and I didn't find any information about how to remove the plugin, so I just deleted the libraries from file system and removed the library project.
When I switched back to current commit, the libraries got recreated. But I needed to do the same thing once again, so I switched to an old commit, deleted the library folders, removed library project and did my thing. However, after I switched back to a new commit, the 4 libraries don't get recreated anymore.
Will be glad for any tips.
I eventually managed to get the libraries back to my project by checking out another commit (which included them).
After the library folders were back, I added /kit-libs/com-crashlytics-sdk-android_crashlytics as a library project to my project and everything worked again.
Now thinking about it, it may have been git's fault.
I also contacted Fabric support team and this is what they replied:
Try onboarding that app again by going to the plugin and clicking +
New App in the right hand side. If you've removed all traces of
Fabric, you should be able to re-onboard it, no problem.
However, I believe I removed all traces of Fabric, tried this and it didn't work - added my app to Fabric again, but it didn't recreate the libraries. It's hard to say what they mean by all traces of
Fabric, it's not documented anywhere. Possibly it's:
/assets/crashlytics-build.properties (*)
/kit-libs
/res/values/com_crashlytics_export_strings.xml (*)
/crashlytics.properties
/kits.properties
That's what I particularly don't like about this tool, it spreads its files all over the shop without you even knowing.
Another thing is, they also don't explicitly tell you that you shouldn't commit two of these files (*) to source control. You find out only by exploring the new files and noticing a comment:
Do NOT modify, delete, or commit to source control!
I had a similar issue, but my requirement was not to allow the twitter kit provided by Crashlytics (Fabric) to recreate itself every time i start eclipse.
I tried deleting the libraries from kit-libs but every time i restart eclipse the twitter kit was automatically added back into my project. I dug deep into the issue and found that there is file called kits.properties (you can find this next to your manifest file or somewhere down the lane).
This file specifies the Crashlytics libraries that needs to be loaded into your project. In my case i removed the package name com.twitter.sdk.android:twitter:1.1.0 (i only needed the twitter kit to be removed) which eventually stopped the re-creating process.
For your case, you need to put back the line com.crashlytics.sdk.android:crashlytics:2.1.0 into the file and restart eclipse for the library to be recreated. Please note, the package specified varies based on your installed version. The package name given above is the most recent one.
I had similar issue com-crashlytics-sdk-android_beta is deleted and project starts giving error that the com-crashlytics-sdk-android_beta file not found.
I cleaned all projects and this makes every thing working fine. Fabic added new library for the project.
Clean projects Step:
1) Go to Projects in eclipse from menu.
2) Click Clean.
3) Select clean all projects.
I had a similar issues with the crashlytic libraries .jar files missing and not being re-built. The error message I got was: "The container 'Android Dependencies' references non existing library" for com-crashlytics-sdk-android_answers, _beta, _crashlytics, _crashlytics-core.
After many tries and searches over several days, I tried again and there was an upgrade of crashlytic. The upgrade itself did not solve the issue but the steps described by ValayPatel and georgiecasey in this post (note, I'm not working with any facebook APIs in my app):
The container 'Android Dependencies' references non existing library 'facebook-android-sdk\facebook\bin\com_facebook_android.jar'
it worked! Thanks to both!
Hope it helps who ever else gets that problem...

NotificationCompat cannot be resolved to a type

I am newer to Android and receive the error message: "NotificationCompat cannot be resolved to a type"
MinSDK=9, TargetSDK=18,
As of yet, all sources are very vague on how to resolve this issue and simply note: "update the JAR files".
What JARs do I need and where can I find them, so that this issue is resolved?
You need the support library. Here are the instructions on how to download them: http://developer.android.com/tools/support-library/setup.html
I needed to add "android-support-v4.jar" to my project to use the ActionBar.
From the support link (which has been updated)
With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX
From the menu: Refactor > Migrate to AndroidX...
You will be prompted to back up your project to a zip. After that, a Refactor Preview will be shown in the console area. You should see a button "Do Refactor".
This will remove the error under the noted conditions. You may find some lines of code now report as deprecated after the refactor.
Sometimes Eclipse gets hung up on this class, and no amount of cleaning and rebuilding will make it recognize that you have, in fact, added the support library and imported the correct class. I don't know why it always happens with this particular class. But the solution is to close and restart Eclipse.

Renderscript in a library project will cause findViewById() return null

I met exactly the same issue as in Android Build in Eclipse not generating the right resource ids in R.java, since that link doesn't have a "renderscript" tag, I reported it here again with some additional info.
In sum, if I create a library project and added some custom renderscripts the following issue will occur. If I link the library project with another UI project by adding
android.library.reference.1=..xxx
in the UI project's project.properties file, then calling findViewById() in that UI project will always return null, no matter what I did. If I remove the custom renderscript in the library project, the UI project works fine.
I also tried to delete all the possible resources in the library project (only the renderscript resource was kept), the same issue occurs. So this proves that the issue was caused by renderscript.
I'm working with the latest SDK bundle "adt-bundle-windows-x86-20131030" and Android SDK Tools version 22.3, Platform tools version 19, Build tools version 19.
The same issue occurs in the earlier SDK versions as well.
Is this a bug with Eclipse ADT? Is there any workaround solution before a fix. Thank you!
Update:
Some updates. I found a "solution" to this issue. If I use the old "adt-bundle-windows-x86-20130729" SDK bundle to compile and launch the application (it will success) and then switch back to the "adt-bundle-windows-x86-20130917" or the "adt-bundle-windows-x86-20131030" (the new ones), this problem will disappear! I tried this in two machines and it all behave like that. I don't know the reason why but hope this will help you if you meet the same problem.
Some updates. I found a "solution" to this issue. If I use the old "adt-bundle-windows-x86-20130729" SDK bundle to compile and launch the application (it will success) and then switch back to the "adt-bundle-windows-x86-20130917" or the "adt-bundle-windows-x86-20131030" (the new ones), this problem will disappear! I tried this in two machines and it all behave like that. I don't know the reason why but hope this will help you if you meet the same problem.

Adding Support Libraries to Android project

Why am I having such a hard time getting into the swing of Android development? I've been developing in various languages over the years and, for some reason, just can't seem to get beyond that "jeez-i-still-feel-a-total-noob" stage with Android.
So I'm trying to add an Action Bar to my Android 2.3.3 project. No problem, right? The Android developers website has a nice and clear article explaining exactly how to do it. Of course it involves adding the appcompat v7 support library. No problem, even this is documented step-by-step on this page. But, as with just about every such exercise in Android, I find that you can do exactly what the page tells you to do, it still won't work without significant amount of Googling to fix the errors that you encounter afterwards.
So I've followed the steps under "Using Eclipse" in the section "Adding libraries with resources" in the above link. The first error I get is Unable to resolve target 'android-16'. No problem, this one I could figure out for myself but I'm curious, is there anything in the documents I've been following that would have suggested to me that I need Android 4.1.2 (API16) installed? Did I just read right over it or should I have known by myself that, to do what I'm trying to do, I would need API16?
Never mind, at least I can fix that but then I get a new problem. As soon as I add the android-support-v7-compat library to my project and click the OK button, the console output lights up with errors, the first one being:
C:...\android-support-v7-appcompat\res\values-v14\styles_base.xml:24:
error: Error retrieving parent for item: No resource found that
matches the given name 'android:Widget.Holo.ActionBar'.
and the other 60 odd errors are similar but for different given names.
I would really appreciate if anyone could help me out here. Obviously I'd like to know how to solve this particular problem but if anyone could give me some tips on how to get past this very frustrating stage of learning this new development environment, I would be ever so thankful. What is it that I should have done differently not to run into these kinds of errors, other than following the instructions on the Android Developers website step by step?
OK, I guess I should post an answer as I've eventually managed to solve my own problem.
It turns out I have to use a build target of Android 4.2.2, regardless of the fact that I'm specifically developing for Android 2.3.3 - I mean, that's why I'm using support libraries after all. I imagine it might be possible that some other lower target (but higher than 2.3.3) would still work I just used the highest one I have installed and it solved the problem.
How I was supposed to know this from following the step-by-step instructions on the Android Developers website is a mystery to me. The reason I decided to try changing the targetSdkVersion was because of the final section in the page referenced in the question. It reads "If you are increasing the backward compatibility of your existing application to an earlier version of the Android API with the Support Library, make sure to update your application's manifest." Now I'm not increasing the backward compatibility of my existing application. I'm changing an existing application that targets 2.3.3 to be able to include an Action Bar (seems more like "forward compatibility"). I tried upgrading the targekSdkVersion though as I was out of ideas and lo and behold, it worked.
Don't know if it helps you at all, but I've been struggling with a similar issue for several hours and finally managed to resolve it. In my case, inside my own project's styles.xml file, I was referencing the AppCompat style in the wrong way in the parent attribute.
I was using:
<style name="AppBaseTheme" parent="android:Theme.AppCompat">
where I should have used:
<style name="AppBaseTheme" parent="#style/Theme.AppCompat">
My mistake was in the reference to the theme.
I found that setting the Android target to 2.3.3 for the library project android-support-v7-appcompat solves this issue. You don't need to set your project's target higher, but the library's target lower.
You have pinpointed the all important document and the relevant section "adding libraries with resources":
http://developer.android.com/tools/support-library/setup.html
The error suggests that your project is not able to find these resources. Please double check the following :
You have checked "is library" on the library project
You have exported the jars IN THE LIBRARY PROJECT as described in that section
You have added the library project as a reference to your app project
You have added the android-support-v4.jar to your libs folder in your app project
If this is all definitely correct, check eclipse for any error messages - is it the library project or the app project that lights up like the proverbial Christmas Tree ?
First of all check if you have done all the described steps as explained on the developers site. Then, for the errors :
Unable to resolve target 'android-16'
Make sure that you have installed API16, this errors occurs if you have mentioned your targetsdk to 16 in your Manifest while the sdk for API16 is not installed. You can either install the API or edit the targetApi of your project to the minimum required version, for the support library you are using I think API 11 is the minimum required android version.
android:Widget.Holo.ActionBar
This error should also be fixed once the targetsdk is fixed in your project. Since to use Holo.ActionBar you'l need to target your project to minimum supported api level ie. 11 or higher.
I met similar problems. Using API 18, ADT.
To solve the "Unable to resolve target 'android-16' problem", I remove the import lib project and repeat what the tutorial says.
Then I found I couldn't really "add" the library to my project. (The instruction "In the Library pane, click Add." there is not that detail.
1. In your project -> properties -> Java build path -> Libraries -> Add Library... -> Android Classpath Container -> Select the lib project
2. In your project -> properties -> Android -> add... -> choose the lib -> apply
cheers
Here is how I avoided the error, " Unable to resolve target 'android-16'", when adding v7.
First, I followed the instructions for adding support libraries with resources in eclipse. Following step 4, I clicked Finish. That's when I saw the error message, android-support-v7-appcompat] Unable to resolve target 'android-16'.
Second, I read this post. I also opened the download manager, but did not need anything updated. In order to make sure that I followed the steps exactly as correctly as I could, I deleted the android-support-v7-appcompat project and started over.
This second time I didn't check any different boxes, after all. But, I also got no errors at step 4. Who can say why?
Thanks, Dewald, you expressed in this question the same frustration I have. Is experience the only way out?
If some of your resource xml files cannot find their respective AppCompat references, make sure you also add the support libraries to your project properties. You do this by:
1.) right clicking on your project in the project
2.) Select properties. (Bottom of the menu)
3.) click Android on the left hand side menu of the new pop up window
4.) In the libraries section, click the "add button"
5.) Select the respective libraries. (If none show up, check to see if they are already displayed in the "libraries" window of the pop up menu. If there is a red x by the desired library, try and resolve that issue first.)
6.) Once there is a green checkmark next to the desired libraries, make sure the "Is Library" option in the libraries section IS NOT selected.
7.) Click apply.
8.) Close the pop up menu.
If this doesn't work, let me know and I can help you out. I spent three hours on the problem so I know pretty much all the possible things that can go wrong with the set up.
Go to Project -> uncheck Build Automatically
Go to Project -> Clean... , clean both the library project and your app project
Export your app as a signed APK while Build Automatically is still disabled

Categories

Resources