我的反应本机应用程序运行正常,但突然我开始收到错误:
错误1:Execution failed for task ':react-native-webview:compileDebugKotlin'.
因此,我在 android/build.gradle 中添加了此内容kotlinVersion = "1.5.31",并且还添加了依赖项classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"。
之后我收到以下错误:
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> More than one file was found with OS independent path 'lib/arm64-v8a/libfbjni.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
Run Code Online (Sandbox Code Playgroud)
为此,在 android{...} 下的 android/app/build.gradle 内我添加了:
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libjsc.so'
pickFirst 'lib/arm64-v8a/libjsc.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libfbjni.so'
}
Run Code Online (Sandbox Code Playgroud)
但即使在此之后我再次遇到同样的错误: …
我可以将输入字段中的用户数据保存到段落中,但我想通过单击按钮删除段落的内容。
HTML:
<input type="text" id="name" placeholder="enter">
<br>
<button id="btn" onclick="fn()">click</button>
<div>
<p id="result"></p>
</div>
<button onclick="clear()">clear</button>
Run Code Online (Sandbox Code Playgroud)
爪哇脚本:
function fn(){
var Name = document.getElementById('name').value;
document.getElementById('result').innerHTML += '<br>' + Name;
}
function clear(){
document.getElementById('result').innerHTML = "";
}
Run Code Online (Sandbox Code Playgroud) 我是 flutter 的新手,我正在尝试制作一个应用程序,但我只停留在初始阶段,无法弄清楚问题是什么。下面是我的代码:
import 'package:flutter/material.dart';
void main() => runApp(BMICalculator());
class BMICalculator extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('BMI CALCULATOR'),
),
body: InputPage(),
),
);
}
}
class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}
class _InputPageState extends State<InputPage> {
@override
Widget build(BuildContext context) {
return Center(
child: Text('Body Text'),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
我的浮动操作按钮出错。
下面是错误信息:
Compiler message:
lib/main.dart:29:7: Error: No named …Run Code Online (Sandbox Code Playgroud) 我在反应本机中有一个非常基本的样式问题
下面是我的代码:
[![return (
<View style={{ flex: 1, backgroundColor: "blue" }}>
<ScrollView style={{ flex: 1, backgroundColor: "blue" }}>
<View style={{ flex: 1, backgroundColor: "red" }}>
<Text>Hello</Text>
</View>
<View style={{ flex: 1, backgroundColor: "orange" }}>
<Text>Hello</Text>
</View>
<View style={{ flex: 1, backgroundColor: "green" }}>
<Text>Hello</Text>
</View>
</ScrollView>
<ScrollView style={{ flex: 1, backgroundColor: "blue" }}>
<View style={{ flex: 1, backgroundColor: "red" }}>
<Text>Hello</Text>
</View>
<View style={{ flex: 1, backgroundColor: "orange" }}>
<Text>Hello</Text>
</View>
<View style={{ flex: 1, backgroundColor: "green" }}>
<Text>Hello</Text>
</View> …Run Code Online (Sandbox Code Playgroud) 我有很多天,我正在映射这些天,View但我收到警告Warning: Each child in a list should have a unique "key" prop.,我无法理解为什么会出现此错误。我是原生反应新手,我试图理解每个警告的含义
我的代码:
<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
contentContainerStyle={styles.horizontalView}>
{weekArray.map((item, index) => (
<TouchableOpacity index={index} onPress={() => setIndexSelect(index)}>
<Text
style={{
fontFamily: "Raleway-Regular",
fontSize: SizeConfig.blockHeight * 2.1,
color: indexSelect === index ? COLORS.blackDark : COLORS.blackLight,
}}>
{index === weekArray.length - 1 ? ` ${item.day} ` : ` ${item.day} | `}
</Text>
</TouchableOpacity>
))}
</ScrollView>;
Run Code Online (Sandbox Code Playgroud) 这是我的HTML代码:
<!DOCTYPE html>
<html>
<head>
<title>nested</title>
<link rel = "stylesheet" type = "text/css" href = "style.scss">
</head>
<body>
<div class = "class1">
<h1>Heading</h1>
<p id="p1">Paragraph 1</p>
<p id="p2">Paragraph 2</p>
<div class = "class2">
<h1>Heading</h1>
<p>Paragraph</p>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我的style.scss:
.class1{
h1{
font-size: 25px;
color:#E45456;
}
#p1{
font-size: 25px;
color:#3C7949;
}
#p2{
font-size: 25px;
color:#3C7949;
}
.class2{
h1{
font-size: 25px;
color:#E45456;
}
p{
font-size: 45px;
color:#3C7949;
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的style.scss在命令提示符下编译,并且还生成了一个新的style.css.但是在网页浏览器上,我的页面没有我给它的任何样式.