Fakultas Ilmu Komputer UI

Commit 501de49c authored by Wulan Mantiri's avatar Wulan Mantiri
Browse files

[CHORES] Fix apk build error

parent a53e6c38
...@@ -34,14 +34,14 @@ sonar-scanner: ...@@ -34,14 +34,14 @@ sonar-scanner:
-Dsonar.branch.name=$CI_COMMIT_REF_NAME -Dsonar.branch.name=$CI_COMMIT_REF_NAME
-Dsonar.projectKey=$SONARQUBE_PROJECT_KEY -Dsonar.projectKey=$SONARQUBE_PROJECT_KEY
build: android:
stage: build stage: build
before_script: before_script:
- yarn install - yarn install
- export ANDROID_SDK_ROOT=/usr/lib/android-sdk - export ANDROID_SDK_ROOT=/usr/lib/android-sdk
script: script:
- cd android - cd android
- chmod +x gradlew && ./gradlew assembleRelease - chmod +x gradlew && ./gradlew clean && ./gradlew assembleRelease
- cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk - cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
artifacts: artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME" name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
......
...@@ -78,7 +78,8 @@ import com.android.build.OutputFile ...@@ -78,7 +78,8 @@ import com.android.build.OutputFile
*/ */
project.ext.react = [ project.ext.react = [
enableHermes: false, // clean and rebuild if changing entryFile: "index.js",
enableHermes: true, // clean and rebuild if changing
] ]
apply from: "../../node_modules/react-native/react.gradle" apply from: "../../node_modules/react-native/react.gradle"
...@@ -186,6 +187,7 @@ dependencies { ...@@ -186,6 +187,7 @@ dependencies {
//noinspection GradleDynamicVersion //noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
......
...@@ -8,3 +8,6 @@ ...@@ -8,3 +8,6 @@
# http://developer.android.com/guide/developing/tools/proguard.html # http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here: # Add any project specific keep options here:
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
...@@ -5,7 +5,6 @@ import android.content.Context; ...@@ -5,7 +5,6 @@ import android.content.Context;
import com.facebook.react.PackageList; import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication; import com.facebook.react.ReactApplication;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage; import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.th3rdwave.safeareacontext.SafeAreaContextPackage;
import com.oblador.vectoricons.VectorIconsPackage; import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactNativeHost;
......
rootProject.name = 'dietela_mobile' rootProject.name = 'dietela_mobile'
include ':@react-native-community_async-storage' include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android') project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':react-native-safe-area-context'
project(':react-native-safe-area-context').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-safe-area-context/android')
include ':react-native-vector-icons' include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
......
import 'react-native-gesture-handler';
import { AppRegistry } from 'react-native'; import { AppRegistry } from 'react-native';
import App from './src/app'; import App from './src/app';
import { name as appName } from './app.json'; import { name as appName } from './app.json';
......
import 'react-native-gesture-handler';
import React, { FC } from 'react'; import React, { FC } from 'react';
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack'; import { createStackNavigator } from '@react-navigation/stack';
import { ThemeProvider } from 'react-native-elements'; import { ThemeProvider } from 'react-native-elements';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Toast from 'react-native-toast-message'; import Toast from 'react-native-toast-message';
import * as ROUTES from 'constants/routes'; import * as ROUTES from 'constants/routes';
...@@ -16,28 +14,26 @@ const Stack = createStackNavigator(); ...@@ -16,28 +14,26 @@ const Stack = createStackNavigator();
const App: FC = () => { const App: FC = () => {
return ( return (
<SafeAreaProvider> <ThemeProvider theme={theme}>
<ThemeProvider theme={theme}> <NavigationContainer>
<NavigationContainer> <Stack.Navigator
<Stack.Navigator initialRouteName={ROUTES.initial}
initialRouteName={ROUTES.initial} screenOptions={screenOptions}>
screenOptions={screenOptions}> {navigation.map((nav, i) => (
{navigation.map((nav, i) => ( <Stack.Screen
<Stack.Screen key={`nav${i}`}
key={`nav${i}`} name={nav.name}
name={nav.name} component={nav.component}
component={nav.component} options={{
options={{ title: nav.header,
title: nav.header, headerShown: Boolean(nav.header),
headerShown: Boolean(nav.header), }}
}} />
/> ))}
))} </Stack.Navigator>
</Stack.Navigator> </NavigationContainer>
</NavigationContainer> <Toast config={toastConfig} ref={Toast.setRef} />
<Toast config={toastConfig} ref={Toast.setRef} /> </ThemeProvider>
</ThemeProvider>
</SafeAreaProvider>
); );
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment