Skip to content

Commit

Permalink
RN Upgrade: Android fixes
Browse files Browse the repository at this point in the history
details: (these are purely my logs of what issues I faced and the fixes I tried, not necessarily included in the commit)
- [x] AOS: [refer: https://reactnative.dev/docs/environment-setup]
    - [x] Issue: “> Task :app:installDebug FAILED” ; Solution: worked only on real device and not on the simulator after doing this: adb kill-server && adb start-server && adb devices && rpm run android [refer: https://stackoverflow.com/a/28211161/1374730]
    - [x] Issue: “More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'” ; Solution: [refer: https://stackoverflow.com/a/74526307/1374730]
    - [x] Issue: “Duplicate class com.facebook.imagepipeline.cache.CountingMemoryCacheInspector$DumpInfoEntry found in modules jetified-imagepipeline-base-2.5.0-runtime.jar (com.facebook.fresco:imagepipeline-base:2.5.0) and jetified-stetho-2.0.0-runtime.jar (com.facebook.fresco:stetho:2.0.0)” ; Solution: [refer: https://stackoverflow.com/a/72838513/1374730]
    - [x] Issue: “android:attr/lStar not found” [refer: https://stackoverflow.com/a/72838513/1374730]
    - [x] Issue: “> Task :react-native-community_slider:generateDebugRFile FAILED” ; Solution: “changed `compileSdkVersion` to 30” [refer: callstack/react-native-slider#325 (comment)] & another solution: [refer: https://stackoverflow.com/a/66673453/1374730]
    - [x] Issue: “> Task :react-native-sound:compileDebugJavaWithJavac FAILED” ; Solution: cd android && ./gradlew clean && cd .. && npx jetify [refer: https://www.appsloveworld.com/react-native/100/171/react-native-execution-failed-for-task-react-native-audiocompilereleasejavaw]
    - [x] Issue: “> java heap space” ; Solution: [refer: https://stackoverflow.com/a/69239438/1374730]
    - [x] Issue: “Caused by: java.io.IOException: Cannot run program "node" (in directory "): error=2, No such file or directory” ; Solution: [refer: https://stackoverflow.com/a/69681064/1374730]
    - [x] Issue: “> Cannot get property 'supportLibVersion' on extra properties extension as it does not exist” ; Solution: [refer: software-mansion/react-native-reanimated#280 (comment)]
  • Loading branch information
saru2020 committed Jan 29, 2023
1 parent d129833 commit ecaeede
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
5 changes: 1 addition & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ android {
}

packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/x86/libc++_shared.so"
pickFirst "lib/x86_64/libc++_shared.so"
pickFirst '**/*.so'
}

// applicationVariants are e.g. debug, release
Expand Down
16 changes: 11 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
supportLibVersion = "30.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.2")
classpath('com.android.tools.build:gradle:3.6.4')

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -34,4 +35,9 @@ allprojects {
jcenter()
maven { url 'https://www.jitpack.io' }
}
configurations.all {
resolutionStrategy {
force 'com.facebook.react:react-native:0.62.2' //select Version you used
}
}
}
4 changes: 3 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.33.1
FLIPPER_VERSION=0.99.0
org.gradle.jvmargs=-Xmx2g -XX\:MaxHeapSize\=4g
org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
6 changes: 3 additions & 3 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Nov 28 23:45:05 IST 2017
#Sun Jan 29 21:07:39 IST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-rc-1-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
zipStoreBase=GRADLE_USER_HOME
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/slider": "^4.4.1",
"@react-native-community/slider": "^3.0.3",
"jetifier": "^2.0.0",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-sound": "^0.11.0"
Expand Down

0 comments on commit ecaeede

Please sign in to comment.