小编Abh*_*rav的帖子

运行“react-native run-android”时出错

运行我的本机代码时react-native run-android出现错误。它工作正常。但是在从 git 中获取新的 pullnpm ci并且在我运行之后然后收到这个错误。

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > The minCompileSdk (30) specified in a
     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
     is greater than this module's compileSdkVersion (android-29).
     Dependency: androidx.core:core:1.7.0-alpha01.
     AAR metadata file: C:\Users\gauraab\.gradle\caches\transforms-2\files-2.1\9e02d64f5889006a671d0a7165c73e72\core-1.7.0-alpha01\META-INF\com\android\build\gradle\aar-metadata.properties.
Run Code Online (Sandbox Code Playgroud)

javascript android android-sdk-2.3 react-native

36
推荐指数
5
解决办法
1万
查看次数

如何在 React Native 中绘制虚线边框样式

我正在使用以下样式,我正在尝试绘制虚线边框样式,但它始终是实心的。请建议。

<View style={{paddingLeft:10,
 height:300, marginBottom:10, 
 borderWidth:1,
 borderStyle: 'dashed',
 borderColor:'red',
 borderTopColor:'white'}}>
Run Code Online (Sandbox Code Playgroud)

// 谢谢

javascript css reactjs react-native

17
推荐指数
3
解决办法
2万
查看次数

从另一个屏幕导航后如何重新加载页面

// 我正在使用以下代码将一个屏幕导航到另一个屏幕,即主页。但是当我浏览主页时,我必须刷新页面 ..reload 。目前,当我来到主屏幕时,生命周期方法没有被调用。特别是 UserAvatar 组件,我必须刷新或回忆。请建议

    <View style={{textTransform: 'lowercase'}}><YellowBtn label="Go to 
  Dashboard"
               OnClick={this._redirectCustomerView}/></View>


        _redirectCustomerView = () => {
            this.props.navigation.navigate('UserHome');
          };
Run Code Online (Sandbox Code Playgroud)

