Skip to content

Commit

Permalink
fixed react-native-camera issue on android
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi.taghdic committed Mar 5, 2022
1 parent b39f7d1 commit a1f1d14
Show file tree
Hide file tree
Showing 10 changed files with 7,011 additions and 35,245 deletions.
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import com.android.build.OutputFile
*/

project.ext.react = [
enableHermes: false, // clean and rebuild if changing
enableHermes: true, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down Expand Up @@ -137,6 +137,7 @@ android {
versionCode 1
versionName "1.0"
manifestPlaceholders = [auth0Domain: "mortitotti.auth0.com", auth0Scheme: "${applicationId}"]
missingDimensionStrategy 'react-native-camera', 'general'
}
splits {
abi {
Expand Down Expand Up @@ -223,3 +224,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
7 changes: 6 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactnativeotp">

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.CAMERA" />

<!-- optionally, if you want to record audio: -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
Expand All @@ -13,6 +17,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import com.facebook.react.bridge.JSIModulePackage; // reanimated
import com.swmansion.reanimated.ReanimatedJSIModulePackage; //reanimated
import java.util.List;

public class MainApplication extends Application implements ReactApplication {
Expand All @@ -33,6 +35,12 @@ protected List<ReactPackage> getPackages() {
protected String getJSMainModuleName() {
return "index";
}

@Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage(); // reanimated
}

};


Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
ext {
buildToolsVersion = "30.0.2"
// buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
Expand Down
9 changes: 7 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'react-native-reanimated/plugin'
],
]
};
Loading

0 comments on commit a1f1d14

Please sign in to comment.