0
点赞
收藏
分享

微信扫一扫

记录xcode和android调试器的报错合集

捡历史的小木板 2022-03-11 阅读 66

xcode

1.旧版本升到新版本出现字体重复链接等问题

error: Multiple commands produce '/Users/user/App/marathon-app-new/ios/build/marathonAppNew/Build/Products/Debug-iphonesimulator/marathonAppNew.app/Entypo.ttf':
1) Target 'marathonAppNew' (project 'marathonAppNew') has copy command from '/Users/user/App/marathon-app-new/node_modules/react-native-vector-icons/Fonts/Entypo.ttf' to '/Users/user/App/marathon-app-new/ios/build/marathonAppNew/Build/Products/Debug-iphonesimulator/marathonAppNew.app/Entypo.ttf'
2) That command depends on command in Target 'marathonAppNew' (project 'marathonAppNew'): script phase “[CP] Copy Pods Resources”

解决方法:
https://github.com/oblador/react-native-vector-icons/issues/1074
有用:
打开xcode,
在这里插入图片描述

android

1.找不到类

Activity class {com.marathonapp/com.marathonapp.MainActivity} does not exist.

解决方法:
https://www.geeksforgeeks.org/different-ways-to-fix-error-type-3-error-activity-class-does-not-exist-in-android-studio/

2.react-native-push-notification版本与安卓调试器系统版本不匹配

解决办法: react-native-push-notification升级到最新,还要注意@react-native-community/push-notification-ios的版本. (旧APP如果没有涉及到需要重新打包就不用提交这个修改,热更新时也注意还原,怕影响其他东西)
或者:在android/build.gradle添加:

buildscript {
    ext {
    	...
   		firebaseMessagingVersion = "21.1.0"
    }

如果报

code ./node_modules/react-native-screen-brightness/android/build.gradle
implementation 'androidx.core:core:1.+' 改成 implementation 'androidx.core:core-ktx:1.6.0'

3.跑success,但打不开,打开闪退 java.lang.UnsatisfiedLinkError: couldn’t find DSO to load

解决方法:
解决 couldnot find DSO to load: libhermes.so

4.Execution failed for task ‘:app:compileDebugJavaWithJavac’.

在这里插入图片描述
旧版本升级后会出现的问题
解决:
在项目的android/app/src/main/res/values/strings.xml
添加
https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-ios.md#plugin-configuration-for-react-native-lower-than-060-ios

<string moduleConfig="true" name="CodePushDeploymentKey">App CodePushDeploymentKey</string>

5.mutidex之类的报错

在android/app/build.gradle里

defaultConfig {
	...
	multiDexEnabled true
	...
}

6.跑android失败: Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation

Goto android folder > gradle.properties file > add below line

org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
举报

相关推荐

0 条评论