Expo SDK 33 Update Error in ExpoKit33 or React-native - react-native

I was using SDK 30. And my app is a standalone app.
I was going to update SDK33 to launch a 64-bit app.
So I did it in the order that it was written on the homepage. But I've made a lot of errors about where the problem is.
my app.bundle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.jackson.myapp'
targetSdkVersion 26
versionCode 1
versionName '1.0.0'
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
flavorDimensions 'minSdk'
productFlavors {
devMinSdk {
dimension 'minSdk'
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
}
prodMinSdk {
dimension 'minSdk'
minSdkVersion 19
}
}
buildTypes {
debug {
debuggable true
ext.enableCrashlytics = false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
exclude "lib/arm64-v8a/librealm-jni.so"
}
configurations.all {
resolutionStrategy.force 'com.android.support:design:28.0.0'
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
// Don't use modern jsc-android since it still has some critical bugs that
// crash applications when the string for the JS bundle is loaded and when
// locale-specific date functions are called.
// configurations.all {
// resolutionStrategy {
// force 'org.webkit:android-jsc:r216113'
// }
// }
apply from: 'expo.gradle'
dependencies {
implementation project(':react-native-iap')
implementation project(':react-native-fetch-blob')
implementation project(':react-native-touch-id')
implementation project(':react-native-keychain')
implementation project(':react-native-fs')
implementation project(':react-native-secure-randombytes')
implementation project(':react-native-fast-crypto')
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'host.exp.exponent:expo-app-loader-provider:+'
api 'org.unimodules:core:+'
api 'org.unimodules:unimodules-constants-interface:+'
api 'host.exp.exponent:expo-constants:+'
api 'org.unimodules:unimodules-file-system-interface:+'
api 'host.exp.exponent:expo-file-system:+'
api 'org.unimodules:unimodules-image-loader-interface:+'
api 'host.exp.exponent:expo-permissions:+'
api 'org.unimodules:unimodules-permissions-interface:+'
api 'org.unimodules:unimodules-sensors-interface:+'
api 'host.exp.exponent:expo-react-native-adapter:+'
api 'host.exp.exponent:expo-task-manager:+'
api 'org.unimodules:unimodules-task-manager-interface:+'
// Optional universal modules, could be removed
// along with references in MainActivity
api 'host.exp.exponent:expo-ads-admob:+'
api 'host.exp.exponent:expo-app-auth:+'
api 'host.exp.exponent:expo-analytics-segment:+'
api 'org.unimodules:unimodules-barcode-scanner-interface:+'
api 'host.exp.exponent:expo-barcode-scanner:+'
api 'org.unimodules:unimodules-camera-interface:+'
api 'host.exp.exponent:expo-camera:+'
api 'host.exp.exponent:expo-contacts:+'
api 'host.exp.exponent:expo-face-detector:+'
api 'org.unimodules:unimodules-face-detector-interface:+'
api 'host.exp.exponent:expo-font:+'
api 'host.exp.exponent:expo-gl-cpp:+'
api 'host.exp.exponent:expo-gl:+'
api 'host.exp.exponent:expo-google-sign-in:+'
api 'host.exp.exponent:expo-local-authentication:+'
api 'host.exp.exponent:expo-localization:+'
api 'host.exp.exponent:expo-location:+'
api 'host.exp.exponent:expo-media-library:+'
api 'host.exp.exponent:expo-print:+'
api 'host.exp.exponent:expo-sensors:+'
api 'host.exp.exponent:expo-sms:+'
api 'host.exp.exponent:expo-background-fetch:+'
implementation 'expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1#aar'
apply from: "../../node_modules/react-native-unimodules/gradle.groovy"
implementation 'com.android.support:multidex:1.0.1'
// Our dependencies
implementation 'com.android.support:appcompat-v7:28.0.0'
// Our dependencies from ExpoView
// DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation('com.facebook.android:audience-network-sdk:4.99.0') {
exclude module: 'play-services-ads'
}
compileOnly 'org.glassfish:javax.annotation:3.1.1'
implementation 'com.jakewharton:butterknife:8.4.0'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.amplitude:android-sdk:2.9.2' // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
implementation "com.raizlabs.android:DBFlow:2.2.1"
implementation "com.madgag.spongycastle:core:1.53.0.0"
implementation "com.madgag.spongycastle:prov:1.53.0.0"
debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation 'com.facebook.device.yearclass:yearclass:1.0.1'
implementation 'commons-io:commons-io:1.3.2'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
implementation 'com.yqritc:android-scalablevideoview:1.0.1'
implementation 'commons-codec:commons-codec:1.10'
implementation 'com.segment.analytics.android:analytics:4.3.0'
implementation 'com.google.zxing:core:3.2.1'
implementation 'net.openid:appauth:0.4.1'
implementation('com.airbnb.android:lottie:2.5.5') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.squareup.okio:okio:1.9.0'
// Testing
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
testImplementation 'com.android.support.test:rules:1.0.2-alpha1'
}
// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
ERROR: Failed to resolve: org.unimodules:core:+
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: host.exp.exponent:expo-react-native-adapter:+
Show in Project Structure dialog
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkDebug/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkDebugAndroidTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkDebugUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkRelease/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkReleaseUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkDebug/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkDebugAndroidTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkDebugUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkRelease/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkReleaseUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
How can I fix this error? I don't know which part, so there's too much to solve.

Follow steps defined below "If upgrading from SDK32 or below:"
https://docs.expo.io/versions/latest/expokit/expokit/#upgrading-expokit

I got the project back to square one, and then executed it in order.
My difference is not using npm but using Yarn.
It was very effective, and I removed all the places where 'expolib_v1' was present.

Related

Android API 31 FLAG_IMMUTABLE Error using Firebase Auth UI

I'm receving the below error in API 31 devices during Firebase Auth UI library(Only Phone number credential),
Fatal Exception: java.lang.IllegalArgumentException: com.sstech.racemanager: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
at android.app.PendingIntent.getActivity(PendingIntent.java:444)
at android.app.PendingIntent.getActivity(PendingIntent.java:408)
at com.google.android.gms.internal.auth-api.zzr.zzc(zzr.java:19)
at com.google.android.gms.auth.api.credentials.CredentialsClient.getHintPickerIntent(CredentialsClient.java:10)
at com.firebase.ui.auth.ui.phone.CheckPhoneHandler.fetchCredential(CheckPhoneHandler.java:28)
at com.firebase.ui.auth.ui.phone.CheckPhoneNumberFragment.setDefaultCountryForSpinner(CheckPhoneNumberFragment.java:238)
at com.firebase.ui.auth.ui.phone.CheckPhoneNumberFragment.onActivityCreated(CheckPhoneNumberFragment.java:127)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2996)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:580)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:285)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
at android.app.Activity.performStart(Activity.java:8339)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3925)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2407)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8278)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
Below is my gradle files,
app Level:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.firebase.firebase-perf'
def versionMajor = 2
def versionMinor = 0
def versionPatch = 10
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.aaa.xxxx"
minSdkVersion 21
targetSdkVersion 31
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas".toString())
arg("room.incremental", "true")
arg("room.expandProjection", "true")
}
}
}
buildTypes {
debug {
minifyEnabled false
multiDexEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = [enableCrashReporting: "false"]
}
}
// Enables data binding.
buildFeatures {
dataBinding = true
}
compileOptions {
sourceCompatibility = 1.7
}
// For Java issue
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.play:core-ktx:1.8.1'
implementation 'com.google.firebase:firebase-perf:20.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'com.google.android.gms:play-services-maps:18.0.1'
implementation 'androidx.preference:preference:1.1.1'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.arch.core:core-runtime:2.1.0'
// Firebase
implementation platform('com.google.firebase:firebase-bom:29.0.3')
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
implementation 'com.google.firebase:firebase-config-ktx'
implementation 'com.google.firebase:firebase-inappmessaging-display-ktx'
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation 'com.google.firebase:firebase-functions'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.firebaseui:firebase-ui-auth:8.0.0'
// Fragment
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
implementation "androidx.fragment:fragment-ktx:1.4.0"
// LifeCycle
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0"
// Circle Image View
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation "androidx.recyclerview:recyclerview:1.2.1"
// For control over item selection of both touch and mouse driven selection
// Image cache
implementation 'com.github.bumptech.glide:glide:4.12.0'
kapt 'com.github.bumptech.glide:compiler:4.12.0'
//gmap
implementation 'com.google.android.gms:play-services-location:19.0.0'
// compressor
implementation 'id.zelory:compressor:3.0.1'
implementation 'com.github.Shouheng88:compressor:1.5.0'
// kotlin general
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.31"
//Zoom
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
//Room
implementation "androidx.room:room-runtime:2.3.0"
kapt "androidx.room:room-compiler:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
// json
implementation 'com.google.code.gson:gson:2.8.9'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.0"
// SDP
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
// Security
implementation "androidx.security:security-crypto:1.1.0-alpha03"
// Animation
implementation 'com.airbnb.android:lottie:4.2.2'
// Browser
implementation "androidx.browser:browser:1.4.0"
// Camera
def camerax_version = "1.0.2"
// CameraX core library using camera2 implementation
implementation "androidx.camera:camera-camera2:$camerax_version"
// CameraX Lifecycle Library
implementation "androidx.camera:camera-lifecycle:$camerax_version"
// CameraX View class
implementation "androidx.camera:camera-view:1.0.0-alpha31"
implementation "com.github.lisawray.groupie:groupie:2.9.0"
implementation 'com.github.dhaval2404:imagepicker:2.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
}
Project level,
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.firebase:perf-plugin:1.4.0'
def nav_version = "2.3.5"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I've searched online and for some the issue is resolved by adding androidx.work:work-runtime-ktx:2.7.1 pacakage, but in my case even this is not solving.
Can anyone help on this issue.
In my case, firebase UI (com.firebaseui:firebase-ui-auth:8.0.0) was using com.google.android.gms:play-services-auth:19.0.0 which I found with the command './gradlew -q app:dependencyInsight --dependency play-services-auth --configuration debugCompileClasspath'
This version of the play services auth was causing the issue for me.
I added a separate
implementation 'com.google.android.gms:play-services-auth:20.0.1'
to my gradle and this issue disappeared.

