skiptools / skip-ui

SwiftUI for Android
https://skip.tools
GNU Lesser General Public License v3.0
128 stars 14 forks source link

Skip is unable to match this API call to determine whether it results in a View. Consider adding additional type information. #16

Closed cleamaec closed 1 year ago

cleamaec commented 1 year ago

I have encountering this warning in some of the Views modifiers together with the Unresolved reference error. Is there a way to fix this?

For example, I have this view and the .cornerRadius modifier is throwing this error.

Button(action: action) {
    Image(systemName: icon)
        .font(.subheadline)
        .foregroundColor(.white)
}
.frame(width: 60.0, height: 60.0)
.background(Color.red)
.cornerRadius(10.0)
aabewhite commented 1 year ago

Sorry for the trouble. Skip does not yet support all of SwiftUI. Trying to use most unsupported API should give you a clear error message that it is unsupported. If Skip doesn't know anything about an API at all, though, you may get errors like those you're describing instead. In this particular case, "cornerRadius" has been marked as deprecated in SwiftUI, and we generally don't include deprecated API in Skip. Use .clipShape() with a RoundedRectangle instead.

cleamaec commented 1 year ago

Oh okay got it. I encountered the unsupported API error as well so just wondering if this is a different issue. Thanks for the tip!