#nativescript-community/ui-mapbox : Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0 - nativescript

I'm trying to use #nativescript-community/ui-mapbox plugin in my nativesctipt app.
After adding the plugin to my application
ns plugin add #nativescript-community/ui-mapbox
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:map="#nativescript-community/ui-mapbox" navigatingTo="navigatingTo">
<StackLayout>
<Label text="Nice map, huh!" class="title"/>
<ContentView height="240" width="240">
<map:MapboxView
accessToken="your_token"
mapStyle="traffic_night"
latitude="52.3702160"
longitude="4.8951680"
zoomLevel="3"
showUserLocation="true"
mapReady="onMapReady">
</map:MapboxView>
</ContentView>
</StackLayout>
</Page>
When running the tns run android command, I get the following error:
Build file '/Users/Mac/lete/letesell/platforms/android/app/build.gradle' line: 575
A problem occurred configuring project ':app'.
Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0.
Required by:
project :app
project :app > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0

Generate a token with Downloads:Read permission (see detailed doc)
Add this to your App_Resources/Android/app.gradle and replace DOWNLOAD_TOKEN with the one you generated :
repositories {
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = "mapbox"
// You can store secret token in gradle.properties for more security
password = "DOWNLOAD_TOKEN"
}
}
}
Change minSdkVersion to 21 (or whatever the doc says) in your App_Resources/Android/app.gradle

Related

Unable to find locators for App Login - Xamarin.UI Automation test

As our app login page is upgraded from ADAL library to MSAL library. We are unable to find the locators(Automation IDs) for sign in option via Automation.
we tried
App.EnterText(“UserID”);
App.PressEnter();
App.EnterText(“Password”);
App.PressEnter();
but the value is not entering in user name field and got below Exception Exception: System.Exception: No keyboard is visible for text entry.
at Xamarin.UITest.iOS.iOSApp+<>c__DisplayClass19_0.b__0 () [0x0002b] in <5c98084b260c4b7c9bafd9f653301be5>:0
Any suggestions to identify the user name field.
You need to add Xamarin.UITest to the Xamarin.Forms solution first.
And Set the AutomationIdfor the Entry.
xaml:
<Entry AutomationId="UserID" />
<Entry AutomationId="Password" />
UITest:
[Test]
public void test3()
{
app.EnterText("UserID","5");//UserID is 5
app.PressEnter();
app.EnterText("Password","123456");//password is 123456
app.PressEnter();
}

Alpine.js interop - set variable to TypeScript app

I would like to have a checkbox that will set a variable to true when it is clicked
<input #click="settings.advancedMode = true"> type="checkbox" id="AdvancedMode" >
<label for="AdvancedMode">Advanced Mode</label>
In my separate app I initialize a variable like this:
export var settings = {
advancedMode: false,
}
but when I try clicking on the input, I get an error:
Uncaught ReferenceError: settings is not defined
at eval (eval at saferEvalNoReturn (big.ts:3400), <anonymous>:3:21)
at saferEvalNoReturn (big.ts:3400)
at Component.evaluateCommandExpression (evented.js:172)
at runListenerHandler (evented.js:9)
at HTMLInputElement.handler
I should probably use x-bind but I don't know the right syntax for checkbox. As a beginner it would be helpful to have more examples
The issue here is that TypeScript code gets bundled and that bundling process enforces module scoping. This means settings isn't available in the global scope/on the global object.
The solution, which is noted in the docs is to do window.settings = { advancedMode: false };. You should get a TypeScript warning when you do this, the solution to that is to do:
declare global {
interface Window {
settings: any;
}
}
However, this solution won't have settings be a "reactive object": when you change values in it, the user interface (using Alpine.js) won't update.
What you probably want to do is the following.
In a JavaScript/TypeScript file:
window.settings = function () {
return {
advancedMode: false
}
}
Then in your template (HTML/Alpine.js file):
<div x-data="settings()">
<input #click="advancedMode = true"> type="checkbox" id="AdvancedMode" >
<label for="AdvancedMode">Advanced Mode</label>
</div>

The application on react + redux + react-dnd does not work after assembly, why?

