I have already tried a lot but could not get it fix. Everything was working good before I added react-native-easy-gridview in my packages.json and then I checked out my changes after that I got this.
Here is my build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.pilbara_weed_management_mobile"
minSdkVersion 16
targetSdkVersion 22
versionCode 8
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
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"
signingConfig signingConfigs.release
}
}
// 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-mauron85-background-geolocation')
compile project(':react-native-background-task')
compile project(':react-native-keep-awake')
compile project(':react-native-background-timer')
compile project(':react-native-image-resizer')
compile project(':react-native-fcm')
compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
compile project(':react-native-fetch-blob')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile ("com.facebook.react:react-native:0.47.2") { force = true } // From node_modules
compile project(':react-native-smart-splashscreen')
compile project(':react-native-fs')
compile project(':react-native-file-opener')
compile project(':react-native-camera')
}
// 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'
}
apply plugin: 'com.google.gms.google-services'
Edit android/app/build.gradle
use this
compile ("com.facebook.react:react-native:0.44.0") { force = true }
and write version of app you use instead of 0.44.0 and delete something like this
compile "com.facebook.react:react-native:+"
or this
compile "com.facebook.react:react-native:0.44.0"
It cause this error for the RN 0.60. You can solve this by following,
npm i jetifier
npx jetify
fixed it for me on RN 0.60.
Related
Trying to implement react-native-bluetooth-escpos-printer
i can build the application successfully but cannt generate apk
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
googlePlayServicesVersion = "15.0.1"
}
I just change buildToolVesion and compileSdkVersion
and my react-native version is
"react": "17.0.2", "react-native": "0.68.2",
Go to the dependency build.gradle folder YOUR_PROJECT/node_modules/react-native-bluetooth-escpos-printer/android/build.gradle
buildscript {
repositories {
jcenter { url "https://jcenter.bintray.com/" }
maven {url "https://repo.spring.io/plugins-release/"}
mavenCentral()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com'
}
}
dependencies {
// classpath 'com.android.tools.build:gradle:3.1.4'
classpath("com.android.tools.build:gradle:7.0.4")
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
minSdkVersion = 21
targetSdkVersion = 31
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
sourceSets {
main {
aidl.srcDirs = ['src/main/java']
}
}
}
repositories {
jcenter { url "https://jcenter.bintray.com/" }
maven {url "https://repo.spring.io/plugins-release/"}
mavenCentral()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0'
implementation "com.google.zxing:core:3.3.0"
}
I'm having currently a problem with grails 3.3.9.
Here is my code:
<g:uploadForm resource="${objetInstance}"role="form" method="POST" class="form-horizontal">
<g:actionSubmit action="update" class="btn green-meadow"
value="${message(code: 'enregistrer', 'default': 'Enregistrer')}"/>
<input type="file" name="myFile" id="myFile"
class="form-control"
value=""/>
</g:uploadForm>
and in my Controlle, I tried:
def file = params.myFile
but my file is null.
And with:
def file = request.getFile('myFile')
Caused by: groovy.lang.MissingMethodException: No signature of method:
net.bull.javamelody.JspWrapper$HttpRequestWrapper3.getFile() is
applicable for argument types: (java.lang.String) values: [myFile]
Possible solutions: getXML(), getPart(java.lang.String),
getAt(java.lang.String), getAt(java.lang.String), getLocale(),
getJSON()
at
Up:
To provide more info, here is my build gradle. I think I have to add a specific plugin to handle file upload.
I tried: compile 'commons-fileupload:commons-fileupload:1.4'. but still having the same error. I am really lost. Any idea?
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://mvnrepository.com/artifact" }
maven { url "https://mvnrepository.com/artifact/org.keycloak/keycloak-spring-security-adapter" }
maven { url "https://mvnrepository.com/artifact/org.jboss.logging/jboss-logging" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath 'net.saliman:gradle-cobertura-plugin:2.5.4'
classpath "org.grails.plugins:views-gradle:1.2.8"
}
}
version "4.0.0_RC20"
group "myProject"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"
apply plugin: "asset-pipeline"
apply plugin: "net.saliman.cobertura"
apply plugin: "org.grails.plugins.views-json"
apply from: "gradle/sonar.gradle"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://mvnrepository.com/artifact" }
maven { url "http://dl.bintray.com/dmahapatro/plugins" }
}
dependencies {
compile "com.warrenstrange:googleauth:1.1.2"
compile "com.google.zxing:core:3.3.1"
compile "com.google.zxing:javase:3.3.1"
compile 'org.grails.plugins:grails-spring-websocket:2.4.1'
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.hibernate:hibernate-ehcache:5.1.16.Final"
testCompile "org.grails:grails-datastore-gorm-test:$gormVersion"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
runtime 'org.apache.tomcat:tomcat-jdbc'
compile 'org.grails:grails-logging'
//postgresql
provided 'org.postgresql:postgresql:9.4.1211'
// Build Test Data
compile "org.grails.plugins:build-test-data:3.3.1"
// Audit Logging
compile "org.grails.plugins:audit-logging:3.0.1"
// Quartz
compile "org.grails.plugins:quartz:2.0.13"
// Phone Numbers
compile 'ca.redtoad:grails-phonenumbers:0.11'
// Rest Client
compile 'org.grails:grails-datastore-rest-client'
// Jasper
compile "org.grails.plugins:jasper:2.1.0.RC1"
//excel import
compile 'org.grails.plugins:excel-import:3.0.2'
//Quartz monitor
compile ('org.grails.plugins:quartz-monitor:1.3'){
exclude group: 'org.grails.plugins', module: 'asset-pipeline'
}
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile "org.grails.plugins:views-json:1.2.8"
//ajout des dependances de keycloak
compile "org.keycloak:keycloak-spring-security-adapter:3.0.0.Final"
runtime "org.jboss.logging:jboss-logging:3.3.0.Final"
//File upload
compile 'commons-fileupload:commons-fileupload:1.4'
// Include external jars
compile fileTree(dir: 'libs', include: '*.jar')
// pour les tests
testCompile "org.grails:grails-test-mixins:3.3.0"
testCompile "org.grails:grails-gorm-testing-support:1.1.5"
testCompile "org.grails:grails-web-testing-support:1.1.5"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
}
integrationTest {
testLogging {
exceptionFormat = 'full'
events 'failed', 'standardOut', 'standardError'
}
beforeTest { descriptor ->
logger.quiet " -- $descriptor"
}
}
assets {
minifyJs = true
minifyCss = true
packagePlugin = true
includes = ["metronic_v4_7_1_admin_3_rounded/*"]
}
cobertura {
coverageFormats = ['xml', 'html']
}
test.finalizedBy(project.tasks.cobertura)
I was able to find why I couldn't upload any files: In my file Resources.groovy, I had :
import org.springframework.web.filter.RequestContextFilter
beans{
...
requestContextFilter(RequestContextFilter)
}
This line was preventing me from uploading all files.
I am not able to setting up react-native-navigation for android version. My IOS app is working fine with same version of RNN and RN.
Help me configure for android.
Here is few important file from my app,
MainActivity.java
package com.MY_APP_NAME;
import com.facebook.react.ReactActivity;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativenavigation.bridge.NavigationReactPackage;
public class MainActivity extends ReactActivity {
#Override
protected String getMainComponentName() {
return "ttapp";
}
}
MainApplication.java
package com.MY_APP_NAME;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.oblador.vectoricons.VectorIconsPackage;
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 VectorIconsPackage()
);
}
};
#Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
#Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
/App/build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId 'com.MY_APP_NAME'
minSdkVersion 16
targetSdkVersion 25
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
}
}
}
productFlavors {
}
}
dependencies {
compile project(':react-native-splash-screen')
compile project(':react-native-navigation')
compile project(':react-native-vector-icons')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.3'
compile 'com.facebook.react:react-native:+'
// From node_modules
}
// 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'
}
Everything is working fine. App is also successfully builded. But react-native-navigation is not working.
Are you getting a white screen on the android device? It also happen to me (only while you have debugger enabled), but if you switch task you're good to go. Try to check this issue on the repo, maybe you could find your answers.
BTW as stated by Pritish, in the READ.ME the minimum version of RN supported is 0.48, for v2 you need version 0.51
I have a project which contains
an Android app module
an App Engine (Cloud Endpoints) module
When I created the project with an older version of Android Studio, it created a reference between the modules, which I removed. Before I did this, I also tried raising the minimum Version in the app module to 21, but Android Studio or LINT somehow still believes my App Engine module was an app and marks code like
list.isEmpty()
new AbstractMap.SimpleEntry<>()
with something like Call required API level 9 (current min is 1): (...).
The project compiles fine, but the errors are underlined in red and show up in LINT.
Neither in the project gradle nor the module gradle I can see anything suspicious. Any idea what the problem could be or where to search and fix this?
For completeness, here are the gradle files:
Projct:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
App Engine Module:
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.30'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.30'
compile 'com.google.appengine:appengine-endpoints:1.9.30'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.30'
compile 'com.google.appengine.tools:appengine-gcs-client:0.5'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:5.1.3'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.retrofit:converter-simplexml:1.9.0'
compile 'io.jsonwebtoken:jjwt:0.6.0'
compile 'org.slf4j:slf4j-parent:1.7.10' // required for JJWT
compile 'org.slf4j:slf4j-nop:1.7.10' // suppress all internal logging in JJWT
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
App Module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "cc.closeup.android.test"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
}
I have an issue with latest JavaFXPorts 8.60.7 when I type any char from keyboard to TextField, app will crash. I'm using android 5.0.1. Earlier my app was developed on JavaFXPorts 8.60.6 and there my app was working, I could in 8.60.6, type a characters into TextField.
I receive in logcat this error:
04-15 21:56:22.066 10732-10769/? E/AndroidRuntime: FATAL EXCEPTION: JavaFX Application Thread
Process: pl.plf.myapp, PID: 10732
java.lang.NoSuchMethodError: No static method dispatchKeyEvent(II[CI)V in class Lcom/sun/glass/ui/monocle/AndroidInputDeviceRegistry; or its super classes (declaration of 'com.sun.glass.ui.monocle.AndroidInputDeviceRegistry' appears in /data/app/pl.plf.myapp-1/base.apk)
at javafxports.android.KeyEventProcessor$1.run(KeyEventProcessor.java:53)
at com.sun.javafx.application.PlatformImpl.lambda$null$155(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl.access$lambda$18(PlatformImpl.java)
at com.sun.javafx.application.PlatformImpl$$Lambda$19.run(Unknown Source)
at java.security.AccessController.doPrivileged(AccessController.java:52)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$156(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl.access$lambda$5(PlatformImpl.java)
at com.sun.javafx.application.PlatformImpl$$Lambda$6.run(Unknown Source)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
at java.lang.Thread.run(Thread.java:818)
And this is my build.gradle:
apply plugin: 'java'
apply plugin: 'war'
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.8'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
mavenCentral()
}
dependencies {
compile project(":ApiCore")
compile project(":Validation")
compile project(":PLFModel")
compile 'org.javafxports:jfxdvk:8.60.7'
compile fileTree(dir: 'libs', include: '*.jar')
runtime fileTree(dir: 'libs', include: '*.jar')
}
mainClassName = 'pl.plf.myapp.MainApp'
jfxmobile {
android {
javafxportsVersion = '8.60.7'
manifest = 'src/android/AndroidManifest.xml'
androidSdk = '/home/user/Android/Sdk'
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
}
Thank's for any help.