Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com - android

I get this error and I have no idea how to fix it. I have java 7. Thank you in advance. I am new to codding and I dont have any past experience at all, I have done the very basic on paper programing but still. Also what do I have to do to test this application inside the android emulator? Thanks
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.>
com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lightcurb.example" >
<!-- SDK feature -->
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />
<application
android:name=".LCExampleApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".activity.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.indooratlas.android.sdk.API_KEY"
android:value="c24c139a-0fd8-4072-b92d-440f1369a413"/>
<meta-data
android:name="com.indooratlas.android.sdk.API_SECRET"
android:value="jU)0v5VVdUGfpE69DUS!zLmqVhA1wiPNymesYonp6XSArIshOSfYKbhJP9v6zIpdl8U9hOhrgQiPWYYjwSWUjgjDlbi44MNu0P52dwglirV0qTAWFfY7sj)ClhXp80i1"/>
</application>
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.lightcurb.example"
minSdkVersion 18
targetSdkVersion 21
versionCode 9
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.pro'
}
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
compile 'com.indooratlas.android:indooratlas-android-sdk:2.0.2-beta#aar'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.radiusnetworks:AndroidIBeaconLibrary:0.7.7#aar'
compile 'com.lightcurb.sdk:LightcurbSDK:1.0.1#aar'
}
repositories{
maven {
url "http://indooratlas-ltd.bintray.com/mvn-public"
}
}

Related

Android Studio generated apk installs but doesn't open

I have installed my apk bundle that I created via Build APK(s) and it installs but won't let me open it, and it doesn't show in the menu.
I've already checked Project/App/src/main/AndroidManifest.xml and Project/build.gradle and settings.gradle as well but I don't find anything odd.
android:protectionLevel="signature" is not in any of the previous files.
minifyEnabled is FALSE
I've read somewhere to edit my manifest and add or something (I can't find the post right now). I did it, and the app began to have gradle errors, and showed me another manifest that had those lines written.
Here's my Project/App/src/main/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.multicobertura">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.Multicobertura" />
</manifest>
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle
include ':app'
rootProject.name = "multicobertura"
I am clueless
EDIT: I tried adding "entry points"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.multicobertura">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.Multicobertura" />
<activity
android:name=".NewEntryPoint"
android:label="#string/title_activity_second" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</manifest>
But
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app build.gradle
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.multicobertura"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
EDIT2: I've already created a new android studio project, copied the files and yarn insalled the modules, built the app and failed as well. Anyone?

Getting error while generate the APK build and try to run it from device instant app

