{
"name": "kiosk",
"version": "0.0.1",
"private": true,
"scripts": {},
"dependencies": {
"axios": "0.17.0",
"babel-eslint": "7.2.3",
"eslint": "3.19.0",
"eslint-config-airbnb": "6.0.0",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-react": "3.12.0",
"estraverse-fb": "1.3.2",
"fuse.js": "^3.2.0",
"mobx": "3.3.1",
"mobx-react": "4.3.4",
"react": "16.0.0",
"react-native": "0.50.x",
"react-native-config": "^0.11.5",
"react-native-device-log": "^1.0.2",
"react-native-keep-awake": "^2.0.6",
"react-native-loading-spinner-overlay": "^0.5.2",
"react-native-modal": "^4.1.1",
"react-native-restart": "0.0.6",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "1.0.0-beta.17",
"to-fast-properties": "^2.0.0",
"uuid": "^3.1.0"
},
"devDependencies": {
"babel-plugin-transform-decorators-legacy": "^1.3.4"
},
"rnpm": {
"assets": [
"./src/assets/fonts/"
]
}
}
===============================================
package com.kiosk;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import com.avishayil.rnrestart.ReactNativeRestartPackage;
import com.corbt.keepawake.KCKeepAwakePackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReactNativeConfigPackage(),
new ReactNativeRestartPackage(),
new KCKeepAwakePackage(),
new VectorIconsPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
===========================================
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
react-native bundle with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle" line.project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
/*
Include Icon Libraries
(Added by JG)
*/
project.ext.vectoricons = [
iconFontNames: [ 'FontAwesome.ttf', 'Ionicons.ttf' ]
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
/**
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.kiosk"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-restart')
compile project(':react-native-keep-awake')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
// For animated GIF support
compile 'com.facebook.fresco:animated-gif:1.3.0'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
React-Native 0.50.x
Me too, after very much trial and error, do this:
npm install --save react-native-config
react-native link (optionally add the pkg name above, but don't have to)
=> You might notice that this command hangs and never actually finishes running
=> I had to terminate the process with Ctrl+c
=> This command altered some files, including MainApplication.java and settings.gradle
=> BUT it DID NOT update an important file
=> YOU must update this file by hand
Open android/app/build.gradle (which was not altered by the react-native link command and SHOULD HAVE BEEN)
=> line 2, immediately after apply plugin: "com.android.application"
=> add this line apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
=> THEN edit the dependencies method like so:
dependencies {
compile project(':react-native-config')
...
==> Other projects you depend on
...
compile "com.facebook.react:react-native:+"
}
NOTE: This last piece of information is NOT contained within this library's documentation!
After all this, please be sure to run ./gradlew clean before opening your emulator and calling react-native run-android
compile project(':react-native-config')
That was the most important part. Thank's a lot
Cool, glad you got something out of it!
On Mon, Nov 12, 2018 at 12:05 PM Andrei notifications@github.com wrote:
compile project(':react-native-config')
That was the most important part. Thank's a lot
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/luggit/react-native-config/issues/228#issuecomment-437957040,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AX29FTRZkT_z3DMEuFotLTgNQfVsEhcUks5uuapbgaJpZM4SPvZk
.
I've tried all these with updated implement instead of compile but it still doesn't work for me
It always says :react-native-config doesnt exist in :app
Most helpful comment
React-Native 0.50.x
Me too, after very much trial and error, do this:
npm install --save react-native-config
react-native link (optionally add the pkg name above, but don't have to)
=> You might notice that this command hangs and never actually finishes running
=> I had to terminate the process with Ctrl+c
=> This command altered some files, including MainApplication.java and settings.gradle
=> BUT it DID NOT update an important file
=> YOU must update this file by hand
Open android/app/build.gradle (which was not altered by the react-native link command and SHOULD HAVE BEEN)
=> line 2, immediately after
apply plugin: "com.android.application"=> add this line
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"=> THEN edit the dependencies method like so:
NOTE: This last piece of information is NOT contained within this library's documentation!
After all this, please be sure to run
./gradlew cleanbefore opening your emulator and callingreact-native run-android