我有一个使用人行横道的android / cordova项目。当我尝试构建时,我有以下错误:
// Set the dimensions of the canvas / graph
var margin = {
top: 30,
right: 20,
bottom: 30,
left: 50
},
width = 800 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
// Parse the date / time
var parseDate = d3.time.format("%b %Y").parse;
// Set the ranges
var x = d3.time.scale().range([0, width]);
var y = d3.scale.linear().range([height, 0]);
// Define the axes
var xAxis = d3.svg.axis().scale(x)
.orient("bottom");
var yAxis = d3.svg.axis().scale(y)
.orient("left");
var line = d3.svg.line()
.interpolate("basis")
.x(function (d) {
return x(d.date);
})
.y(function (d) {
return y(d.value);
});
// Adds the svg canvas
var svg = d3.select("#d3-line-chart")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")");
//get the data
d3.csv("test.csv", function (error, data) {
var res = [];
var cols = d3.keys(data[0])
.filter(function (key) {
return key;
});
for (var j = 0; j < cols.length - 1; j++) {
var col = cols[j];
var row = [];
for (var i = 0; i < data.length; i++) {
row.push({
symbol: col,
date: data[i]["date"],
value: +data[i][col]
});
}
res.push(row);
}
// Scale the range of the data
x.domain(d3.extent(res, function (d) {
return d.date;
}));
y.domain([0, d3.max(res, function (d) {
return d.value;
})]);
svg.selectAll(".line")
.data(res)
.enter().append("path")
.attr("class", "line")
.attr("d", line);
// Add the X Axis
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
// Add the Y Axis
svg.append("g")
.attr("class", "y axis")
.call(yAxis);
});
但我在我的config.xml中设置了ver17:
:processArmv7DebugManifest/app/platforms/android/AndroidManifest.xml:31:5-74 Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [org.xwalk:xwalk_core_library:20.50.533.12] /app/platforms/android/build/intermediates/exploded-aar/org.xwalk/xwalk_core_library/20.50.533.12/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.xwalk.core" to force usage
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:processArmv7DebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processArmv7DebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [org.xwalk:xwalk_core_library:20.50.533.12] /app/platforms/android/build/intermediates/exploded-aar/org.xwalk/xwalk_core_library/20.50.533.12/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.xwalk.core" to force usage
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
此外,它在platforms / android / AndroidManifest.xml中是相同的:
<preference name="android-minSdkVersion" value="17" />
<preference name="android-targetSdkVersion" value="17" />
我试图移除然后再添加回人行横道和平台android&#34;本身,但错误仍然存在。
请帮忙
答案 0 :(得分:3)
这似乎是新的Crosswalk版本的一个问题,他们取消了对较旧的Andorid API的支持。 将config.xml中的Crosswalk版本更改为先前版本19解决了我的问题
<preference name="xwalkVersion" value="19" />
答案 1 :(得分:3)
尝试使用minSdkVersion标志构建:
cordova build android -- --minSdkVersion=16
注意双重 - 是有意的