Kotlin :Execution failed for task ':app:checkDebugAarMetadata'

I am using kotlin ,and I get these error when I add the third library:
** implementation 'com.github.AsynctaskCoffee:tinderlikecardstack:1.0'**
from: https://github.com/AsynctaskCoffee/TinderLikeCardStack
The Error:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.AsynctaskCoffee:tinderlikecardstack:1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/AsynctaskCoffee/tinderlikecardstack/1.0/tinderlikecardstack-1.0.pom
- https://repo.maven.apache.org/maven2/com/github/AsynctaskCoffee/tinderlikecardstack/1.0/tinderlikecardstack-1.0.pom
- https://jcenter.bintray.com/com/github/AsynctaskCoffee/tinderlikecardstack/1.0/tinderlikecardstack-1.0.pom
Required by:
project :app
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
And my guild.gradle(:app)
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.gearsrun.stackviewapplication"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation("androidx.recyclerview:recyclerview:1.2.1")
// For control over item selection of both touch and mouse driven selection
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
implementation 'com.airbnb.android:lottie:3.4.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.fresco:fresco:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
implementation 'com.github.AsynctaskCoffee:tinderlikecardstack:1.0'
}
build.grandle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.0"
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
my gradle.properties:
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.enableJetifier=true
Could anyone take a look what was going on please ,thank you so much !
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.AsynctaskCoffee:TinderLikeCardStack:1.0'
}
Normally, your declarations are true but you may declare them on wrong places. implementation part should be in Gradle app - maven declaration should be in main Gradle.
You can also define project with maven
<dependency>
<groupId>com.github.AsynctaskCoffee</groupId>
<artifactId>TinderLikeCardStack</artifactId>
<version>1.0</version>
</dependency>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Also please check you should disable offline Gradle build. You can also download project and import as module.

