How to show compilation errors in android studio - android

I want to know how to show compilation errors in Android Studio. I tried the following one:
Android Studio: Where is the Compiler Error Output Window?
But it is showing another error:
javac: invalid target release: 1.8
Anybody who knows the actual solution please reply.

There is a 'Problems' view in the project window:
Just click on the drop down (Android setting is default) and select 'Problems'. Not comparable to eclipse problems view tough...

Using F2
In addition to what the other answers say, you can find errors by pressing F2 or Shift+F2. This is useful when you can't see the where the red indicator is on the side bar.

There's "Messages" tab in Android Studio. Complilation errors and warning go there. You can select it by pressing alt+0 (⌘+0 in OS X - a shortcut to View|Tool Windows|Messages).

I was looking for the "Problems" view that you can see in Eclipse when building projects. For that, you can go to Analyze -> Inspect Code
Where is the warnings view in Android Studio?
and then I clicked on "Group by Severity" so that I could see the warnings and errors.

In the toolbar, go to Analyze -> Inspect Code
After That, you will have the Inspection Results window with the detailed errors and warnings. see image:

Next / Previous highlighted error: F2/Shift + F2
Show descriptions of error at caret: Ctrl+F1

Related

java.lang.NullPointerException when dataBinding enabled = true

Whenever I enable this in my app gradle
dataBinding {
enabled = true
}
and then sync -> It completely succeed.
but when I "run" it, It builds fail and shows this error
java.lang.NullPointerException
at android.databinding.tool.store.LayoutFileParser.parseOriginalXml(LayoutFileParser.java:135)
at android.databinding.tool.store.LayoutFileParser.parseXml(LayoutFileParser.java:93)
...
my app has little amount of Kotlin code, and android version is 3.5, minSdkVersion 19, targetSdkVersion 28, and upgraded to androidX
How can I solve this? which part should I search for solve this problem???
except above code, every thing works perfect.
Edit
And when I rolled back my code before upgrading to androidX and compiled it, it also shows "Null point exception" and at this time, there are no extra message without just "Null point exception".
Finally I got answer. (cc. android databinding error:Execution failed for task ':app:dataBindingProcessLayoutsDebug')
I guessed it was because of BOM. Someone said it will happen when the code is used in two different circumstances(Window and Mac).
So in 'res' folder, I clicked 'remove BOM' button in android studio and that action changed some xml files.
<?xml version="1.0" encoding="utf-8"?>
But it wasn't worked in Mac. This solution worked only in Window.
I tried a little too much but I figured it out. I created the project on the Mac computer and it wasn't a problem when I switched to windows later. When I tried to create a new file, I got this error and just understood why. Every time I right-clicked on the file I just added, I saw an option called "remove BOM". Clicking this solved my problem. But I did not find the solution to the problem logically, I just found it random.
ex: https://prnt.sc/riw6ex

Android kotlin doesn't show dagger error log

I will get straight to the problem. Android studio isn't showing me, the Dagger 2 ( version 2.14.1 ) errors in the logcat. By this I mean. In the below image you can see the error "Error:(29, 10) Unresolved reference: DaggerAppComponent". Which for me is very unclear. Is there any way to configure the project in such a way to see more information? ( I am hoping to see ( in the logcat ) something like in the second picture )
First Image
Second Image
Here is a link to the project: https://drive.google.com/file/d/1bZ8niQK01xP-khD_20o4h7QI5XXrMYvx/view?usp=sharing
You have to check in gradle console in the bottom/right of the window, not in logcat

Android Studio Mac new project errors after freshly created project

When I create a new project on android studio, I get the error. "URI is not registered" on my xmlns:android="http://schemas.android.com/apk/res/android" . I go to my event log, click configure, and the error goes away, yet I get errors in the "android:icon, label and theme" values under application along with the "android:name and label" attributes under activity in the AndroidManifest.xml.
Also, when trying to open my activity_main.xml layout files, I get the error
10:23:12 AM IllegalStateException: #NotNull method com/android/tools/idea/rendering/ManifestInfo.getActivityThemes must not return null
It works on the PC, but I am definitely missing something on the Mac. Thanks for all of the help!
Update to version 3.0 Canary build on Mac. Fixes all problems.

How can I find out what line an exception is being thrown on in Eclipse (Android)

I have a ClassCastException being thrown saying that I'm trying to cast a SeekBar as a Button but I've looked over my code 50 times and not once do I try to cast a SeekBar as a Button. How can I find out what line this apparent class mis-cast is on?
Thank you.
That information is available in the LogCat. See this link for details on how to use it.
If you are sure you are not doing such a cast, then clean the project by running ant clean (command line), or going to Project -> Build -> Clean (eclipse)
Insert a break point and simply step through until I hit the line that triggers the exception.

Android Memory Analysis

I have to search for memory leaks in an Application at the moment and have a workflow problem. This ( http://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html ) blog post states:
If you're running ADT (which includes a plug-in version of DDMS) and
have MAT installed in Eclipse as well, clicking the “dump HPROF”
button will automatically do the conversion (using hprof-conv) and
open the converted hprof file into Eclipse (which will be opened by
MAT).
But wen I press the button within eclipse and try to open the hprof file I get this error - so I still have to do the conversion:
Error opening heap dump 'com.baseapp.foo.hprof'. Check the error log
for further details. Error opening heap dump
'com.baseapp.foo.hprof'. Check the error log for further details.
Unknown HPROF Version (JAVA PROFILE 1.0.3) (java.io.IOException)
Unknown HPROF Version (JAVA PROFILE 1.0.3)
anyone knows what I am doing wrong here? I am using ADT 16
I had this issue on my setup also, it seems there is a certain series of steps that cause eclipse to default to saving to a file (instead of doing the conversion and opening it).
Anyway to fix it:
Preferences (The global Eclipse ones) -> Android -> DDMS -> HPROF Action -> set to "Open in Eclipse" (Mine was previously on "Save to Disk")
Convert hprof file take from Android OS into standard hprof format. For this you can use hprof-conv tool that is located at AndrodiSDK/tools/hprof-conv.
Like this
hprof-conv android.hprof mat.hpof
And then open mat.hprof in Memory Analyzer.
The error message indicates that there are additional details in the error log (Window > Show View > Error Log). Can you clear the log, then reproduce the problem, then see what if anything appears in the error log to help pinpoint the problem?

Categories

Resources