FolioReader-Android Cache Issue - java

I wanna use the FolioReader-Android library in my Android Studio.
I implement the library on my Gradle and when I want to run the project there is an unknown error:
*
/Users/hamid/.gradle/caches/transforms-2/files-2.1/1ef74cdf85927d9b084bf9bd34edc7d8/folioreader-0.5.4/res/layout/progress_dialog.xml:13:
AAPT: error: resource android:attr/android:progressBarStyle not found.
What's the problem?

In your gradle dependencies try adding this
implementation "com.folioreader:folioreader:0.5.4"
implementation 'com.android.support:multidex:1.0.3' // ( for androidx)
configurations.matching { it.name == '_internal_aapt2_binary' }.all {
config ->
config.resolutionStrategy.eachDependency {
details -> details.useVersion("3.3.2-5309881")
}
}
`

Related

groovy.lang.MissingPropertyException: Could not set unknown property 'useIR' for object of type org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptionsImpl

i cloned kickstarter from github & facing this error
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
useIR = true
}
i have tried rebuilding , cleaning project but cant resolve this issue
& there are no similar issues i found out there
A problem occurred evaluating project ':app'.
Could not set unknown property 'useIR' for object of type org.jetbrains.kotlin.gradle.dsl.KotlinJvmOption
// Copy google-services.json from variant directory to root of app
gradle.taskGraph.beforeTask { Task task ->
if (task.name ==~ /process.*GoogleServices/) {
android.applicationVariants.all { variant ->
if (task.name ==~ /(?i)process${variant.name}GoogleServices/) {
copy {
from "src/${variant.name}"
into '.'
include 'google-services.json'
}
}
}
}
}
i am not sure if this might help but this error cannot reslove 'task' is in build gradle & this is the only error
Remove the
UseIR = true
option and your code should compile
Which kotlin version you are using? It seems to be removed in 1.7.
https://kotlinlang.org/docs/compatibility-guide-17.html#remove-useir-compiler-option.

Publishing is not able to resolve a dependency on a project with multiple publications that have different coordi nates

I intend to publish my modules in a nexus repository with the following steps.
first step:
Create a android-publications.gradle file and add the following contents to it
android-publications.gradle :
apply plugin: 'maven-publish'
ext.moduleVersion = "0.0.0"
def moduleGroupId = "team.techvida.framework"
def moduleRepoUrl = "http://url/repository/maven-releases/"
afterEvaluate {
publishing {
publications {
debug(MavenPublication) {
from components.debug
groupId = moduleGroupId
artifactId = "$project.name-debug"
version = moduleVersion
}
release(MavenPublication) {
from components.release
groupId = moduleGroupId
artifactId = project.name
version = moduleVersion
}
}
repositories {
maven {
name "nexus"
url moduleRepoUrl
allowInsecureProtocol = true
credentials {
username findProperty("nexusUsername")
password findProperty("nexusPassword")
}
}
}
}
}
Step two
Use it in all modules as follows:
core module =>
apply from: "$rootDir/android-library-build.gradle"
apply from: "$rootDir/buildSrc/android-publications.gradle"
ext.moduleVersion = "0.0.1"
dependencies {
}
presentation module =>
apply from: "$rootDir/android-library-build.gradle"
apply from: "$rootDir/buildSrc/android-publications.gradle"
ext.moduleVersion = "0.0.1"
dependencies {
}
Third step
Use in a module that uses other modules
di module =>
apply from: "$rootDir/android-library-build.gradle"
apply from: "$rootDir/buildSrc/android-publications.gradle"
ext.moduleVersion = "0.0.1"
dependencies {
implementation(project(Modules.core))
implementation(project(Modules.imageLoading))
implementation(project(Modules.prettyLogger))
}
Note 1 : Publishing the second step modules is done successfully.
Step 4 (which leads to a compilation error)
Publish the third step module (di)
Received error:
What went wrong:
Could not determine the dependencies of task ':di:publishReleasePublicationToNexusRepository'.
> Publishing is not able to resolve a dependency on a project with multiple publications that have different coordi
nates.
Found the following publications in project ':image_loading':
- Maven publication 'debug' with coordinates team.techvida.framework:image_loading-debug:0.0.1
- Maven publication 'release' with coordinates team.techvida.framework:image_loading:0.0.1
* 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.
Would you please tell me how to solve this problem?

upgrading gradle to 6.x error Could not set unknown property 'testClassesDir' for task ':systemtestRun' of type org.gradle.api.tasks.testing.Test

I’m updating the gradle version of my application, it was with version 2.3 and I’m going to 6.7.1
I changed some things, of course, but this error I’m not able to resolve:
> Could not set unknown property 'testClassesDir' for task ':systemtestRun' of type org.gradle.api.tasks.testing.Test.
build.gradle:
task systemtestRun(type: Test) {
description 'run tests'
testClassesDir = sourceSets.systemtest.output.classesDirs
classpath = sourceSets.systemtest.runtimeClasspath + sourceSets.test.runtimeClasspath }
It should be testClassesDirs not testClassesDir:
tasks.register('systemtestRun', Test) {
description = 'Runs system tests.'
group = 'verification'
testClassesDirs = sourceSets.systemtest.output.classesDirs
classpath = sourceSets.systemtest.runtimeClasspath
}

Firebase Firestore crash at RunTime error

I have a project where i use Google Cloud Speech, and Firebase RealTime Database, and also as the project evolved i would like to add Google FireStore functionallity. But after I compile the dependency i have a RunTime error:
Error:(458, 21) error: no suitable method found for
intercept(GoogleCredentialsInterceptor)
method zzbc.intercept(List<zzl>) is not applicable
(argument mismatch; GoogleCredentialsInterceptor cannot be converted to List<zzl>)
method zzbc.intercept(zzl...) is not applicable
(varargs mismatch; GoogleCredentialsInterceptor cannot be converted to zzl)
method AbstractManagedChannelImplBuilder.intercept(List<zzl>) is not applicable
(argument mismatch; GoogleCredentialsInterceptor cannot be converted to List<zzl>)
method AbstractManagedChannelImplBuilder.intercept(zzl...) is not applicable
(varargs mismatch; GoogleCredentialsInterceptor cannot be converted to zzl)
This error occurs when i try to get the credentials from GCS.
#Override
protected void onPostExecute(AccessToken accessToken) {
mAccessTokenTask = null;
final ManagedChannel channel = new OkHttpChannelProvider()
.builderForAddress(HOSTNAME, PORT)
.nameResolverFactory(new DnsNameResolverProvider())
.intercept(new GoogleCredentialsInterceptor(new GoogleCredentials(accessToken)
.createScoped(SCOPE)))
.build();
mApi = SpeechGrpc.newStub(channel);
// Schedule access token refresh before it expires
if (mHandler != null) {
mHandler.postDelayed(mFetchAccessTokenRunnable,
Math.max(accessToken.getExpirationTime().getTime()
- System.currentTimeMillis()
- ACCESS_TOKEN_FETCH_MARGIN, ACCESS_TOKEN_EXPIRATION_TOLERANCE));
}
}
}
The code is crashing at this part of code:
.intercept(new GoogleCredentialsInterceptor(new GoogleCredentials(accessToken).createScoped(SCOPE)))
My dependencies:
ext {
//FirebaseUI Version Firebase/Play Services Version
// 3.1.0 11.4.2
supportLibraryVersion = '27.0.0'
grpcVersion = '1.7.0'
googlePlayVersion = '11.4.2'
firebaseVersion = '11.4.2'
fireUIVersion = '3.1.0'
facebookVersion = '4.27.0'
glideVersion = '4.3.0'
}
...
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "io.grpc:grpc-okhttp:$grpcVersion"
compile "io.grpc:grpc-protobuf-lite:$grpcVersion"
compile "io.grpc:grpc-stub:$grpcVersion"
compile('com.google.auth:google-auth-library-oauth2-http:0.7.1') {
exclude module: 'httpclient'
}
// Support Libraries:
compile "com.android.support:appcompat-v7:$supportLibraryVersion"
compile "com.android.support:preference-v7:$supportLibraryVersion"
compile "com.android.support:design:$supportLibraryVersion"
compile "com.android.support:cardview-v7:$supportLibraryVersion"
compile "com.android.support:preference-v7:$supportLibraryVersion"
compile "com.google.android.gms:play-services-auth:$firebaseVersion"
// FirebaseUI for Firebase Auth
compile "com.google.android.gms:play-services-auth:$googlePlayVersion"
compile "com.google.firebase:firebase-database:$firebaseVersion"
compile "com.google.firebase:firebase-auth:$firebaseVersion"
compile "com.google.firebase:firebase-core:$firebaseVersion"
compile "com.google.firebase:firebase-firestore:$firebaseVersion"
compile "com.android.support:recyclerview-v7:$supportLibraryVersion"
compile "com.android.support:support-v4:$supportLibraryVersion"
compile 'com.firebaseui:firebase-ui-auth:3.1.0'
compile 'com.android.support.constraint:constraint-layout-solver:1.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'javax.annotation:javax.annotation-api:1.2'
apply plugin: 'com.google.gms.google-services'
The project level :
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
classpath 'com.google.gms:google-services:3.1.1'
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven {
url "http://dl.bintray.com/ahmedrizwan/maven"
}
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
mavenCentral()
}
}
If i remove the:
// TRYED WITH compile 'com.google.firebase:firebase-firestore:11.4.2'
compile 'com.firebaseui:firebase-ui-auth:3.1.0'
All works great! But i need it for Firestore functionallity.
I have all API enabled, And Google Cloud Data Storage disabled.
Cloud Firestore and App Engine: You can't use both Cloud Firestore and Cloud Datastore in the same project, which might affect apps using App Engine. Try using Cloud Firestore with a different project.
Sorry you're encountering this, but Firestore is not (currently) compatible with an external gRPC, as answered here:
Cloud Firestore with gRPC build error
The 11.8.0 release fixes this.

Cannot build library project Bintray Gradle - ClassNotFoundException

I am still trying to get my gradle script work, I have expolered all logs and it seems that there are some classes are missing. Here is message.
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':horizontalrecyclerview'.
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/publication/maven/internal/DefaultMavenFactory
at org.gradle.api.plugins.AndroidMavenPlugin.apply(AndroidMavenPlugin.java:88)
at org.gradle.api.plugins.AndroidMavenPlugin.apply(AndroidMavenPlugin.java:57)
at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(Imper
Caused by: java.lang.ClassNotFoundException: org.gradle.api.publication.maven.internal.DefaultMavenFactory
... 51 more
Here is my build.gradle.
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "1.0.0"
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
def siteUrl = 'https://github.com/CROSP/AndroidHorizontalRecyclerView' // Homepage URL of the library
def gitUrl = 'https://github.com/CROSP/AndroidHorizontalRecyclerView.git' // Git repository URL
group = "com.github.crosp.horizontalrecyclerview" // Maven Group ID for the artifact
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.jsoup:jsoup:1.8.1'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:21.0.3'
}
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Android Horizontal Recycler View with Headerr'
description = 'Android Horizontal Recycler View with Header project for displaying horizontal list on Android '
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'crosp'
name 'Alexandr Crospenko'
email 'crosp#xakep.ru'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
// https://github.com/bintray/gradle-bintray-plugin
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
// it is the name that appears in bintray when logged
name = "crosp"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
version {
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password") //Optional. The passphrase for GPG signing'
}
// mavenCentralSync {
// sync = true //Optional (true by default). Determines whether to sync the version to Maven Central.
// user = properties.getProperty("bintray.oss.user") //OSS user token
// password = properties.getProperty("bintray.oss.password") //OSS user password
// close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
// }
}
}
}
Maybe someone already had such problem or know the way to solve it ? Please help, because I cannot get it work whole day already.
Thx in advance.
I am doing the same thing (upload my aar to bintray) and I have the same problem.
I am aware that it is occurred in gradle library, so I change my gradle verion from 2.4.0 to 2.2.1 by this way
File -> Project Structure (or trigger hotkey command + ;) -> click the Project in the left list in the dialog -> input 2.2.1 in the Gradle textedit box.
I solve this error by this way.Look for the note part in file README.md.
Hope this can help you.
ps:If you want to use gradle 2.4.0, you should config android-maven-plugin version to 1.3 in classpath in the project root build.gradle as :
com.github.dcendents:android-maven-gradle-plugin:1.3

Categories

Resources