[Jenkins][Pipeline] Not able to upload APK to hockeyapp - android

I am planning to upload an APK to hockey app through Jenkins Pipeline. My upload is failing.
Can anyone help me on this issue
Trying to upload android APK with an error.
def DEV_APK_PATH="APP/build/outputs/apk/mobileDevelopment/release/*.apk"
def DEV_MAPPING="APP/build/outputs/mapping/mobileDevelopment/release/mapping.txt"
pipeline {
agent { label 'ABC' }
stages {
stage('Upload To HockeyApp') {
when {
expression { return params.UPLOAD_HOCKEYAPP }
}
steps {
// Build Android
archiveArtifacts DEV_APK_PATH
hockeyApp applications: [
[
apiToken: 'HOCKEY_APP_TOKEN',
downloadAllowed: true,
filePath: DEV_APK_PATH,
dsymPath: DEV_MAPPING
releaseNotesMethod: changelog('true'),
uploadMethod: versionCreation('app-id')
]
], debugMode: false, failGracefully: false
}
}
} // stages
} // pipeline
Error Log:
Running in Durability level: MAX_SURVIVABILITY org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:enter code here WorkflowScript: 44: expecting '}', found ':' # line 44, column 39.
hockeyApp applications: [
^
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:150)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:120)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:132)
at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:350)
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:144)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:110)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:234)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:168)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:943)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:320)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

Related

docxtemplater in Vue js error Failed to read responseText on android

