RN混合开发坑1-版本问题

论坛 期权论坛 脚本     
匿名技术用户   2020-12-27 15:50   11   0

由于RN出版本的速度很快,版本之间的差异应该还挺大,RN混合开发第一篇中,的方法已经无法用到0.33这样的版本上了,建议最直接的方法就是自己利用RN命令初始化一个Helloworld,然后通过Helloworld目录结构及内容,再找找不一样的地方适配一下。小白之后都是这么干的。
现在说说,遇到的闪退问题这个坑。
原因小白没有分析出来,对比Helloworld之后,发现少了如下东西

 ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
        splits {
        abi {
            reset()
            enable false
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }

我把build.gradle全部贴上,看的清楚

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.test.testhello"
        minSdkVersion 23
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
      ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
        splits {
        abi {
            reset()
            enable false
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile "com.facebook.react:react-native:+"
}

加上之后就不闪退了,随后继续发现坑中。。。

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP