Android Studio 1.1 with blank Android project woes

asked 2015-03-16 17:32:42 -0500

mlewis gravatar image

updated 2015-03-17 04:34:03 -0500

gvdhoorn gravatar image

I am trying to use the gradle/artifact method in the tutorials at:

http://wiki.ros.org/android/Tutorials...

I have a lot of problems trying to build a RosJava 'blank' Android Studio project both on Windows and Ubuntu.

By 'blank' Android Studio project, I did the following:

  • Fresh install of Android Studio (1.1) and SDK (24.1.2)
  • Project Close if one open, or ...
  • 'Start a new Android Studio Project'
  • File > New Project... > Phone and Tablet , API 18 - 4.3 Jelly Bean > Blank Activity > Finish

It complains about rendering problems, but once the Gradle build completes it is okay.

Build and run the project, it works. See the 'Hello World' on the blank App.

In the project explorer, open 'Gradle Scripts > build.gradle (Module: app), and add lines so the file 'dependencies' section is replaced with the following 2 sections, repositories and dependencies:

repositories {
    maven {
        url 'https://github.com/rosjava/rosjava_mvn_repo/raw/master'
    }
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:22.0.0'

    //compile 'org.ros.android_core:android_gingerbread_mr1:[0.1,0.2)'

    //compile 'org.ros.android_core:android_honeycomb_mr2:[0.1,0.2)'

    //compile 'org.ros.rosjava_core:rosjava:[0.1,0.2)'
}

Click the 'Sync Now' in the yellow band near the top, and wait for the Gradle task to finish

Do Build > ReBuild Project Again the project runs with no problem.

On Windows, I had to remove a line in AndroidManifest.xml: <!--android:icon="@mipmap/ic_launcher"-->

Uncomment the 'compile ... gingerbread line, in Build.gradle: app click the yellow bar to Sync Now rebuild the project, and see the errors The errors are below:

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:app:prepareOrgRosAndroid_coreAndroid_gingerbread_mr1012Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug
AGPBI: {"kind":"SIMPLE","text":"trouble processing \"javax/xml/parsers/DocumentBuilder.class\":","position":{},"original":"trouble processing \"javax/xml/parsers/DocumentBuilder.class\":"}
AGPBI: {"kind":"SIMPLE","text":"Ill-advised or mistaken usage of a core class (java.* or javax.*)","position":{},"original":"Ill-advised or mistaken usage of a core class (java.* or javax.*)"}
AGPBI: {"kind":"SIMPLE","text":"when not building a core library.","position":{},"original":"when not building a core library."}
AGPBI: {"kind":"SIMPLE","text":"This is often due to inadvertently including a core library file","position":{},"original":"This is often due to inadvertently including a core library file"}
AGPBI: {"kind":"SIMPLE","text":"in your application\u0027s project, when using an IDE (such as","position":{},"original":"in your application\u0027s project, when using an IDE (such as"}
AGPBI: {"kind":"SIMPLE","text":"Eclipse). If you are sure you\u0027re not intentionally defining a","position":{},"original":"Eclipse). If you are sure you\u0027re not intentionally defining a"}
AGPBI: {"kind":"SIMPLE","text":"core class ...
(more)
edit retag flag offensive close merge delete