I try to use IndoorAtlas Android SDK example. I follow this guide.
But when I try to run it i get this error:
Error:Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.Object[] using a local variable of type com.indooratlas.android.sdk.IAGeofenceRequest. This is symptomatic of .class transformation tools that ignore local variable information.
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex '/Users/xxx/AndroidStudioProjects/IndoorLocalization/app/libs/indooratlas-android-sdk-2.5.1.jar' to '/Users/xxx/AndroidStudioProjects/IndoorLocalization/app/build/intermediates/transforms/dex/debug/folders/1000/10/indooratlas-android-sdk-2.5.1_dbe918a8d06cf55c975257e4802cd6d4f4f48ea4'
How can i solve this issue?
IndoorAtlas Android SDK 2.5.1 had a bug with proguard opimizations. Use the newer 2.5.2 version which has this bug fixed. Version 2.5.2 can be used by specifying
dependencies {
...
compile 'com.indooratlas.android:indooratlas-android-sdk:2.5.2'
...
}
in your applications build.gradle file.
Related
When I build my android app, I get this error message:
Task :react-native-screens:compileReleaseKotlin FAILED
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /Users/vagrant/.gradle/caches/transforms-3/1811d0365a09e856e56e835cbefa53ec/transformed/jetified-kotlin-stdlib-jdk7-1.6.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
How can I fix this?
I tried to extend the version from 1.4.0 to 1.6.0 but I receive the following error:
> Task :app:mergeReleaseNativeLibs FAILED
Execution optimizations have been disabled for task ':app:mergeReleaseNativeLibs' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/Users/aalarcony/work/diampark/digipark_react_app/android/app/build/intermediates/merged_jni_libs/release/out'. Reason: Task ':app:mergeReleaseNativeLibs' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. Th
So I was able to get my project to build by following these instructions on the react-native-screens GitHub. Basically I just added this to my build.gradle file:
buildscript {
ext {
kotlinVersion = "1.6.0"
}
}
Still wish I knew why it has been working for a months and all of a sudden it broke!
I am using Android Gradle Plugin version 7.0.0-alpha14 and Gradle version 7.0 and when I try to upload the app to app distribution through the Gradle plugin version 2.1.0 it fails on a task app:appDistributionUploadDebug with an error
> Task :app:appDistributionUploadDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Some problems were found with the configuration of task ':app:appDistributionUploadDebug' (type 'UploadDistributionTask').
- Type 'UploadDistributionTask' property 'COMMAND_LINE_PREFIX' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as #Internal.
Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.
- Type 'UploadDistributionTask' property 'appDistributionProperties' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as #Internal.
Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#missing_annotation for more details about this problem.
I suppose the plugin is not compatible with Gradle 7 but is it a known issue and is there some workaround? Thanks
New version of plugin 2.1.1 was released that fixes this issue.
classpath 'com.google.firebase:firebase-appdistribution-gradle:2.1.1'
Goto project's build.gradle file
Add below line into dependencies block :-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
I'm building android project with:
Android Gradle plugin v. :4.1.0-alpha10
Gradle version: 6.5-rc-1
and getting this error:
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not create task ':app:extractDeepLinksDebug'.
Cannot obtain value from provider of environment variable 'ANDROID_AAPT_IGNORE' at configuration time.
Use a provider returned by 'forUseAtConfigurationTime()' instead.
I started getting this error when i updated Gradle version
Now after I downgrade to last to 6.5-milestone-1 it gives me another error:
Unsupported method: AndroidArtifact.getBuildConfigFields().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
Now i cannot build my project with any version.
I've got a legacy app I'm maintaining that builds fine when targeting API 28 but fails at Q.
The full error from the gradle build looks like this:
> Task :lintVitalRelease
Calling mockable JAR artifact transform to create file: /Users/spartygw/.gradle/caches/transforms-1/files-1.1/android.jar/5fe3ee8a258b0a02d9b262c195a9ab63/android.jar with input /Users/spartygw/Library/Android/sdk/platforms/android-Q/android.jar
> Task :lintVitalRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lintVitalRelease'.
> Could not resolve all files for configuration ':androidApis'.
> Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
> Cannot create mockable android.jar
I've followed the guidelines for setting up the Android Q SDK from here.
I'm building from a command line outside of Android Studio.
I see the build progress through building the jni library but barfs immediately when it gets to java byte compilation.
EDIT: Because I can't include the entire gradle stack (limited to 30,000 bytes in a post) here is the synopsis:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':lintVitalRelease'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':androidApis'.
Caused by: org.gradle.api.artifacts.transform.ArtifactTransformException: Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
Caused by: java.lang.RuntimeException: Cannot create mockable android.jar
Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 1821 but got 1807 bytes)
at com.android.builder.testing.MockableJarGenerator.createMockableJar(MockableJarGenerator.java:96)
at com.android.build.gradle.internal.dependency.MockableJarTransform.transform(MockableJarTransform.java:54)
... 109 more
Suppressed: java.util.zip.ZipException: invalid entry compressed size (expected 1821 but got 1807 bytes)
Those of you who are coming through google search and already have the latest gradle installed
Just delete the Android Q SDK and reinstall. The jars from left over beta install is probably messing with the final release
Anyone who might be coming here from a google search, I found the answer.
In the release notes for Android Q Beta 2 I found in the release notes this blurb:
When using Gradle 3.2.0 for projects targeting Android Q, you might encounter a lint-related issue with an error message similar to "Could not transform android.jar to a mockable jar." This issue does not occur in Gradle 3.3.0 and later.
If you are working on an app that targets Android Q and are unable to upgrade to Gradle 3.3.0 or later, you can use one of the following workarounds:
- Disable lint for release builds
- Unzip and rezip android.jar
Sure enough, unzipping and rezipping the android.jar allowed me to build and deploy to my test Android Q device
Go to Tools>SDK manager>platform tools and install/update SDK platform tools for Android Q. You might need to delete the existing sdk platform tools for Android Q and reinstall
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
}
Alpha1 works ok for me with Android Studio 3.0 canary 2,
but when I try to use alpha2, I get this exception:
Error:C:\Users\STD1\Documents\STD1\InvistaCultura\invistacultura-android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:752 invalid drawable
Error:java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o C:\Users\STD1\Documents\STD1\InvistaCultura\invistacultura-android\app\build\intermediates\res\merged\debug C:\Users\STD1\Documents\STD1\InvistaCultura\invistacultura-android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Issues:
- ERROR: C:\Users\STD1\Documents\STD1\InvistaCultura\invistacultura-android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:752 invalid drawable
and, in values.xml:752, I find this line, which is from a third library: Android Image Cropper
<item name="crop_image_menu_crop" type="drawable"/>
What can it be?
Found out that with Gradle plugin 3.0-alpha2 and above, resource values have to be defined, and the library does not define this resource.
For anyone who wants to follow up on this issue and a temporary fix Undefined Drawable
Temporary fix taken from the link
Before this gets merged and shipped, you can still use the library by declaring in your app resources
<item name="crop_image_menu_crop" type="drawable">#null</item>