Error type 3 Error: Activity class {com.xxx/com.xxx.MainActivity} does not

本文介绍了解决build.gradle中的applicationId与AndroidManifest.xml中的package名称不一致导致的问题的方法。确保这两个文件中定义的应用包名一致是避免构建错误的关键。

遇见问题不要慌张。

1,这个问题是因为你build.gradle里的applicationId与AndroidManifest.xml里面的package不一致导致的。

Initializing Gradle Language Server vscode这个一直在加载是什么意思 还有我运行一个pda项目 PS F:\mom-mls-pda> npx react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1363 file(s) to forward-jetify. Using 8 workers... info JS server already running. info Installing the app... The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal. Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects. If the parent project does not need the plugin, add 'apply false' to the plugin line. See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl The Kotlin plugin was loaded in the following projects: ':react-native-pager-view', ':react-native-screens', ':shopify_flash-list' > Task :app:installDebug Installing APK 'pda_mls_mom_x86_64_2.0.765.apk' on 'Small_Phone(AVD) - 11' for app:debug Installed on 1 device. BUILD SUCCESSFUL in 1m 38s 360 actionable tasks: 2 executed, 358 up-to-date info Connecting to the development server... info Starting the app on "emulator-5554"... Starting: Intent { cmp=com.hoolinks.mls.mom/.MainActivity } Error type 3 Error: Activity class {com.hoolinks.mls.mom/com.hoolinks.mls.mom.MainActivity} does not exist. PS F:\mom-mls-pda> 总结报错原因 最好深入底层 我这个项目一直卡在这步骤 我已经改了以下文件的build.gradle的 repositories 分别是文件:react-native-pager-view、react-native-screens 、 shopify flash-list 、@react-native-picker 都把对应文件build.gradle的 repositories的改成跟项目的F:\mom-mls-pda\android\build.gradle一样的repositories repositories { // google() // jcenter() maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url = "https://maven.aliyun.com/repository/gradle-plugin" } maven { url = "https://maven.aliyun.com/repository/public" } } 然后别人也只是和我一样改了上面的一些repositories 为什么他们之后可以直接npx react-native run-android 启动项目而我不行 难道是因为我用了不同版本的yarn.lock 然后别人都能直接运行起来 所以我认为我不能去改android\build.gradle里面的内容 公司统一的
08-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值