Support
Quality
Security
License
Reuse
kandi has reviewed android-crop and discovered the below as its top functions. This is intended to give you an instant insight into android-crop implemented functionality, and help decide if they suit your requirements.
Gradle build & AAR
Modern UI
Backwards compatible to SDK 10
Simple builder for configuration
Example project
Usage
<activity android:name="com.soundcloud.android.crop.CropImageActivity" />
License
Copyright 2016 SoundCloud
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Error java.lang.ClassNotFoundException After Upgrading to AndroidX and Android Studio 4.0
<uses-library android:name="org.apache.http.legacy" android:required="false" />
Could not find androidsdk.modules
implementation 'com.facebook.android:facebook-applinks:[5,5.11.1)'
implementation 'com.facebook.android:facebook-core:[5,5.11.1)'
implementation 'com.facebook.android:facebook-login:[5,5.11.1)'
implementation 'com.facebook.android:facebook-share:[5,5.11.1)'
-----------------------
android
|--build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 28
...
// This is a temporary fix for react-native-fbsdk v1.1.2
facebookSdkVersion = "5.15.3"
}
}
-----------------------
android
|--build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 28
...
// This is a temporary fix for react-native-fbsdk v1.1.2
facebookSdkVersion = "5.15.3"
}
}
-----------------------
implementation 'com.facebook.android:facebook-android-sdk:5.15.3'
-----------------------
cat node_modules/react-native-fbsdk/android/build.gradle
def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5.0,6.0[')
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.facebook.android:facebook-core:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-login:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-share:${FACEBOOK_SDK_VERSION}"
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 28
...
// the override version
facebookSdkVersion = "5.15.3"
}
}
implementation "com.facebook.android:facebook-android-sdk:$facebookSdkVersion"
-----------------------
cat node_modules/react-native-fbsdk/android/build.gradle
def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5.0,6.0[')
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.facebook.android:facebook-core:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-login:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-share:${FACEBOOK_SDK_VERSION}"
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 28
...
// the override version
facebookSdkVersion = "5.15.3"
}
}
implementation "com.facebook.android:facebook-android-sdk:$facebookSdkVersion"
-----------------------
cat node_modules/react-native-fbsdk/android/build.gradle
def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5.0,6.0[')
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.facebook.android:facebook-core:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-login:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-share:${FACEBOOK_SDK_VERSION}"
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 28
...
// the override version
facebookSdkVersion = "5.15.3"
}
}
implementation "com.facebook.android:facebook-android-sdk:$facebookSdkVersion"
-----------------------
cat node_modules/react-native-fbsdk/android/build.gradle
def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '[5.0,6.0[')
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.facebook.android:facebook-core:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-login:${FACEBOOK_SDK_VERSION}"
implementation "com.facebook.android:facebook-share:${FACEBOOK_SDK_VERSION}"
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 18
compileSdkVersion = 28
targetSdkVersion = 28
...
// the override version
facebookSdkVersion = "5.15.3"
}
}
implementation "com.facebook.android:facebook-android-sdk:$facebookSdkVersion"
QUESTION
Error java.lang.ClassNotFoundException After Upgrading to AndroidX and Android Studio 4.0
Asked 2020-Jul-20 at 08:25I just recently upgraded my old project from target sdk version 26 to 28 and used AndroidX in order to use WorkManager library. I also upgraded my Android Studio to version 4.0.
I have one external jar library commons-httpclient-3.1-rc1.jar (implementation files('libs/commons-httpclient-3.1-rc1.jar')). The build process run well and my application could start normaly. But i got the following warning when my app starting the background sync process (using workmanger). The sync class used some classes from commons-httpclient library.
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.LogFactory" on path: DexPathList[[zip file "/data/app/com.myapp.android-_mXRtE6XltfExOFTAj7PRQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.android-_mXRtE6XltfExOFTAj7PRQ==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.apache.commons.httpclient.util.EncodingUtil.<clinit>(EncodingUtil.java:54)
at org.apache.commons.httpclient.util.EncodingUtil.getBytes(EncodingUtil.java:202)
at org.apache.commons.httpclient.util.URIUtil.encode(URIUtil.java:502)
at org.apache.commons.httpclient.util.URIUtil.encodeAll(URIUtil.java:218)
at com.myapp.android.http.util.EncodeUtil.encode(EncodeUtil.java:12)
at com.myapp.android.http.params.HttpParams.getQueryString(HttpParams.java:69)
at com.myapp.android.http.kauth.KAuthProvider.getSignedUrl(KAuthProvider.java:52)
at com.myapp.android.http.client.HttpConnection.get(HttpConnection.java:62)
at com.myapp.android.http.impl.client.SyncConnection.syncMaster(SyncConnection.java:28)
at com.myapp.android.worker.SyncWorker.lambda$startWork$0$SyncWorker(SyncWorker.java:103)
at com.myapp.android.worker.-$$Lambda$SyncWorker$jzconowJk0nkjIXH-ROtVtccjT8.attachCompleter(Unknown Source:4)
at androidx.concurrent.futures.CallbackToFutureAdapter.getFuture(CallbackToFutureAdapter.java:102)
at com.myapp.android.worker.SyncWorker.startWork(SyncWorker.java:66)
at androidx.work.impl.WorkerWrapper$1.run(WorkerWrapper.java:281)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I guess the error might be dealing with Multidex feature. I'm using Multidex and already replace the old Multidex with AndroidX version. In my build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
buildToolsVersion "30.0.0"
flavorDimensions "version"
productFlavors {
dev {
minSdkVersion 21 //The important bit.
dimension "version"
}
prod {
minSdkVersion 15 //Example. Set to your real requirement.
dimension "version"
}
}
defaultConfig {
applicationId "com.myapp.android"
minSdkVersion 15
targetSdkVersion 28
versionCode 7
versionName "1.0.6"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
lintOptions {
disable 'TypographyFractions','TypographyQuotes'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.work:work-runtime:2.4.0-rc01'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.concurrent:concurrent-futures:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'com.google.android.gms:play-services-auth:11.0.0'
implementation 'com.google.android.gms:play-services-plus:11.0.0'
implementation 'com.google.android.gms:play-services-analytics:11.0.0'
implementation 'com.google.firebase:firebase-messaging:11.0.0'
implementation 'com.google.firebase:firebase-config:11.0.0'
implementation 'com.google.firebase:firebase-ads:11.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.facebook.android:facebook-android-sdk:4.8.2'
implementation 'com.github.clans:fab:1.6.2'
implementation 'com.github.bumptech.glide:glide:3.5.2'
implementation 'com.github.rey5137:material:1.2.2'
implementation 'com.github.ganfra:material-spinner:1.1.1'
implementation 'com.wdullaer:materialdatetimepicker:2.1.1'
implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'net.danlew:android.joda:2.9.4.3'
implementation 'com.github.chrisbanes:PhotoView:1.3.1'
implementation 'com.github.paolorotolo:appintro:4.1.0'
implementation 'com.squareup.picasso:picasso:2.3.2'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
implementation files('libs/commons-httpclient-3.1-rc1.jar')
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'
And in BaseApplication class
import androidx.multidex.MultiDexApplication
public class BaseApplication extends MultiDexApplication {}
I've tried to clean the project, rebuild, invalidate caches and restart but it didn't work. Any solution?
Thank you
ANSWER
Answered 2020-Jul-20 at 08:25I've already fixed the problem. Found the solution from this answer
java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion
The solution is to add
<uses-library android:name="org.apache.http.legacy" android:required="false" />
on manifest file.
I'm not using google maps, but the error might caused by the apache library.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit