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
Related
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
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
I recently added some .gifs to my /drawable so that I can use them with buttons. This worked fine (no errors). Now, when I go to rebuild/run my application, I get the following error:
Error: Gradle: Execution failed for task ':MyProject:mergeDebugResources'. > Index: 0
I'm not sure how to fix this (and there appears to be no other similar issues that I could find online.
Edit: Now it's the same error, but it also says (at the end of the first error)
Running /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt failed. See output
Okay, I fixed the issue. It was quite weird.
A) I had some capital letters in my res/drawables folder. Not too weird -- I can see how that would remove the first error.
B) Then, however, a lot of values in my main activity file became undefined. I had to manually import 'com.myapp.R'. Now that was weird.
Fortunately, everything is now working.
I hope that if anyone gets the same errors as me, that this response can help them.
In my latest project , I use two native libraries.Some time it shows an error code in log cat
"05-13 14:00:09.930: A//system/bin/app_process(5774): stack corruption detected: aborted",
But sometimes it work properly.I dont know how to solve this problem any one please help me.
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.