记录一次NDK版本不匹配,Android打包失败的蛋疼经历

背景:低版本构建的 RN 项目,在一台比较新的机器上,运行的时候NDK版本不对,死活下载不下来,构建一直报错。

首先,在git里面,local.properties是被忽略的,仓库里面是没有的。
要自己新建一个文件,android/local.properties

sdk.dir=/Users/net.cctv3.i/Library/Android/sdk
ndk.dir=/Users/net.cctv3.i/Library/Android/sdk/ndk/26.1.10909125
阅读更多

Duplicate resources --> string/app_name

Execution failed for task ‘:app:mergeReleaseResources’.

[string/app_name] /Users/net.cctv3.i/bookkeeping-mobile/android/app/src/main/res/values/strings.xml [string/app_name] /Users/net.cctv3.i/bookkeeping-mobile/android/app/build/generated/res/resValues/release/values/gradleResValues.xml: Error: Duplicate resources

阅读更多

react-native 上传文件到 Supabase

Supabase 是一个全栈解决方案,它包括了数据库、身份验证、实时更新、存储等服务,适合那些希望减少开发时间和复杂性的应用。

最近在找一个能免费存储的服务商,自己搭的应用,不想写后端,也不想乱七八糟的各种环境的部署。选来选去选择了Supabase

https://github.com/supabase/supabase

74.9K⭐️,懂得都懂 …

Snipaste 2024 12 12 10 13 50

阅读更多

npm publish 发包失败

npm发包失败,直接报错:

npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/react-native-use-toast - You do not have permission to publish "react-native-use-toast". Are you logged in as the correct user?
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
阅读更多

react-native pod install 失败问题汇总

最新版0.76.3报错 …

这个具体的报错信息没给,参考

https://github.com/facebook/react-native/issues/34189

Debugging this issue on my M1 mac, I discovered that I had never set my git config to use the correct line endings for *nix on macOS. UPDATE: I had actually forgotten to unset them after working with a repo with Windows line endings. This means they were set to git config --global core.autocrlf true which is the setting for windows.

This is the correct setting for linux/mac.

git config --global core.autocrlf input

You can also unset them and use the default which is false

git config --global --unset core.autocrlf

After this, you will need to normalize all the line endings in the project (unless you want to re-clone).

https://stackoverflow.com/a/13154031

After you have done the configuration, you might want git to normalize all the files in the repo. To do this, go to to the root of your repo and run these commands:

git rm --cached -rf .
git diff --cached --name-only -z | xargs -n 50 -0 git add -f

If you now want git to also normalize the files in your working directory, run these commands:

git ls-files -z | xargs -0 rm
git checkout .

There are some .bat files for windows that you will not want to change, so discard those.

Once you have done these steps, you shouldn’t need any of the custom workarounds in this thread.

Originally posted by @shwanton in https://github.com/facebook/react-native/issues/34189#issuecomment-1502532287

阅读更多