Code: Select all
10 duplicate symbols
Linker command failed with exit code 1 (use -v to see invocation)
Schritt 1 npx @react-nativ-community/cli @neueste init FirstApp
Code: Select all
"react-native": "0.77.0",
< /code>
Schritt 2 Hinzufügen von CodeGen -Einstellung in package.json < /p>
"codegenConfig": {
"libraries": [
{
"name": "NativeLocalStorageSpec",
"type": "modules",
"jsSrcsDir": "specs",
"android": {
"javaPackageName": "com.nativelocalstorage"
}
},
{
"name": "NativeBluetoothSpec",
"type": "modules",
"jsSrcsDir": "specs",
"android": {
"javaPackageName": "com.nativebluetooth"
}
}
]
},
specs/nativebluetooth.ts
Code: Select all
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
enableBluetooth(): void;
}
export default TurboModuleRegistry.getEnforcing('NativeBluetooth');
Code: Select all
import type {TurboModule} from 'react-native';
import {TurboModuleRegistry} from 'react-native';
export interface Spec extends TurboModule {
setItem(value: string, key: string): void;
getItem(key: string): string | null;
removeItem(key: string): void;
clear(): void;
}
export default TurboModuleRegistry.getEnforcing('NativeLocalStorage');
< /code>
Schritt 4 TYPE -Terminalbefehl < /p>
cd ios
bundle install
bundle exec pod install
< /code>
und öffnen Sie Xcode Build Das Projekt Erhalten Sie den Fehler: < /p>
10 duplicate symbols
Linker command failed with exit code 1 (use -v to see invocation)