// 下面是首页

 export default class App extends React.Component {
      constructor(props) {
        super(props);
        this.state = { title: 'Hello!', hasFooterPermission: false };
        console.log("Valuueeeeeee");
      }

      async componentDidMount() {
        const homeFooter = await hasPermission('clm.360D.fe.restrictedView.allowed');

        this.setState({
          hasFooterPermission: homeFooter
        })
      }

      onSearchClick = () => {
        this.props.navigation.navigate('SubscriberSearch');
      };
      componentWillMount(){
        console.log(" Home page dataaaa");
      }


      render() {
        return (
          <View>
            <ImageBackground source={BG} style={{ width: '100%', height: '100%' …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native react-redux

5
推荐指数
2
解决办法
6290
查看次数

构建失败,出现本机反应异常

运行时的反应原生运行Android的我得到异常下面......它运行良好,我做了git pull,做了NPM词,之后,它是未来。新拉也没有变化。事实上,在执行 git Colon 之后,这也是同样的问题。它在 MAC 中运行良好。请帮助我被卡住了。

FAILURE:构建失败,出现异常。

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
        is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
        Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:13:5-33:19 to override.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help …
Run Code Online (Sandbox Code Playgroud)

android react-native

5
推荐指数
1
解决办法
2万
查看次数

在React Native中查找数组元素的总和

这里我正在映射financialTransactionDetail数组并填充数据。价值观进展顺利。现在我必须得到 的总和TransactionAmount,比如数组的长度是 3 有 3 TransactionAmount,我必须找到 1050+1050+1050 = 3150 的总和。我尝试起诉 load hash ,但没有得到正确的值。\n请帮助。

\n\n
// Below is the array value \nfinancialTransactionDetail: Array(3)\n0:\nAdjustedAmount: "0"\nNetTransactionAmount: "1050"\nTransactionAmount: 1050\n1:\nAdjustedAmount: "0"\nNetTransactionAmount: "1050"\nTransactionAmount: 1050\n\n2:\nAdjustedAmount: "0"\nNetTransactionAmount: "1050"\nStatus: "Unpaid"\nTransactionAmount: 1050\n\n__typename: "FinancialTransactionDetail"\n///////////////////////     \n<Tab heading="INVOICE SPECIFIC">\n                      { !_.isEmpty(financialTransactionDetail.financialTransactionDetail) && financialTransactionDetail.financialTransactionDetail.map(\n                        (data, index) => {\n                         // this.state.sum+= Sum(parseInt( data.TransactionAmount));\n                          this.state.transactionAmount=_.sum(data.TransactionAmount) ;\n                          console.log("sum data ",this.state.transactionAmount);\n                          return(\n                            <View key={index} style={{flexDirection:\'row\', padding:10, alignItems:\'center\', justifyContent:\'space-between\'}}>\n                          <View style={{paddingRight:10, marginRight:10}}>\n                            <CheckBox style={styles.checkBox} color="#00678f" checked={this.state.isChecked} onPress={() =>this.handleChange()}/>\n                          </View>\n                          <View style={{flexDirection:\'column\',flex:1, padding:10, borderWidth:1, borderColor:\'lightgrey\', …
Run Code Online (Sandbox Code Playgroud)

javascript ecmascript-6 reactjs react-native

3
推荐指数
1
解决办法
1872
查看次数

在 Android 中的眼睛图标上显示和隐藏密码

在这里我正在创建登录屏幕,我必须在其中输入用户名和密码,在密码字段中我设置了眼睛图标。当输入密码时,密码将被隐藏,单击眼睛图标后,它应该显示真实的字符。我已经提到了我的 XML 和 java 代码。请查看并帮助我解决方案。我需要在 gradle 中添加任何内容吗?请建议。谢谢

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    tools:context="com.tecnotree.selfcare.ui.login.LoginActivity">

    <VideoView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:visibility="gone"
        android:id="@+id/background_video_view"
        />
    <!-- Login progress -->

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:contentDescription="@string/tecnotree_selfcare"
        android:src="@drawable/login_background"
        android:scaleType="centerCrop"/>

    <ProgressBar
        android:id="@+id/login_progress"
        style="?android:attr/progressBarStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:visibility="gone" />

    <ScrollView
        android:id="@+id/login_form"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/email_login_form"
            android:layout_width="match_parent"
            android:padding="@dimen/paddingLarge"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:layout_marginLeft="0dp"
                android:layout_marginRight="0dp"
                android:background="@drawable/sc_card_rounded_login"
                android:orientation="vertical">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="@dimen/marginLarge"
                    android:layout_marginBottom="@dimen/marginLarge"
                    android:contentDescription="@string/tecnotree_selfcare"
                    android:src="@drawable/logo" />

                <TextView
                    style="@style/AppTheme.TextWhiteLargeBold"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Simple, Secure …
Run Code Online (Sandbox Code Playgroud)

android android-edittext kotlin android-textinputlayout material-components

1
推荐指数
1
解决办法
9819
查看次数

如何计算数组值

有3个数组,在该值中,我必须计算_activityStatus的数量:“ I”(ony I值)。我正在尝试的一种方法是

    StepsStatus :[]

    StepsStatus = StepsVaue.map(StepsVaue => {
          return StepsVaue._activityStatus;
    }); 
Run Code Online (Sandbox Code Playgroud)

我正在StepsStatus中使用所有_activityStatus。现在,我只需要计算自己的价值即可。

currentNextActivity: Array(3)
    0:
    __typename: "CurrentNextActivity"
    _activityName: "FXL_ACT1"
    _activityStatus: "I"
    _maxHoldTime: "60"
    _userName: "tecnotree"

   1:
    __typename: "CurrentNextActivity"
    _activityName: "FXL_ACT2"
    _activityStatus: "I"
    _maxHoldTime: "60"
    _userName: "tecnotree"
    __proto__: Object

    2:
    __typename: "CurrentNextActivity"
    _activityName: "FXL_ACT3"
    _activityStatus: "N"
    _maxHoldTime: "120"
    _userName: null
Run Code Online (Sandbox Code Playgroud)

谢谢

reactjs react-native

0
推荐指数
2
解决办法
91
查看次数