Instant app working FINE while run the app from android studio but, getting errors while generate the APK build and try to run it from device
getting below error in xiaomi noughat device
instant app crash by giving this message "There was a problem parsing the package"
I have used instant app development version 1.3.0 and also enabled instant app setting from settings > google > instant apps
E/Icon: Unable to load resource 0x00000000 from pkg=com.android.systemui
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:201)
at android.content.res.MiuiResourcesImpl.getValue(MiuiResourcesImpl.java:91)
at android.content.res.Resources.getDrawable(Resources.java:784)
at android.graphics.drawable.Icon.loadDrawableInner(Icon.java:316)
at android.graphics.drawable.Icon.loadDrawable(Icon.java:272)
at android.graphics.drawable.Icon.loadDrawableAsUser(Icon.java:380)
at com.android.systemui.statusbar.ExpandedIcon.getDrawable(ExpandedIcon.java:59)
at com.android.systemui.statusbar.StatusBarIconView.getIcon(StatusBarIconView.java:174)
at com.android.systemui.statusbar.StatusBarIconView.setIcon(StatusBarIconView.java:133)
at com.android.systemui.statusbar.StatusBarIconView.updateDarkMode(StatusBarIconView.java:266)
at com.android.systemui.statusbar.phone.SimpleStatusBar.updateDarkMode(SimpleStatusBar.java:264)
at com.android.systemui.statusbar.phone.PhoneStatusBar$17.run(PhoneStatusBar.java:3494)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6195)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
and getting below error in lollipop device
package - Android: Parse error when parsing manifest. Discontinuing installation
Here i listed out manifest files and gradle files of my project
instantapp gradle
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':feature')
implementation project(':base')}
feature module gradle and manifest
apply plugin: 'com.android.feature'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':base')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstinstantapp.feature">
<uses-permission android:name="android.permission.INTERNET" />
<application>
<activity android:name="com.example.myfirstinstantapp.feature.MainActivity">
<meta-data
android:name="default-url"
android:value="https://myfirstinstantapp.example.com/hello" />
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="myfirstinstantapp.example.com"
android:pathPattern="/.*"
android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
===========================================
base module gradle and manifest
apply plugin: 'com.android.feature'
android {
compileSdkVersion 28
baseFeature true
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api 'com.android.support:appcompat-v7:28.0.0-alpha3'
api 'com.android.support.constraint:constraint-layout:1.1.2'
application project(':app')
feature project(':feature')
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstinstantapp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity" />
</application>
</manifest>
===========================================
app gradle and manifest
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myfirstinstantapp.app"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(':feature')
implementation project(':base')
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstinstantapp.app" />
===========================================
project level gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here i attached screenshot of my project structure

Unable to successfully run Google Drive GDAA demo app

I am having difficulty executing the sample Google Drive app successfully. When I run the app on my Moto X I receive the following error:
I/DriveDemo: GoogleApiClient connection failed: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{867e070: android.os.BinderProxy#13cdfe9}, message=null}
Steps I have taken so far:
Created an OAuth certificate.
Enabled the Google Drive API.
Followed the instructions at https://developers.google.com/identity/sign-in/android/start-integrating to integrate sign-in.
Moved client_id.json to the app directory
manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lightkeeper54.chuck.drivedemo" >
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity android:name=".MainActivity" >
<meta-data android:name="com.google.android.apps.drive.APP_ID" android:value="id=MY_ID" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.apps.drive.DRIVE_OPEN" />
<data android:mimeType="application/vnd.google-apps.drive-sdk.MY_ID" />
</intent-filter>
</activity>
</application>
</manifest>
MY_ID is the numeric ID from the API Manager Credentials screen, using the numeric prefix up to the hyphen in the Client ID. I am unclear as to whether this is correct, since I have been unable to find much information regarding this.
build.gradle (project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.lightkeeper54.chuck.drivedemo"
minSdkVersion 22
targetSdkVersion 24
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'])
compile 'com.google.android.gms:play-services:10.0.1'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
What am I doing wrong?

From Eclipse to android studio internet problems

So,I am importing a project that works perfectly (tested on 4 phones) from Eclipse to Android studio and when I run the application WITHOUT modifying anything at all, it won't allow me to use the internet at all.
As for code...it's pointless to post any ,because I created an application that does nothing but connect to a database and it still won't work, while the exact same code will work perfectly when I run the application from Eclipse to my phone. (Same phone by the way)
Just to make sure that won't be an answer: I HAVE the permissions added in my manifest.
Any suggestions?
//manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="vlad.tests.com.udptextconnection" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
// Build.gradle (module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "vlad.tests.com.udptextconnection"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
}
//Build.gradle (project [project-name])
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Try putting permissions outside of application tag.
Not sure if it'd work but, try and clean your project.
Go to Build->Clean Project.
Try Build->Rebuild Project.

Git submodule causing Failure [INSTALL_FAILED_OLDER_SDK] Android sdk 21

I am working on an app and trying to use the new material design, aka sdk version 21.
I had everything working fine, and then wanted to at a fab (floating action button) using this library.
I added this library as a submodule, using
git submodule add https://github.com/shamanland/floating-action-button
while under C:\Users\USER\AndroidStudioProjects\ProjectName
My file structure looks like so
ProjectName
app
floating-action-button
The issue
Before everything was totally fine, I was able to build and run the project.
But, ever since adding this submodule, when trying to run it, I get the error
Failure [INSTALL_FAILED_OLDER_SDK]
So I'm thinking it has to do with the submodule, but I'm not sure how.
app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.0.2'
defaultConfig {
applicationId "com.mayuonline.ribbit"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.+'
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:palette-v7:+'
}
app/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="resume.kelseyhrubes">
<uses-sdk tools:node="replace" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
f-a-b/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'org.robolectric:robolectric-gradle-plugin:0.11.0'
}
}
def isSnapshot() {
return VERSION_NAME.contains('SNAPSHOT')
}
def gradleMvnPush = new File(buildDir, 'gradle-mvn-push.gradle')
if (!gradleMvnPush.exists()) {
buildDir.mkdirs()
ant.get(src: GRADLE_MVN_PUSH, dest: gradleMvnPush)
}
setProperty('GRADLE_MVN_PUSH', gradleMvnPush)
subprojects {
group GROUP
version VERSION_NAME
apply plugin: 'android-sdk-manager'
if (name.startsWith('lib')) {
apply plugin: 'com.android.library'
} else {
apply plugin: 'com.android.application'
}
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode 1
versionName '1.0'
// workaround for https://code.google.com/p/android/issues/detail?id=52962
buildConfigField 'boolean', 'SNAPSHOT', isSnapshot().toString()
}
lintOptions {
abortOnError false
}
}
repositories {
mavenLocal()
mavenCentral()
}
if (isSnapshot()) {
apply plugin: 'robolectric'
dependencies {
// NOTE workaround for sdkmanager plugin
compile 'com.android.support:support-v4:19.0.1'
androidTestCompile 'junit:junit:4.10'
androidTestCompile 'org.robolectric:robolectric:2.3'
androidTestCompile 'com.squareup:fest-android:1.0.8'
}
}
}
f-a-b/AndroidManifest.xml (probably a clue here, I (tried to) bold the areas that Android Studio has turned red
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=" **http://schemas.android.com/apk/res/android** "
package="com.shamanland.fab.example">
<application
android:name=" **.ExampleApplication** "
android:label="#string/app_name"
**android:icon** ="#drawable/ic_launcher"
**android:theme** ="#style/AppTheme"
**android:allowBackup** ="true"
>
<activity android:name=".ExampleListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=" **.ExampleDetailsActivity** "/>
</application>
</manifest>
I have a strong suspicion that the submodule was added incorrectly.
Really all I want is to use a fab in my app, if anyone can help me figure out what may be wrong, with adding the submodule, or something with my build.gradle, that would really be appreciated!!
This error is usually caused by deploying an APK built with "compileSdkVersion n" to a device or emulator with an API level less than "n". Is your emulator at the right API level?

Categories

Resources