Skip to content

Commit

Permalink
fix svg/png resources issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rasom committed Mar 27, 2019
1 parent 8700bde commit a8570c6
Show file tree
Hide file tree
Showing 8 changed files with 414 additions and 17 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ android {
defaultConfig {
applicationId "im.status.ethereum"
minSdkVersion 23
targetSdkVersion 26
targetSdkVersion 28
multiDexEnabled true
versionCode getVersionCode()
versionName getVersionName()
Expand Down Expand Up @@ -235,6 +235,7 @@ configurations.all {
}

dependencies {
implementation 'com.facebook.fresco:animated-gif:1.10.0'
implementation project(':react-native-background-timer')
implementation project(':react-native-svg')
implementation 'com.android.support:multidex:1.0.2'
Expand All @@ -244,7 +245,7 @@ dependencies {
implementation project(':react-native-dialogs')
implementation project(':realm')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:appcompat-v7:28.+"
// Force using exact RN version instead of relying on gradle dependency resolution
// https://docs.gradle.org/current/userguide/introduction_dependency_management.html#sec:dependency_resolution
//compile ("com.facebook.react:react-native:0.55.4") { force = true } // From node_modules
Expand Down Expand Up @@ -273,7 +274,6 @@ dependencies {

compile 'com.github.status-im:function:0.0.1'
implementation fileTree(dir: "node_modules/realm/android/libs", include: ["*.jar"])
compile 'com.facebook.fresco:animated-gif:1.9.0'
}

// Run this once to be able to run the application with BUCK
Expand Down
31 changes: 30 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.0.1'
classpath 'de.undercouch:gradle-download-task:3.1.2'

Expand All @@ -23,6 +23,34 @@ buildscript {
}
}

subprojects {
/*project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
}
}*/
afterEvaluate {
if (project.hasProperty("android") && true
/*(project.name == 'react-native-config'
|| project.name == 'react-native-dialogs'
|| project.name == 'react-native-http-bridge'
|| project.name == 'react-native-image-crop-picker'
)*/) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
targetSdkVersion 28
}
}
}
}
}

allprojects {
repositories {
mavenLocal()
Expand All @@ -35,3 +63,4 @@ allprojects {
maven { url "https://jitpack.io" }
}
}

1 change: 0 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ STATUS_RELEASE_STORE_PASSWORD=password
STATUS_RELEASE_KEY_ALIAS=status
STATUS_RELEASE_KEY_PASSWORD=password

# Workaround for issue https://github.com/facebook/react-native/issues/16906 (TODO: fixed in 0.57.3, remove once we upgrade react-native)
android.enableAapt2=false

org.gradle.jvmargs=-Xmx8704M
21 changes: 13 additions & 8 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const { getDefaultConfig } = require("metro-config");

module.exports = {
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve("react-native-svg-transformer"),
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"]
}
};
})();
1 change: 1 addition & 0 deletions mobile_files/package.json.orig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"react-native-splash-screen": "3.1.1",
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#v2.3.10",
"react-native-svg": "^9.2.4",
"react-native-svg-transformer": "^0.12.1",
"react-native-tcp": "git+https://github.com/status-im/react-native-tcp.git#v3.3.0-1-status",
"react-native-udp": "git+https://github.com/status-im/react-native-udp.git#2.3.1-1",
"react-native-webview": "^5.2.1",
Expand Down
Loading

0 comments on commit a8570c6

Please sign in to comment.