Closed shahinesi closed 7 years ago
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Warning:WARNING: Dependency org.json:json:20160810 is ignored for debug as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.3 is ignored for debug as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.json:json:20160810 is ignored for debug as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.3 is ignored for debug as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.json:json:20160810 is ignored for release as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.3 is ignored for release as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.json:json:20160810 is ignored for release as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.3 is ignored for release as it may be conflicting with the internal version provided by Android. Information:BUILD SUCCESSFUL Information:Total time: 1 mins 29.957 secs Information:0 errors Information:8 warnings Information:See complete output in console
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDENCIES File1: C:\Users\Shahin.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpmime\4.5.3\889fd6d061bb63b99dd5c6aba35a555ae863de52\httpmime-4.5.3.jar File2: C:\Users\Shahin.gradle\caches\modules-2\files-2.1\com.google.inject\guice\4.1.0\eeb69005da379a10071aa4948c48d89250febb07\guice-4.1.0.jar
@shahinesi I doubt you can use this library in an Android project since this library uses Java8. Specially if you plan to target old android versions.
i used JDK.8.0.121.x64 sun.java.8.0.121.x64 Android Studio 2.3 (android-studio-bundle-162.3764568)
is work
compile 'com.github.rubenlagus.TelegramBots:telegrambots:2.4.4.5'
So, it does work in Android? Which android sdk is your app targeting?
C:\Windows\system32>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.shahi.myapplication"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:25.2.0'
testCompile 'junit:junit:4.12'
//compile 'com.github.rubenlagus.TelegramBots:Bots:2.4.4.5'
compile 'com.github.rubenlagus.TelegramBots:telegrambots:2.4.4.5'
}
That's what I meant. You can't use this library in Android I guess since it will need java 8.
Closing this since it is not a bug.
@rubenlagus I'm gonna 8! How can I fix this?
https://developer.android.com/guide/platform/j8-jack.html#supported-features
Android doesn't support full java8, so I don't think there is any solution.
Tnx I will check
This was why the library with the following code?
compile 'com.github.rubenlagus.TelegramBots:telegrambots:2.4.4.5'
But the Code is not it?
compile 'com.github.rubenlagus.TelegramBots:Bots:2.4.4.5'
Hi I am using the following method:
But I encountered a problem and does not support the following import!
So https://github.com/rubenlagus/TelegramBots/releases/tag/2.4.4.5 Erorr 1.7 java