Форум программистов, компьютерный форум, киберфорум
Наши страницы
Программирование Android
Войти
Регистрация
Восстановить пароль
 
Рейтинг 4.67/3: Рейтинг темы: голосов - 3, средняя оценка - 4.67
Yury609
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
1

Android Studio не хочет видеть некоторые файлы в SDK

08.06.2017, 17:21. Просмотров 599. Ответов 6
Метки нет (Все метки)

Всем привет!
Понадобилось мне работать с web services в AndroidStudio (далее AS).
Нашел исходники нужной библиотеки javax.xml.ws
Положил эти исходники в скачанный android-sdk (25 версия)

И вот что получается:
Java
1
2
import javax.xml.namespace.QName;
import javax.xml.ws.Service
файл javax.xml.namespace.QName - AS видит (т.е. GOTO->Declaration - находится нужный файл)

а
javax.xml.ws.Service AS упорно не хочет видеть...
Как заставить AS увидеть добавленные в SDK мной файлы?

И ещё вопрос.
Если я добавлю jar библиотеку в %JAVA_HOME%\lib - она будет доступна для AS?
Спасибо!
Юрий
0
Similar
Эксперт
41792 / 34177 / 6122
Регистрация: 12.04.2006
Сообщений: 57,940
08.06.2017, 17:21
Ответы с готовыми решениями:

Sdk в настойках Android Studio и sdk в Project Structure
То есть получается что путь к sdk которое использует Android Studio прописывается в Settings...

Не предлагается установка Android SDK при установке Android Studio
на сайте https://developer.android.com/studio/... скачал exeшник для установки Android Studio....

Android studio перестал видеть телефон
Тестировал приложение на телефоне, вроде ничего не менял и в один ужасный день, студия перестала...

Версия SDK в Android Studio
Всем привет, возник такой вопрос, как изменить минимальную версию SDK проекта в Android Studio?...

Как установить SDK в Android Studio
Нужна помощь. Вчера написал игру на движке unity. Выяснилось что нужно установить Android SDK ....

6
Pablito
2812 / 2236 / 754
Регистрация: 12.05.2014
Сообщений: 7,824
Завершенные тесты: 1
08.06.2017, 17:26 2
в build.gradle надо добавить
Java
1
compile 'javax.xml.ws:jaxws-api:2.2.11'
и все видит, но я работу не проверял
0
Yury609
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
08.06.2017, 17:37  [ТС] 3
2 Pablito

я складывал нужные библиотеки в папку libs проекта.
build проходил успешно.

Но при сборке apk - вываливалось куча ошибок на добавленные библиотеки.
Поэтому я решил попробовать вариант с исходниками, которые добавил в SDK, в надежде что AS их обнаружит и подцепит...
0
Pablito
2812 / 2236 / 754
Регистрация: 12.05.2014
Сообщений: 7,824
Завершенные тесты: 1
08.06.2017, 17:43 4
к чему этот весь текст?
я написал как подключить библиотеку, так проще, а главное - это работает
0
Yury609
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
09.06.2017, 09:23  [ТС] 5
Build получается
Кликните здесь для просмотра всего текста

Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, :apprepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources]

Configuration on demand is an incubating feature.
******
:appreDebugAndroidTestBuild UP-TO-DATE
:apprepareComAndroidSupportTestEspressoEspressoCore222Library
:apprepareComAndroidSupportTestEspressoEspressoIdlingResource222Library
:apprepareComAndroidSupportTestExposedInstrumentationApiPublish05Library
:apprepareComAndroidSupportTestRules05Library
:apprepareComAndroidSupportTestRunner05Library
:apprepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:approcessDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:approcessDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:incrementalDebugJavaCompilationSafeguard
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:incrementalDebugUnitTestJavaCompilationSafeguard UP-TO-DATE
:app:javaPreCompileDebugUnitTest
:app:compileDebugUnitTestJavaWithJavac
:approcessDebugJavaRes UP-TO-DATE
:approcessDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestSources
:app:incrementalDebugAndroidTestJavaCompilationSafeguard
:app:javaPreCompileDebugAndroidTest
:app:compileDebugAndroidTestJavaWithJavac
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources

BUILD SUCCESSFUL

Total time: 5.109 secs


А вот build apk - не проходит...

Кликните здесь для просмотра всего текста

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to ********
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

*****
:app:transformClassesWithDexForDebug
AGPBI: {"kind":"error","text":"trouble processing "javax/xml/bind/Binder.class":","sources":[{}]}
AGPBI: {"kind":"error","text":"Ill-advised or mistaken usage of a core class (java.* or javax.*)","sources":[{}]}
AGPBI: {"kind":"error","text":"when not building a core library.","sources":[{}]}
AGPBI: {"kind":"error","text":"This is often due to inadvertently including a core library file","sources":[{}]}
AGPBI: {"kind":"error","text":"in your application\u0027s project, when using an IDE (such as","sources":[{}]}
AGPBI: {"kind":"error","text":"Eclipse). If you are sure you\u0027re not intentionally defining a","sources":[{}]}
AGPBI: {"kind":"error","text":"core class, then this is the most likely explanation of what\u0027s","sources":[{}]}
AGPBI: {"kind":"error","text":"going on.","sources":[{}]}
AGPBI: {"kind":"error","text":"However, you might actually be trying to define a class in a core","sources":[{}]}
AGPBI: {"kind":"error","text":"namespace, the source of which you may have taken, for example,","sources":[{}]}
AGPBI: {"kind":"error","text":"from a non-Android virtual machine project. This will most","sources":[{}]}
AGPBI: {"kind":"error","text":"assuredly not work. At a minimum, it jeopardizes the","sources":[{}]}
AGPBI: {"kind":"error","text":"compatibility of your app with future versions of the platform.","sources":[{}]}
AGPBI: {"kind":"error","text":"It is also often of questionable legality.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you really intend to build a core library -- which is only","sources":[{}]}
AGPBI: {"kind":"error","text":"appropriate as part of creating a full virtual machine","sources":[{}]}
AGPBI: {"kind":"error","text":"distribution, as opposed to compiling an application -- then use","sources":[{}]}
AGPBI: {"kind":"error","text":"the "--core-library" option to suppress this error message.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you go ahead and use "--core-library" but are in fact","sources":[{}]}
AGPBI: {"kind":"error","text":"building an application, then be forewarned that your application","sources":[{}]}
AGPBI: {"kind":"error","text":"will still fail to build or run, at some point. Please be","sources":[{}]}
AGPBI: {"kind":"error","text":"prepared for angry customers who find, for example, that your","sources":[{}]}
AGPBI: {"kind":"error","text":"application ceases to function once they upgrade their operating","sources":[{}]}
AGPBI: {"kind":"error","text":"system. You will be to blame for this problem.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you are legitimately using some code that happens to be in a","sources":[{}]}
AGPBI: {"kind":"error","text":"core package, then the easiest safe alternative you have is to","sources":[{}]}
AGPBI: {"kind":"error","text":"repackage that code. That is, move the classes in question into","sources":[{}]}
AGPBI: {"kind":"error","text":"your own package namespace. This means that they will never be in","sources":[{}]}
AGPBI: {"kind":"error","text":"conflict with core system classes. JarJar is a tool that may help","sources":[{}]}
AGPBI: {"kind":"error","text":"you in this endeavor. If you find that you cannot do this, then","sources":[{}]}
AGPBI: {"kind":"error","text":"that is an indication that the path you are on will ultimately","sources":[{}]}
AGPBI: {"kind":"error","text":"lead to pain, suffering, grief, and lamentation.","sources":[{}]}
AGPBI: {"kind":"error","text":"1 error; aborting","sources":[{}]}

FAILED

AGPBI: {"kind":"error","text":"trouble processing "javax/xml/ws/Action.class":","sources":[{}]}
AGPBI: {"kind":"error","text":"Ill-advised or mistaken usage of a core class (java.* or javax.*)","sources":[{}]}
AGPBI: {"kind":"error","text":"when not building a core library.","sources":[{}]}
AGPBI: {"kind":"error","text":"This is often due to inadvertently including a core library file","sources":[{}]}
AGPBI: {"kind":"error","text":"in your application\u0027s project, when using an IDE (such as","sources":[{}]}
AGPBI: {"kind":"error","text":"Eclipse). If you are sure you\u0027re not intentionally defining a","sources":[{}]}
AGPBI: {"kind":"error","text":"core class, then this is the most likely explanation of what\u0027s","sources":[{}]}
AGPBI: {"kind":"error","text":"going on.","sources":[{}]}
AGPBI: {"kind":"error","text":"However, you might actually be trying to define a class in a core","sources":[{}]}
AGPBI: {"kind":"error","text":"namespace, the source of which you may have taken, for example,","sources":[{}]}
AGPBI: {"kind":"error","text":"from a non-Android virtual machine project. This will most","sources":[{}]}
AGPBI: {"kind":"error","text":"assuredly not work. At a minimum, it jeopardizes the","sources":[{}]}
AGPBI: {"kind":"error","text":"compatibility of your app with future versions of the platform.","sources":[{}]}
AGPBI: {"kind":"error","text":"It is also often of questionable legality.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you really intend to build a core library -- which is only","sources":[{}]}
AGPBI: {"kind":"error","text":"appropriate as part of creating a full virtual machine","sources":[{}]}
AGPBI: {"kind":"error","text":"distribution, as opposed to compiling an application -- then use","sources":[{}]}
AGPBI: {"kind":"error","text":"the "--core-library" option to suppress this error message.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you go ahead and use "--core-library" but are in fact","sources":[{}]}
AGPBI: {"kind":"error","text":"building an application, then be forewarned that your application","sources":[{}]}
AGPBI: {"kind":"error","text":"will still fail to build or run, at some point. Please be","sources":[{}]}
AGPBI: {"kind":"error","text":"prepared for angry customers who find, for example, that your","sources":[{}]}
AGPBI: {"kind":"error","text":"application ceases to function once they upgrade their operating","sources":[{}]}
AGPBI: {"kind":"error","text":"system. You will be to blame for this problem.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you are legitimately using some code that happens to be in a","sources":[{}]}
AGPBI: {"kind":"error","text":"core package, then the easiest safe alternative you have is to","sources":[{}]}
AGPBI: {"kind":"error","text":"repackage that code. That is, move the classes in question into","sources":[{}]}
AGPBI: {"kind":"error","text":"your own package namespace. This means that they will never be in","sources":[{}]}
AGPBI: {"kind":"error","text":"conflict with core system classes. JarJar is a tool that may help","sources":[{}]}
AGPBI: {"kind":"error","text":"you in this endeavor. If you find that you cannot do this, then","sources":[{}]}
AGPBI: {"kind":"error","text":"that is an indication that the path you are on will ultimately","sources":[{}]}
AGPBI: {"kind":"error","text":"lead to pain, suffering, grief, and lamentation.","sources":[{}]}
AGPBI: {"kind":"error","text":"1 error; aborting","sources":[{}]}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.316 secs


Кликните здесь для просмотра всего текста

Information:Gradle tasks [:app:assembleDebug]
Error:trouble processing "javax/xml/bind/Binder.class":
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:when not building a core library.
Error:This is often due to inadvertently including a core library file
Error:in your application's project, when using an IDE (such as
Error:Eclipse). If you are sure you're not intentionally defining a
Error:core class, then this is the most likely explanation of what's
Error:going on.
Error:However, you might actually be trying to define a class in a core
Error:namespace, the source of which you may have taken, for example,
Error:from a non-Android virtual machine project. This will most
Error:assuredly not work. At a minimum, it jeopardizes the
Error:compatibility of your app with future versions of the platform.
Error:It is also often of questionable legality.
Error:If you really intend to build a core library -- which is only
Error:appropriate as part of creating a full virtual machine
Error:distribution, as opposed to compiling an application -- then use
Error:the "--core-library" option to suppress this error message.
Error:If you go ahead and use "--core-library" but are in fact
Error:building an application, then be forewarned that your application
Error:will still fail to build or run, at some point. Please be
Errorrepared for angry customers who find, for example, that your
Error:application ceases to function once they upgrade their operating
Error:system. You will be to blame for this problem.
Error:If you are legitimately using some code that happens to be in a
Error:core package, then the easiest safe alternative you have is to
Error:repackage that code. That is, move the classes in question into
Error:your own package namespace. This means that they will never be in
Error:conflict with core system classes. JarJar is a tool that may help
Error:you in this endeavor. If you find that you cannot do this, then
Error:that is an indication that the path you are on will ultimately
Error:lead to pain, suffering, grief, and lamentation.
Error:1 error; aborting
Error:trouble processing "javax/xml/ws/Action.class":
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:when not building a core library.
Error:This is often due to inadvertently including a core library file
Error:in your application's project, when using an IDE (such as
Error:Eclipse). If you are sure you're not intentionally defining a
Error:core class, then this is the most likely explanation of what's
Error:going on.
Error:However, you might actually be trying to define a class in a core
Error:namespace, the source of which you may have taken, for example,
Error:from a non-Android virtual machine project. This will most
Error:assuredly not work. At a minimum, it jeopardizes the
Error:compatibility of your app with future versions of the platform.
Error:It is also often of questionable legality.
Error:If you really intend to build a core library -- which is only
Error:appropriate as part of creating a full virtual machine
Error:distribution, as opposed to compiling an application -- then use
Error:the "--core-library" option to suppress this error message.
Error:If you go ahead and use "--core-library" but are in fact
Error:building an application, then be forewarned that your application
Error:will still fail to build or run, at some point. Please be
Errorrepared for angry customers who find, for example, that your
Error:application ceases to function once they upgrade their operating
Error:system. You will be to blame for this problem.
Error:If you are legitimately using some code that happens to be in a
Error:core package, then the easiest safe alternative you have is to
Error:repackage that code. That is, move the classes in question into
Error:your own package namespace. This means that they will never be in
Error:conflict with core system classes. JarJar is a tool that may help
Error:you in this endeavor. If you find that you cannot do this, then
Error:that is an indication that the path you are on will ultimately
Error:lead to pain, suffering, grief, and lamentation.
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
Information:BUILD FAILED
Information:Total time: 1.316 secs
Information:67 errors
Information:0 warnings
Information:See complete output in console
0
Pablito
2812 / 2236 / 754
Регистрация: 12.05.2014
Сообщений: 7,824
Завершенные тесты: 1
09.06.2017, 19:10 6
какой минимальный код надо написать что бы перестало билдиться?
и что там в build.gradle понаписано? вдруг там остались попытки импорта библиотеки
0
Yury609
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
09.06.2017, 23:32  [ТС] 7
вот build.gradle
Кликните здесь для просмотра всего текста

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.yzolotykh.myapplication"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/jaxws-api-2.2.1.jar')
}


вот код, по которому делается APK. При этом строчку compile files('libs/jaxws-api-2.2.1.jar') и саму библиотеку пришлось удалить из проекта...
Кликните здесь для просмотра всего текста

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.example.yzolotykh.myapplication;
 
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
//import java.net.*;
//import java.util.*;
//import java.io.*;
import java.net.Authenticator;
//import javax.xml.namespace.QName;
//import schemas.dynamics.microsoft.nav.system.*;
 
public class MainActivity extends Activity {
    public static String myLogs="comWS";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Authenticator.setDefault(new MyAuthenticator());
        /*
        try {
            String baseURL = "http://192.168.123.176:7147/CU6WMS/WS/";
 
            URL systemServiceURL = new URL(baseURL + "SystemService");
            QName systemServiceQName = new QName("urn:microsoft-dynamics-schemas/nav/system/", "SystemService");
            SystemService systemService = new SystemService(systemServiceURL, systemServiceQName);
            SystemServicePort systemPort = systemService.getSystemServicePort();
            List<String> companies = systemPort.companies();
            Log.d(myLogs, "Companies:");
            for (String company : companies) {
                Log.d(myLogs, " "+ company);
            }
        } catch(MalformedURLException e) {
        }
        */
        Log.d(myLogs, "end");
    }
}
0
09.06.2017, 23:32
MoreAnswers
Эксперт
37091 / 29110 / 5898
Регистрация: 17.06.2006
Сообщений: 43,301
09.06.2017, 23:32

Android Studio 32 bit - загрузка SDK
Уже всякие форумы обшарил, не могу понять, как исправить это. Скачал архив программы с сайта...

При установке Android Studio не могу установить SDK
Добрый вечер форумчане) Не давно изучил поверхностно java, и решил не много заняться android-ом)...

Не хочет работать программа, что делать? Android Studio + VK API
Сделал программу в Android Studio, использовал VK api. Вроде бы, авторизация должна работать. Я...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
7
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Рейтинг@Mail.ru