React-Native Android Build Failure: Execution failed for task ':app:processDebugResources'. Failed to process resources

I cannot figure out what is wrong with the build. I tried the common solutions of running ./gradlew clean as well as adding the android.enableAapt2=false to the gradle.properties.
The google-services.json folder is at the /android/app level.
Im at a loss right now as to how to get past this one.
If I forgot to include something useful please lmk and I will update.
Cheers
Error Output
Configure project :app
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Configure project :react-native-google-analytics-bridge
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Configure project :react-native-radar
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Task :app:processDebugGoogleServices
Parsing json file: /Users/kyletreman/18F/courier_test_app/android/app/google-services.json
/Users/kyletreman/.gradle/caches/transforms-1/files-1.1/appcompat-v7-23.0.1.aar/64df69838d7c555de168bdcf18f3be5c/res/values/values.xml:113:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/kyletreman/.gradle/caches/transforms-1/files-1.1/appcompat-v7-23.0.1.aar/64df69838d7c555de168bdcf18f3be5c/res/values/values.xml:113:5-69: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Failed to process resources, see aapt output above for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
50 actionable tasks: 3 executed, 47 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
/android/app/build.gradle
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.courier_test_app.app"
minSdkVersion 16
targetSdkVersion 27
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 {
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:support-v13:27.1.1'
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-radar')
implementation project(':react-native-google-analytics-bridge')
}
// 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'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
/android/build.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.google.gms:google-services:4.0.0'
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}
From the error log I can see that appcompat-v7-23.0.1 is still being used. So, it would probably help to update resolutionStrategy:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
force 'com.android.support:appcompat-v7-23.0.1'
}
}
Also you need to place that resolution strategy block in your app/build.gradle
Fixed
I was able to get help from someone familiar with the native side and he helped me sort out quite a few errors.
implementation order matters, this was the order that worked for me
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.android.support:support-v4:27.1.1"
implementation 'com.android.support:support-v13:27.1.1'
implementation "com.android.support:appcompat-v7:27.1.1"
implementation(project(':react-native-firebase'))
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(':react-native-radar')
implementation project(':react-native-google-analytics-bridge')
I need to move the configuration resolution strategies to the android/app/build.gradle file, mine were at the wrong level. I also had to alter versions of the support and appcompat packages. You can find dependencies via
./gradlew app:dependencies
from the android folder. The issue was one of the dependencies was pulling a older version, which was fixed by using the following in the resolutionStrategies.
force 'com.android.support:appcompat-v7:27.1.1'
The next change that needed to be made was the following line in the MainApplication.java
return BuildConfig.DEBUG;
to this
return <app_name>.BuildConfig.DEBUG;
I also removed the enableaapt2=false
The last tip I can give is that naming matters, don't rename your app unless its absolutely necessary and make sure it changes across the Main java files and AndroidMainfest.xml.
UPDATED
I realized my debugger was not connecting, it was because I removed some implementation packages that supported firebase, adding them back fixed the issue. Add the following below the firebase implementation.
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
put this code at the end of android/build.gradle
use your own numbers for the compileSdkVersion and buildToolsVersion
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
}
}
}
}

