Closed dariopellegrini closed 4 years ago
I agree that this seems like an application issue. That error message says that you don't have a class called com.mypackage.myapplication.MainActivity
in your application. Do you?
CBL has a native component and it is possible that AS 3.5 is doing something funny with that.
Could you try 2.6.0 with an older version of AS, and report back
@bmeike The class exists and with 2.5.2 the app works properly. The problem starts with 2.6.0.
I've tried with an older project generated by AS 3.4 on AS 3.5 and with 2.6 it works.
It seems that the problem is with project generated with AS 3.5 not with AS 3.5 itself. I'm investigating this issue and I'll let you know further details.
Any help is welcome :) Can you reproduce the issue?
@bmeike ok I have it and it seems a problem with Couchbase 2.6.0, but I don't know if it is from me or from CouchbaseLite.
I've ran ./gradlew assemble clean and the process fails. Here are the reasons:
> Task :app:stripDebugDebugSymbols
Compatible side by side NDK version was not found.
Unable to strip library '/Users/dariopellegrini/Documents/Android/MyApplication3/app/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a/libLiteCoreJNI.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library '/Users/dariopellegrini/Documents/Android/MyApplication3/app/build/intermediates/merged_native_libs/debug/out/lib/x86_64/libLiteCoreJNI.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
> Transform artifact couchbase-lite-android.aar (com.couchbase.lite:couchbase-lite-android:2.6.0) with DexingNoClasspathTransform
AGPBI: {"kind":"error","text":"Invoke-customs are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}
> Task :app:stripReleaseDebugSymbols
Unable to strip library '/Users/dariopellegrini/Documents/Android/MyApplication3/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libLiteCoreJNI.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library '/Users/dariopellegrini/Documents/Android/MyApplication3/app/build/intermediates/merged_native_libs/release/out/lib/x86/libLiteCoreJNI.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library '/Users/dariopellegrini/Documents/Android/MyApplication3/app/build/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libLiteCoreJNI.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library '/Users/dariopellegrini/Documents/Android/MyApplication3/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libLiteCoreJNI.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
> Task :app:mergeExtDexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform artifact 'couchbase-lite-android.aar (com.couchbase.lite:couchbase-lite-android:2.6.0)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=false, dexing-is-debuggable=true, dexing-min-sdk=24}.
> Execution failed for DexingNoClasspathTransform: /Users/dariopellegrini/.gradle/caches/transforms-2/files-2.1/981d2748c0e403ed9c2eea757b576975/jetified-couchbase-lite-android-2.6.0/jars/classes.jar.
> Error while dexing.
The dependency contains Java 8 bytecode. Please enable desugaring by adding the following to build.gradle
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
See https://developer.android.com/studio/write/java8-support.html for details. Alternatively, increase the minSdkVersion to 26 or above.
The workaround is to add
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
It seems to work. Maybe there is an issue in new Couchbase 2.6.0 compilation, I don't know, but I hope the above log helps you to find out what was happening.
Work around??? That isn't a workaround! That is a documented dependency! Sorry I didn't notice its absence in your original post. Glad it is working, now.
Hello. I'm experiencing a crash while adding Couchbase 2.6.0 through Gradle on a new Android Studio 3.5 project.
The crash says
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mypackage.myapplication/com.mypackage.myapplication.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.mypackage.myapplication.MainActivity" on path: DexPathList[[zip file "/data/app/com.mypackage.myapplication-eEQxhjvy2kuLuIPqVZPIkA==/base.apk"],nativeLibraryDirectories=[/data/app/com.mypackage.myapplication-eEQxhjvy2kuLuIPqVZPIkA==/lib/arm64, /data/app/com.mypackage.myapplication-eEQxhjvy2kuLuIPqVZPIkA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
Here are the Gradle file and the Manifest file generated by Android Studio 3.5.
Gradle file with Couchbase import in addiction
Manifest file
Just changing Couchbase 2.6.0 to 2.5.2 version in Gradle file solves the issue.
I know that it seems an application issue, but it appears only when there is a CouchbaseLite 2.6.0 dependency and from a new Android Studio project.
Any idea why is happening? Maybe a Couchbase issue or a misconfiguration of my project?