Skip to content

Commit

Permalink
Merge pull request #687 from Plant-for-the-Planet-org/upgrade/build_f…
Browse files Browse the repository at this point in the history
…ixes

Upgrade/build fixes
  • Loading branch information
mayankkumawat authored Aug 7, 2023
2 parents 1e17faa + 4babc6a commit 4c73bd7
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 58 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ubuntu_build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- develop
- upgrade/*
pull_request:
branches:
- develop
Expand Down Expand Up @@ -95,18 +96,10 @@ jobs:
- name: Fixes for Android Build
run: |
# react-native-reanimated has an incompatible build.gradle file
search="classpath += files(project.getConfigurations().getByName('compile').asList())"
replace="project.getConfigurations().getByName('implementation').setCanBeResolved(true); classpath += files(project.getConfigurations().getByName('implementation').asList())"
sed -i "s|${search}|${replace}|g" node_modules/react-native-reanimated/android/build.gradle
# react-native-mapbox-gl has a problem with a null object
search="telemetry.setUserTelemetryRequestState(telemetryEnabled);"
replace="if (telemetry != null) telemetry.setUserTelemetryRequestState(telemetryEnabled);"
sed -i "s|${search}|${replace}|g" node_modules/@react-native-mapbox-gl/maps/android/rctmgl/src/main/java/com/mapbox/rctmgl/modules/RCTMGLModule.java
# fix problems with 'Error: ENOSPC: System limit for number of file watchers reached'
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
# echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
# fix for task ':app:stripDevelopReleaseDebugSymbols'
(echo y; echo y; echo y;) | sudo $ANDROID_HOME/tools/bin/sdkmanager 'ndk;20.0.5594570'
# (echo y; echo y; echo y;) | sudo $ANDROID_HOME/tools/bin/sdkmanager 'ndk;20.0.5594570'
- name: Caching Gradle dependencies
uses: actions/cache@v1
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ android {
multiDexEnabled true
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 26
versionCode 27
versionName "1.0.9"
missingDimensionStrategy 'react-native-camera', 'general'
manifestPlaceholders = [auth0Domain: "@string/AUTH0_DOMAIN", auth0Scheme: "${applicationId}"]
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
13 changes: 13 additions & 0 deletions android/app/src/release/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

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

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package org.pftp.treemapper;

import android.content.Context;
import com.facebook.react.ReactInstanceManager;

/**
* Class responsible of loading Flipper inside your React Native application. This is the release
* flavor of it so it's empty as we don't want to load Flipper.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// Do nothing as we don't want to initialize Flipper on Release.
}
}
2 changes: 1 addition & 1 deletion app/components/Common/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Header = ({
accessibilityLabel={accessibilityLabel}
style={styles.paddingVertical}>
<Ionicons
name={closeIcon ? 'md-close' : 'md-arrow-back'}
name={closeIcon ? 'close' : 'arrow-back'}
size={30}
color={whiteBackIcon ? Colors.WHITE : Colors.TEXT_COLOR}
/>
Expand Down
3 changes: 2 additions & 1 deletion app/components/Common/MapMarking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ export default function MapMarking({
const checkPermission = async ({ showAlert = false, isOffsite = false }) => {
try {
await locationPermission();
MapLibreGL.setTelemetryEnabled(false);
// @ts-ignore
// MapLibreGL.setTelemetryEnabled(false);
updateCurrentPosition();
return true;
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Common/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function index({ visible, openModal, userCountry }) {
<View style={styles.container}>
<TouchableOpacity style={{ paddingTop: Platform.OS === 'ios' ? 14 : null }}>
<Ionicons
name="md-arrow-back"
name="arrow-back"
size={30}
color={Colors.TEXT_COLOR}
style={styles.iconStyle}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Common/TreeCountModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const TreeCountModal: React.FC<TreeCountModalProps> = ({
<View style={styles.modalBackground}>
<View style={styles.inputModal}>
<Ionicons
name={'md-close'}
name={'close'}
size={30}
color={Colors.TEXT_COLOR}
onPress={() => {
Expand Down
4 changes: 2 additions & 2 deletions app/components/MainScreen/MainMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ const MainMap = ({
const checkPermission = async (showAlert = true) => {
try {
await locationPermission();
MapLibreGL.setTelemetryEnabled(false);

// @ts-ignore
// MapLibreGL.setTelemetryEnabled(false);
updateCurrentPosition(showAlert);
return true;
} catch (err: any) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/ManageSpecies/SpecieInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const SpecieInfo = ({ route }: { route: any }) => {
onPress={() => setIsCamera(true)}>
<View style={{ alignItems: 'center' }}>
<Ionicons
name={'md-cloud-upload-outline'}
name={'cloud-upload-outline'}
size={80}
color={Colors.GRAY_LIGHTEST}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/components/ManageSpecies/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ const ManageSpecies: React.FC<ManageSpeciesProps> = ({
onPress={() => {
setSearchText('');
}}>
<Ionicons name="md-close" size={20} style={styles.closeIcon} />
<Ionicons name="close" size={20} style={styles.closeIcon} />
</TouchableOpacity>
) : (
[]
Expand Down
2 changes: 1 addition & 1 deletion app/components/ProfileModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const ProfileModal = ({
accessible={true}
accessibilityLabel="Profile Modal"
testID="profile_modal">
<Ionicons name={'md-close'} size={30} color={Colors.TEXT_COLOR} />
<Ionicons name={'close'} size={30} color={Colors.TEXT_COLOR} />
</TouchableOpacity>
<View style={styles.logoContainer}>
<SvgXml xml={logo} />
Expand Down
2 changes: 1 addition & 1 deletion app/components/Projects/ProjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getAllProjects } from '../../repositories/projects';
const { protocol, cdnUrl, webAppUrl } = APIConfig;

interface ProjectListProps {
isSelectable?: boolean;
isSelectable: boolean;
onProjectPress?: any;
selectedProjectId?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Projects/SelectProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function SelectProject({}: SelectProjectProps) {
subHeadingText={i18next.t('label.select_project_desc')}
/>
<ProjectList
isSelectable
isSelectable={true}
onProjectPress={onProjectPress}
selectedProjectId={selectedProjectId}
/>
Expand Down
4 changes: 2 additions & 2 deletions app/components/RegisterSingleTree/SingleTreeOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ const SingleTreeOverview = () => {
const checkPermission = async (showAlert = true) => {
try {
await locationPermission();
MapLibreGL.setTelemetryEnabled(false);

// @ts-ignore
// MapLibreGL.setTelemetryEnabled(false);
updateCurrentPosition(showAlert);
return true;
} catch (err: any) {
Expand Down
40 changes: 20 additions & 20 deletions app/components/SampleTrees/TotalTreesSpecies.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,26 +438,26 @@ export default function TotalTreesSpecies() {
</View>
{inventory && Array.isArray(inventory.species) && inventory.species.length > 0
? inventory.species.map((plantedSpecie, index) => (
<TouchableOpacity
onPress={() => {
setSpecie(plantedSpecie);
setSpecieIndex(index);
setShowTreeCountModal(true);
}}
key={index}>
<SpecieListItem
item={plantedSpecie}
index={index}
key={`${plantedSpecie.id}`}
deleteSpecie={() =>
inventory.completedSampleTreesCount > 0
? onPressDelete(index)
: deleteSpecie(index)
}
setSpecieIndex={setSpecieIndex}
/>
</TouchableOpacity>
))
<TouchableOpacity
onPress={() => {
setSpecie(plantedSpecie);
setSpecieIndex(index);
setShowTreeCountModal(true);
}}
key={index}>
<SpecieListItem
item={plantedSpecie}
index={index}
key={`${plantedSpecie.id}`}
deleteSpecie={() =>
inventory.completedSampleTreesCount > 0
? onPressDelete(index)
: deleteSpecie(index)
}
setSpecieIndex={setSpecieIndex}
/>
</TouchableOpacity>
))
: renderMapView()}
</ScrollView>
<View style={{ paddingHorizontal: 25 }}>
Expand Down
2 changes: 1 addition & 1 deletion app/screens/ManageProjectsFlow/ManageProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ManageProjects = ({}: ManageProjectsProps) => {
<View style={styles.container}>
<Header headingText={i18next.t('label.manage_projects')} />

<ProjectList isSelectable={true} />
<ProjectList isSelectable={false} />
</View>
</SafeAreaView>
);
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ PODS:
- React-Core
- RNSVG (13.10.0):
- React-Core
- RNVectorIcons (9.2.0):
- RNVectorIcons (10.0.0):
- React-Core
- RNZipArchive (5.0.6):
- React
Expand Down Expand Up @@ -961,7 +961,7 @@ SPEC CHECKSUMS:
RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c
RNSnackbar: 3727b42bf6c4314a53c18185b5203e915a4ab020
RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
RNVectorIcons: 8b5bb0fa61d54cd2020af4f24a51841ce365c7e9
RNZipArchive: 9dfdaa1d1ad49a423e83df505f292e0ae8126a5d
SimpleKeychain: 130211269f88f038d7dc5254cf0b1b9ce978c398
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand Down
12 changes: 6 additions & 6 deletions ios/treemapper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 128;
DEVELOPMENT_TEAM = "";
CURRENT_PROJECT_VERSION = 130;
DEVELOPMENT_TEAM = UYRJ8SA699;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "$(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR)) arm64";
INFOPLIST_FILE = treemapper/Info.plist;
Expand All @@ -644,7 +644,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.9;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -666,16 +666,16 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 128;
DEVELOPMENT_TEAM = "";
CURRENT_PROJECT_VERSION = 130;
DEVELOPMENT_TEAM = UYRJ8SA699;
INFOPLIST_FILE = treemapper/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = TreeMapper;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.9;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 2 additions & 0 deletions ios/treemapper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<string>We need access to precise location to be able to register trees.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need access to precise location to be able to register trees.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We need access to precise location to be able to register trees.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>TreeMapper would like to save photos from the app to your gallery.</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "^13.6.0",
"react-native-tab-view": "^3.3.4",
"react-native-vector-icons": "^9.2.0",
"react-native-vector-icons": "^10.0.0",
"react-native-zip-archive": "^5.0.6",
"realm": "^11.9.0"
},
Expand Down

0 comments on commit 4c73bd7

Please sign in to comment.