Could not resolve com.android.support:design:26.1.0

I have been having this problem for quite a while, that my com.android.support:design:26.1.0 fails me and I have no clue what to change anymore.
These are my files for module gradle.
Build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.xxx.yyy"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.google.android.gms:play-services-vision:9.4.0'
// compile 'com.android.support:design:26.1.0'
}
//apply plugin: 'com.google.gms.google-services'
The project gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter({ url "http://jcenter.bintray.com/" })
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter({ url "http://jcenter.bintray.com/" })
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Error:Unable to resolve dependency for
':app#releaseUnitTest/compileClasspath': Could not resolve
com.android.support:design:26.1.0.
Error:Unable to resolve dependency
for ':app#release/compileClasspath': Could not resolve
com.android.support:design:26.1.0.
Error:Unable to resolve dependency
for ':app#debugUnitTest/compileClasspath': Could not resolve
com.android.support:design:26.1.0.
Error:Unable to resolve dependency
for ':app#debugAndroidTest/compileClasspath': Could not resolve
com.android.support:design:26.1.0.
Error:Unable to resolve dependency
for ':app#debug/compileClasspath': Could not resolve
com.android.support:design:26.1.0.
And only the 'Snackbar' function does not work but rest of it seems fine.
When I change the design to 25.1.0 version instead, it works but it clashes with other 26.1.0 ones so it's not recommended by the Android Studio. Anyone..?
I have tried putting the
compile 'com.android.support:design:26.1.0'
instead of implement, it does not work. When I tried to change the whole thing to either 25.4.0 or any other 25 version, a lot of other things doesnt compile as well. I have unchecked the Offline work, tried removing / adding maven directory, un-commenting a few more of dependencies, changing all to compile instead of implement but just gives me more errors.
Yes I have updated all my SDKs to the newest but I have a feeling that Gradle just cannot download certain dependencies from the websites that's why I cannot download any more of the other dependencies. (Although my off-line work is unchecked)
Also, whatever that are uncommented in the code above, it means I have tried inputting those lines but it did not solve the issue or rather created more issues.
Here is the way i found it please try the below
Go to File->Settings->Build, Execution, Deployment->Gradle->Uncheck Offline work option.
Try this once ,instead of implementing compile the design support gradle code
compile 'com.android.support:design:26.1.0'
and remove this
implementation 'com.android.support:design:26.1.0'
Problem that I realized in the end was that when I was setting up the android proxy, I have only set up 1 proxy which was for HTTP and did not realize that HTTPS proxy was not set up.
So after fixing that issue by setting HTTPS proxy, there was no more problems.

