I get this error whenever I try anything in the mainActivity.kt file
even in completely new projects (Kotlin)
just hitting enter to jump line brings this error
how do I fix this please ?
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
So I'm trying out xamarin in VS2017, but found this undhandled error:
Unhandled Exception:
Java.Lang.SecurityException: <Timeout exceeded getting exception details>
This is very clueless. How can I get the full information of the runtime error like in Android Studio?
I had the same problem while calling some native API,
solved it by
Put a try catch around the block of got which is throwing the error.
Put a breakpoint in the catch block, you can get actual details of the exception.
After getting assistance from Microsoft, I finally found the solution.
TL;DR
Use VS Android device log and filter with "mono-rt" or "Error"
Complete Answer:
There are 2 solution:
1. Using Android Studio logcat:
Open the Android Studio logcat (View > Tool Windows > Logcat). From the logcat window, choose the device, choose the Xamarin.Android deployed application, and choose logcat for Error
Android logcat will display the runtime error:
2. Using Visual Studio Android Device Log:
Open the Visual Studio Android Device Log(Tools > Android > Device Log).
Here is the tricky bit: Unlike Android Studio, VS list all of the device log, not limited to the Xamarin.Android app deployed. So somehow we have to use the filter to get the relevant information. The problem is, what filter should we use? I used my application name and the error didn't show up. It turns out that when the error happen, the log doesn't contain any of the application name. Instead it has "mono-rt" tag with "Error" type.
So there you have it. Filter it with "mono-rt" tag or "Error" type and you will find the error information
hi I am reading Android Programming: The Big Nerd Ranch Guide.
In chapter 4, it says if I do this in Logcat : "Double-click this line, and Eclipse will take you to that line in your source code."
The problem is I'm using Android Studio and when I double click on that line or any other line it does not take me to the line of code in Android Studio. Is this how is it suppose to be working? If so how do I get to the line of code that caused the exception?
Can anyone please advise?
Android studio will navigate to the line where the exception occurred by double clicking on the logcat. I think your viewing logcat from "Android Device Monitor". If so close it and you will get the default logcat at the bottom of the android studio window.
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.
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.