when running the test script an error occurs
Invariant Violation: Could not find "store" in the context of "Connect (DragD
ropContext (App)) ". Either wrap the root component in a,
or pass a custom React context provider to and the
corresponding React context Consumer Connect (DragDropContext (App)) in connect options.
although everything works in an unassembled project. As I understand it, there are some problems due to the fact that the root component is wrapped in two hocs - one redox, the other dnd.
ReactDOM.render(<DragDropContextProvider backend={HTML5Backend}>
<Provider store={store}>
<App />
</Provider>
</DragDropContextProvider>, document.getElementById('root'));
I tried to wrap first in dnd, then in redaks - it did not help, everything is the same.
It seems you mixed up the legacy decorator API with the top-level API
Legacy Decorator API
With legacy decorator you can wrap as following:
import HTML5Backend from 'react-dnd-html5-backend'
import { DragDropContext } from 'react-dnd'
class YourApp {
/* ... */
}
export default DragDropContext(HTML5Backend)(App)
Check the documentation about Legacy Decorator API here...
Top-Level API
For the Top-Level API you use:
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
....
...
<div className="App">
<DndProvider backend={HTML5Backend}>
<App />
</DndProvider>
</div>
Check the documentation about Top-level API here...

Redux DevTools could not render

I am using redux-devtools with redux-devtools-dock-monitor and redux-devtools-log-monitor.
I followed documentation. However, in the console I receive this error:
index.js:1452 Redux DevTools could not render.
You must pass the Redux store to <DevTools> either as a "store" prop
or by wrapping it in a <Provider store={store}>.
Here is my Root component:
const Root = () => {
return (
<Provider store={store}>
<div>
<h1>Hello !!!</h1>
<DevTools/>
</div>
</Provider>
);
};
export default Root;
Additionally, I am getting this warning too:
redux-devtools#3.4.2" has incorrect peer dependency "react-redux#^4.0.0 || ^5.0.0".
I have used redux-devtools-log-monitor and redux-devtools-dock-monitor as monitors
I've tried the suggestion and now it gives another error (I'm using the DockMonitor). Ie this is my setup.
<DockMonitor toggleVisibilityKey='ctrl-h'
changePositionKey='ctrl-q'
changeMonitorKey='ctrl-m' >
<LogMonitor />
</DockMonitor>
<Provider store={store}>
<App />
<DevTools store={store} />
</Provider>
Produces the following error:
Uncaught Error: Passing redux store in props has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React-Redux's Provider and specific components like: . You may also pass a {context : MyContext} option to connect
In react-redux#6, the store is not passed via legacy React context and you should specify it explecitely via props like so:
<DevTools store={store}/>
Update 1: It was working for me because I had react-redux#6 in main project, but react-redux#5 for redux-devtools dependency. So if someone needs a quick workaround (you shouldn't include DevTools component in production anyway) till it will be supported, just do: cd ./node_modules/redux-devtools && npm i react-redux#5.
Update 2: redux-devtools#3.5.0 was just published, which adds support for react-redux#6.

Embed URL clickable links in TeamCity build log

I'm trying to embed clickable links in my TeamCity logs.
My custom log message displayed with logging message with the ##teamacity template (documentation):
log("##teamcity[buildProblem description='message to log to TC']");
Now, i want part of the message to be a clickable link, for example, for a screenshot i have taken during the test.
How can it be done?
I'm trying the approach described here, which suggesting installing StaticUIExtensions plugin to TeamCity and adding a rule that will transform log message the looks like url(http://www.autoscout24.de) into a clickable link in the log. It didn't worked for me.
My TeamCity version isEnterprise 8.1.4
I have modified show-link.html script. It works with TC 2017.2.4. And now script looks for "http://" strings instead of "(url)"
show-link.html
<script>
(function ($) {
function createLinksFromUrls() {
$("div .fullStacktrace").each(function () {
var oldHtml = $(this).html();
if(oldHtml.indexOf("<a href=") < 0)
{
var newHtml=oldHtml.replace(/http(.*)/, "<a href='http$1' target='_blank'>htpp$1</a>");
$(this).html(newHtml);
}
});
}
$(document).ready(createLinksFromUrls);
$(document).click(function () {
window.setTimeout(createLinksFromUrls, 50);
window.setTimeout(createLinksFromUrls, 100);
window.setTimeout(createLinksFromUrls, 500);
});
})(window.jQuery);
</script>
static-ui-extensions.xml
<rule place-id="BUILD_RESULTS_FRAGMENT" html-file="show-link.html" >
<url starts="viewLog.html" />
</rule>
<rule place-id="TEST_DETAILS_BLOCK" html-file="show-link.html" >
<url starts="viewLog.html" />
</rule>
I also had this problem. The showlinks.html needs an adjustment. Replace BEFORE_CONTENT with BUILD_RESULTS_FRAGMENT and it will work. The file showlinks.html needs to be placed in the same directory where "beforeContent.html" is located (TeamCity/config/_static_ui_extensions).

Resources