I have created a frontend app with Vue js on the Quasar framework, it works very well on the browser. But when I run it on android by using Cordova it does not work properly when it loads an MS word file from a remote server to fill it with some data. For templating I am using docxtemplater. And I take the following error:
Error: InvalidStateError: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'arraybuffer').
In addition, I have used the Django framework as a server with Nginx, Gunicorn on Ubuntu 20.04.2 LTS.
the site works via https
Cordova 11.0.0
Android 10.0 (Q) API level 29
Django settings:
"""
Django settings for tuberculosis project.
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
from corsheaders.defaults import default_headers
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'some-key'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '75.119.133.43', 'www.tub-aspergillosis.uz', 'tub-aspergillosis.uz']
# Application definition
INSTALLED_APPS = [
'home.apps.HomeConfig',
'patientapp.apps.PatientappConfig',
'ai.apps.AIConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'corsheaders',
'rest_framework_simplejwt.token_blacklist'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
]
# **Dont forget to add your client's address to the CORS whitelist. This will make sure the server accepts request from
# the specified source only
CORS_ALLOWED_ORIGINS = [
'http://localhost:8000', 'http://75.119.133.43:8000', 'http://tub-aspergillosis.uz', 'https://tub-aspergillosis.uz'
]
# allow all requests containing any of the default headers(as in django docs) or content-type header
CORS_ALLOW_HEADERS = default_headers + (
'contenttype',
)
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = False
CORS_REPLACE_HTTPS_REFERER = True
ROOT_URLCONF = 'tuberculosis.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR + '/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'tuberculosis.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'app',
'USER': 'username',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_ROOT = str(os.path.join(BASE_DIR, 'staticfiles'))
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR.replace('\\', '/') + STATIC_URL,
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_simplejwt.authentication.JWTAuthentication',
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
),
}
# Localizing date and time => day-month-year
DATE_INPUT_FORMATS = ['%d-%m-%Y']
from datetime import timedelta
SIMPLE_JWT = {
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=1440),
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
'ROTATE_REFRESH_TOKENS': False,
'BLACKLIST_AFTER_ROTATION': True,
'ALGORITHM': 'HS256',
'SIGNING_KEY': SECRET_KEY,
'VERIFYING_KEY': None,
'AUDIENCE': None,
'ISSUER': None,
'AUTH_HEADER_TYPES': ('Bearer',),
'USER_ID_FIELD': 'id',
'USER_ID_CLAIM': 'user_id',
'AUTH_TOKEN_CLASSES': ('rest_framework_simplejwt.tokens.AccessToken',),
'TOKEN_TYPE_CLAIM': 'token_type',
'JTI_CLAIM': 'jti',
'SLIDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp',
'SLIDING_TOKEN_LIFETIME': timedelta(minutes=5),
'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=1),
}

Expo-google-app-auth gives error while signing in

I'm making an app in react native and really need to add google auth. But I can't get it to work. It shows an error: ExpoAppAuth.Get Auth: Encountered exception when trying to start auth request: null
Code
My Sign-In function
signInAsync = async () => {
try {
const conf = {
androidClientId: config.google_client_id,
}
let result = await Google.logInAsync(conf);
if (result.type === 'success') {
console.log(result.accessToken);
this.props.navigation.navigate('dashboard');
} else {
return { cancelled: true };
}
} catch (e) {
console.error(e.message);
return { error: true };
}
};
Versions
windows 10.0.19043.1466
node.js v16.13.1
npm 8.1.2
expo-google-app-auth ~9.0.0
expo 5.0.3
Android studio Arctic Fox 2020.3.1
Emulator Pixel 5 api 30
Android 11.0

Metro bundler errors when using module-resolver

I've created a project using expo typescript template. Running on iOS and Android. No web.
I then set up path alias in tsconfig.json as follows:
"paths": {
"#models/*": ["./src/models/*"],
"#navigation/*": ["./src/navigation/*"],
"#services/*": ["./src/services/*"],
"#components/*": ["./tsx/components/*"],
"#screens/*": ["./tsx/screens/*"],
"#assets/*": ["./assets/*"]
}
Correspondingly, I configured babel.config.js as follows:
plugins: [
[
'module-resolver',
{
root: ['./'],
alias: {
'#models': path.resolve(path.dirname('.'), 'src/models'),
'#navigation': path.resolve(path.dirname('.'), 'src/navigation'),
'#services': path.resolve(path.dirname('.'), 'src/services'),
'#screens': path.resolve(path.dirname('.'), 'tsx/screens'),
'#components': path.resolve(path.dirname('.'), 'tsx/components'),
'#assets': path.resolve(path.dirname('.'), 'assets'),
}
}
]
]
The above configuration works. App is bundled and runs fine. However the following non-critical errors are emitted during bundle:
transform[stderr]: Could not resolve "/Users/jblues/mobbiz/LOSMobileApp/src/navigation/AppNavigator" in file /Users/jblues/LOSMobileApp/tsx/App.tsx.
transform[stderr]: Could not resolve "/Users/jblues/LOSMobileApp/tsx/components/BottomTabNavigator" in file /Users/jblues/LOSMobileApp/src/navigation/AppNavigator.ts.
transform[stderr]: Could not resolve "/Users/jblues/mobbiz/LOSMobileApp/tsx/screens/Login" in file /Users/jblues/LOSMobileApp/src/navigation/AppNavigator.ts.
. . and so on. Is there something that I can add to my config to prevent these errors?
You are missing the extensions configuration, for example:
extensions: ['.js', '.ts', '.ios.js', '.ios.ts', '.android.js', '.android.ts', '.json'],
This is a babel.config.js file which i have and it works without error. It might be useful for your reference.
const MODULE_RESOLVER = [
'module-resolver',
{
extensions: ['.js', '.ios.js', '.android.js', '.json'],
alias: {
'#Components': './App/Components',
'#Navigation': './App/Navigation',
'#Constants': './App/Constants',
'#Features': './App/Features',
'#Services': './App/Services',
'#Fixtures': './App/Fixtures',
'#Themes': './App/Themes',
'#Config': './App/Config',
'#Sagas': './App/Sagas',
'#Redux': './App/Redux',
'#Types': './App/Types',
'#I18n': './App/I18n',
'#Lib': './App/Lib',
},
},
];
module.exports = {
plugins: [MODULE_RESOLVER],
presets: ['module:metro-react-native-babel-preset'],
env: {
production: {
plugins: ['ignite-ignore-reactotron', MODULE_RESOLVER],
},
},
};

TypeError: Cannot read property 'openDatabase' of undefined in ionic 4 for android

Getting error when running application in mobile TypeError: Cannot read property 'openDatabase' of undefined
When I am running the application on the browser, it is working fine. Plz help me, I am newer in IONIC 4
if(this.platform.is('cordova')) {
alert("this.platform.is('cordova') := "+this.platform.is('cordova'));
// Running on device or emulator
await createConnection({
type: 'cordova',
database: 'crm.db',
location: 'default',
logging: ['error', 'query', 'schema'],
synchronize: true,
entities: [
User
]
}).then(connection => {
alert(connection);
let user = new User();
}).catch(error => alert(error));
} else {
// Running app in browser
await createConnection({
type: 'sqljs',
autoSave: true,
location: 'browser',
logging: ['error', 'query', 'schema'],
synchronize: true,
entities: [
User
]
});
}

codepush update's appVersion is incorrect. It's always the same as the current app's version

I am trying to get codepush working for my react-native app on Android. For better understanding and control, i am manually checking for updates. Here's my code:
// Check for Codepush app update every time app is opened.
console.log('Checking for codepush update !');
codePush.checkForUpdate(CODEPUSH_DEPLOYMENT_KEY, (update) => {console.log('handleBinaryVersionMismatchCallback: ', update)})
.then((update) => {
console.log('Code push remote package: ', update);
if (update != null) {
let desc = update['description'];
let newVersion = update['appVersion'];
let currentVersion = RNDeviceInfo.getVersion();
console.log('current version: ', currentVersion);
let currentSemVer = currentVersion.split('.');
let newSemVersion = newVersion.split('.');
let curV = parseFloat(currentSemVer[1] + '.' + currentSemVer[2]);
let newV = parseFloat(newSemVersion[1] + '.' + newSemVersion[2]);
console.log('currentSemVer:', currentSemVer);
console.log('newSemVersion:', newSemVersion);
console.log('curV:', curV);
console.log('newV:', newV);
if (currentVersion === newVersion) {
console.log('Exact same version. Ignoring codepush');
return;
}
if (newSemVersion[0] !== currentSemVer[0]) {
console.log('Major version mismatch. Ignoring codepush');
return;
}
if (newV < curV) {
console.log('Older version. Ignoring codepush');
return;
}
codePush.sync({
updateDialog: true,
installMode: codePush.InstallMode.IMMEDIATE,
});
}
});
To release a new update, i update the android/app/build.gradle file like this:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 8
versionName "2.2.6"
and
appcenter codepush release-react -a <appname> -t ">=2.0.0 <=2.2.9" -d Production --description 'Trying to get codepush working'
In logcat, i can see that its getting the update, however, the appVersion of the update is the same as the app that was installed from playstore. Have tried multiple releases on codepush, the label increments, but the appVersion does not.
10-07 10:14:51.798 7668-7701/? I/ReactNativeJS: 'Code push remote package: ', { deploymentKey: '<key>',
description: 'Trying to get codepush working',
label: 'v8',
appVersion: '2.2.5',
isMandatory: false,
packageHash: '<>',
packageSize: 616685,
downloadUrl: '<>',
download: [Function],
isPending: false,
failedInstall: false }
'current version: ', '2.2.5'
'currentSemVer:', [ '2', '2', '5' ]
'newSemVersion:', [ '2', '2', '5' ]
10-07 10:14:51.799 7668-7701/? I/ReactNativeJS: 'curV:', 2.5
'newV:', 2.5
Exact same version. Ignoring codepush
Is my understanding incorrect that appVersion should be the update's app version from the build.gradle file ?

Categories

Resources