Closed stumpykilo closed 1 year ago
@stumpykilo tried with your sample and it works fine here. Did you set the android theme to material? i think the error is somewhere there
@farfromrefug thank you for your quick response! I did not, can you provide a Vue sample or point me to documentation on how to do that?
Hi @stumpykilo, how did you make axios work? he believed that versions higher than 1.x didn't work
@farfromrefug that change to the styles.xml
resolved the error but am now getting Cannot read property 'nativeView' of undefined
upon the initial load of the component.
@vallemar that is actually an old dependency that we are not using any longer. But when we did it worked with no problems. Here is some of the old code we had in production that was hitting an Azure Function that was using GraphQL:
import axios from "axios";
export const myApi = axios.create({
baseURL: <api_url>
});
var request = {
query: `query {
getSeries {
id,
name
}
}`,
variables: {}
};
var response = await myApi.post("Series", request);
response.data.data.getSeries.forEach(element =>
series.push({
id: element.seriesId,
name: element.name
}));
@stumpykilo please share the error stack
@farfromrefug for the first error that you resolved it was showing that by default but for this other error I don't see anything. Is there a way to turn that on?
I can get it to work if I use v-if="myValue"
but not sure why that is required for Android and not iOS.
Puedo hacer que funcione si lo uso,
v-if="myValue"
pero no estoy seguro de por qué es necesario para Android y no para iOS.
how do you have myValue
declared? it looks like sometime is null or undefined, i don't think it will work with a non-numeric value
data: () => {
return {
myValue: 0
};
},
I think it is related to my @valueChange="onValueChange"
. It must be firing when the MDSlider is initialized and something is not ready.
Confirmed that is what it was. This issue is resolved. Thank y'all for the help!
Well, I may have spoken too soon.
Now when I try and Archive in XCode for iOS I am getting Framework not found MDFInternationalization
. I see this warning: ld: warning: directory not found for option '-F/Users/me/Library/Developer/Xcode/DerivedData/MyApp-foivrqltrnczhecwsrrqmitobbov/Build/Products/Debug-iphoneos/MaterialComponents'
.
Do I need to do something similar as what I had to do for Android styles.xml
?
@stumpykilo What file are you opening in xcode to open the project?
Note: this conversation would be much faster on discord https://nativescript.org/discord
@vallemar thank you for your help. Closing again.
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Recently we added the
@nativescript-community/ui-material-slider
package and started using it in one of our Vue components. It works great in iOS but when we navigate to the component that references the slider on the Android Emulator we get this exception:StackTrace: createNativeView(file:///data/data/myapp/files/app/vendor.js:697:24) at _setupUI(file:///data/data/myapp/files/app/vendor.js:19010:31) at (file:///data/data/myapp/files/app/vendor.js:19054:19) at eachChildView(file:///data/data/myapp/files/app/vendor.js:29958:28) at eachChild(file:///data/data/myapp/files/app/vendor.js:21484:14) at _setupUI(file:///data/data/myapp/files/app/vendor.js:19053:14) at (file:///data/data/myapp/files/app/vendor.js:19054:19) at eachChildView(file:///data/data/myapp/files/app/vendor.js:29958:28) at eachChild(file:///data/data/myapp/files/app/vendor.js:21484:14) at _setupUI(file:///data/data/myapp/files/app/vendor.js:19053:14) at (file:///data/data/myapp/files/app/vendor.js:19054:19) at eachChildView(file:///data/data/myapp/files/app/vendor.js:29958:28) at eachChild(file:///data/data/myapp/files/app/vendor.js:21484:14) at _setupUI(file:///data/data/myapp/files/app/vendor.js:19053:14) at (file:///data/data/myapp/files/app/vendor.js:19054:19) at eachChildView(file:///data/data/myapp/files/app/vendor.js:16205:13) at eachChildView(file:///data/data/myapp/files/app/vendor.js:31945:15) at eachChild(file:///data/data/myapp/files/app/vendor.js:21484:14) at _setupUI(file:///data/data/myapp/files/app/vendor.js:19053:14) at _addViewCore(file:///data/data/myapp/files/app/vendor.js:18903:18) at _addView(file:///data/data/myapp/files/app/vendor.js:18892:14) at onCreateView(file:///data/data/myapp/files/app/vendor.js:25761:19) at onCreateView(file:///data/data/myapp/files/app/vendor.js:23539:40) at com.tns.Runtime.callJSMethodNative(Native Method) at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302) at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188) at com.tns.Runtime.callJSMethod(Runtime.java:1175) at com.tns.Runtime.callJSMethod(Runtime.java:1153) at com.tns.Runtime.callJSMethod(Runtime.java:1149) at com.tns.FragmentClass.onCreateView(FragmentClass.java:55) at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3104) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:524) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760) at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 3: TypedValue{t=0x2/d=0x7f0300d0 a=7}, theme={InheritanceMap=[id=0x7f0f0008myapp:style/AppTheme, id=0x7f0f000bmyapp:style/AppThemeBase29, id=0x7f0f000amyapp:style/AppThemeBase21, id=0x7f0f0009myapp:style/AppThemeBase, id=0x7f0f0219myapp:style/Theme.AppCompat.Light.NoActionBar, id=0x7f0f0213myapp:style/Theme.AppCompat.Light, id=0x7f0f0052myapp:style/Base.Theme.AppCompat.Light, id=0x7f0f00admyapp:style/Base.V28.Theme.AppCompat.Light, id=0x7f0f00aamyapp:style/Base.V26.Theme.AppCompat.Light, id=0x7f0f00a4myapp:style/Base.V23.Theme.AppCompat.Light, id=0x7f0f00a2myapp:style/Base.V22.Theme.AppCompat.Light, id=0x7f0f0098myapp:style/Base.V21.Theme.AppCompat.Light, id=0x7f0f00b0myapp:style/Base.V7.Theme.AppCompat.Light, id=0x7f0f012emyapp:style/Platform.AppCompat.Light, id=0x7f0f0139myapp:style/Platform.V25.AppCompat.Light, id=0x1030241android:style/Theme.Material.Light.NoActionBar, id=0x1030237android:style/Theme.Material.Light, id=0x103000candroid:style/Theme.Light, id=0x1030005android:style/Theme], Themes=[myapp:style/AppTheme, forced, myapp:style/LaunchScreenTheme, forced, myapp:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]} at android.content.res.TypedArray.getColorStateList(TypedArray.java:600) at com.google.android.material.resources.MaterialResources.getColorStateList(MaterialResources.java:81) at com.google.android.material.resources.TextAppearance.(TextAppearance.java:86)
at com.google.android.material.resources.MaterialResources.getTextAppearance(MaterialResources.java:145)
at com.google.android.material.tooltip.TooltipDrawable.loadFromAttributes(TooltipDrawable.java:158)
at com.google.android.material.tooltip.TooltipDrawable.createFromAttributes(TooltipDrawable.java:119)
at com.google.android.material.slider.BaseSlider.parseLabelDrawable(BaseSlider.java:502)
at com.google.android.material.slider.BaseSlider.access$000(BaseSlider.java:195)
at com.google.android.material.slider.BaseSlider$1.createTooltipDrawable(BaseSlider.java:378)
at com.google.android.material.slider.BaseSlider.createLabelPool(BaseSlider.java:756)
at com.google.android.material.slider.BaseSlider.setValuesInternal(BaseSlider.java:737)
at com.google.android.material.slider.BaseSlider.setValues(BaseSlider.java:693)
at com.google.android.material.slider.BaseSlider.processAttributes(BaseSlider.java:421)
at com.google.android.material.slider.BaseSlider.(BaseSlider.java:384)
at com.google.android.material.slider.Slider.(Slider.java:71)
at com.google.android.material.slider.Slider.(Slider.java:67)
at com.google.android.material.slider.Slider.(Slider.java:63)
... 22 more