Getting errors while integrating VISA checkout

I am integrating VISA checkout payment using the following link: Visa Checkout Integration in Android Studio.
My project is quite heavy. I had imported it from Eclipse which already contained many libraries. While integrating the VISA checkout, I added the the following in the gradle file, and its associated libraries:
compile(name:'VisaCheckout-Android-SDK-4.3', ext:'aar')
When I executed this code without any previous libraries, I didn't get any errors.
However when I run the code in my existing app in Lollipop, I get a blank screen which does not respond even on clicking the hardware back button.
I'm getting some unusual errors such as:
No subscribers registered for event class com.visa.internal.ˌ
No subscribers registered for event class de.greenrobot.event.NoSubscriberEvent
Rejecting re-init on previously-failed class java.lang.Class
In Kitkat, the app crashes showing java.lang.NoClassDefFoundError: com.google.android.gms.analytics.GoogleAnalytics, (since Google Analytics is integrated in my project).
Here's my gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.fitcompany.fitness_enthusiasts"
minSdkVersion 11
targetSdkVersion 20
}
buildTypes {
release {
multiDexEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
flatDir { dirs 'libs'}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile project(':slidingMenu')
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:4.0.30'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.paypal.sdk:paypal-android-sdk:2.14.2'
compile(name:'VisaCheckout-Android-SDK-4.3', ext:'aar')
compile files('libs/volley.jar')
compile files('libs/gson-2.3.1.jar')
compile files('libs/HockeySDK-3.5.0.jar')
compile files('libs/httpclient-android-4.3.3.jar')
compile files('libs/ksoap2-android-assembly-3.1.0-jar-with-dependencies.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.6#aar') {
transitive = true;
}
}
My libs folder contains the following:
eventbus-2.4.0.jar
gson-2.3.1.jar
HockeySDK-3.5.0.jar
ksoap2-android-assembly-3.1.0-jar-with-dependencies.jar
libGoogleAnalyticsServices.jar
okhttp-2.5.0.jar
retrofit-1.9.0.jar
volley.jar
YouTubeAndroidPlayerApi.jar
VisaCheckout-Android-SDK-4.3.aar
I was using the wrong file in the libs folder. I replaced this line:
VisaCheckout-Android-SDK-4.3.aar
with this one and the error was gone.
VisaCheckout-Android-SDK-2.9.aar
Its because the name of SDK-AAR file in libs folder is in lowercase contrary to one declared in app-gradle.
e.g., 'visacheckout-android-sdk-4.3' instead 'VisaCheckout-Android-SDK-4.3'