[안드로이드] Android Studio non-ASCII 에러


기존의 eclipse 에서 개발된 앱소스를 안드로이드 스튜디오에서 import 하려고 하니 아래 처럼 에러가 나면서 불러오지를 못하네요~

"Your project file contains non-ASCII characters."

[안드로이드] Android Studio non-ASCII 에러

이클립스에서는 폴더명이 한글이 있더라도 되던게 안드로이드 스튜디오에서는 안되는가 봅니다.

Google 드라이브 폴더명을 영문으로 바꾸고 불러오니 잘 되는군요~



블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

[안드로이드] targetSDK 26 HttpClient 오류


Android SDK 23 이전에서 잘 동작하던 앱이 26으로 올리니 아래와 같은 오류가 발생합니다.

23 버전부터 제거가 되었다고 하네요~

org.apache.http.legacy.jar 파일을 다운로드 해서 libs 에 추가해 주면 됩니다.

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:169)

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:124)

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:366)

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:658)

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:632)

02-22 11:34:12.168: E/AndroidRuntime(8261): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:621)

https://android.googlesource.com/platform/prebuilts/sdk/+/android-support-test/org.apache.http.legacy

https://android.googlesource.com/platform/prebuilts/sdk/+archive/android-support-test/org.apache.http.legacy.tar.gz



블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 SDK 폴더 변경 하기



Android Studio 나 Eclipse 로 안드로이드를 개발하려면 Android SDK 가 필요합니다.


그런데 개발을 하다 보면 버전에 따른 업데이트로 인해 용량이 계속해서 늘어나게 됩니다.


C 드라이브에 있는 것을 mklink 명령어를 이용해서 HDD 나 SSD 의 다른 드라이브로 변경하면,


C 드라이브의 공간을 줄여서 용량 부족현상을 해결할 수가 있습니다.


C:\Users\사용자명\AppData\Local\Android\Sdk ( Android Studio 의 경우 폴더 위치 )


C:\Users\사용자명\android-sdks ( Eclipse 의 경우 폴더 위치 )


D 드라이브에 폴더를 하나 만들고 위의 폴더 내용을 이동 시킵니다.


그리고 위의 폴더를 지우고 mklink 명령어로 마운트를 시켜주면 됩니다.


mklink/j "C:\Users\사용자명\AppData\Local\Android\Sdk" D:\Android-SDK


mklink/j "C:\Users\사용자명\android-sdks" D:\Android-SDK


12기가 정도 C 공간이 늘어났네요~


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 Play스토어 업데이트 거부됨


개인정보를 서버로 전송하려면 http 를 https 로 보안서버를 구축해서 앱을 업데이트 하라고 앱이 삭제 되더니,

이번엔 아래와 같은 내용으로 업데이트가 거부되었네요~ ㅎ

앱이 Apache HTTP 클라이언트가 있는 X509TrustManager 인터페이스의 안전하지 않은 구현을 사용하고 있어 보안 취약성에 노출되었습니다. 취약성 수정 마감일 등 자세한 내용은 Google 고객센터의 이 도움말을 참조하세요.

구형폰에서 DefaultHttpClient 가 https 를 제대로 지원이 안되는게 문제네요~

아래 처럼 한번 시도해 봅니다.

DefaultHttpClient httpClient = new DefaultHttpClient();


==>

private HttpClient getHttpClient() {

try {

SchemeRegistry registry = new SchemeRegistry();

registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));

registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));

HttpParams params = new BasicHttpParams();

HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);

HttpProtocolParams.setContentCharset(params, HTTP.UTF_8);

ClientConnectionManager ccm = new ThreadSafeClientConnManager(params, registry);

return new DefaultHttpClient(ccm, params);

} catch (Exception e) {

return new DefaultHttpClient();

}

}

HttpClient httpClient = getHttpClient();

이건 통과되었는데 구형폰은 지원이 안되는게 문제네요~


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 앱 삭제된 이유


아래의 메일 내용으로 구글 플레이스토어에서 앱이 삭제되었다고 다시 수정해서 올리라고 하는군요~

Read through the Personal and Sensitive Information article and make the necessary changes to your app.

Your app is uploading users' phone number information to https://... without a prominent disclosure.

Make sure to also post a privacy policy in both the designated field in the Play Developer Console and from within the Play distributed app itself.

Make sure your app is compliant with the User Data policy and all other policies listed in the Developer Program Policies. Remember that additional enforcement could occur if there are further policy issues with your apps.

Sign in to your Play Console and upload the modified, policy compliant APK. Make sure to increment the version number of the APK.

Submit your app.

사용자의 폰번호를 서버로 전송한다는 이유로 삭제한 것 같습니다.

이런 경우엔 개인정보 취급방침 동의를 받는 다이얼로그를 추가하고 앱을 업데이트 하면 됩니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 Wrong orientation? No orientation specified


전에는 에러가 아니던게 이클립스가 업데이트 되어서 그런지 아래와 같은 에러가 나네요~

Wrong orientation? No orientation specified, and the default is horizontal,

yet this layout has multiple children where at least one has `layout_width="match_parent"`


이런 경우엔 orientation 이 가로냐 세로냐에 대한 정보가 없어서 그런가봅니다.

<LinearLayout

android:id="@+id/layout_title"

android:orientation="horizontal"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:baselineAligned="false"

android:background="@android:color/transparent"

>

android:orientation="" 에 horizontal 또는 vertical 을 넣어주면 됩니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 USB Debugging 적용 방법


출시되는 단말기는 디폴트로 개발자모드가 오프상태입니다.

이를 개발자모드로 변경하여야 합니다.

삼성폰이나 엘지폰 둘 다 비슷합니다.

스마트폰에서 환경설정으로 갑니다.

안드로이드 USB Debugging 적용 방법

소프트웨어 정보로 진입합니다.



안드로이드 USB Debugging 적용 방법

소프트웨어 정보에 보면 빌드 번호 필드가 있습니다.

개발자 모드로 적용될 때까지 계속해서 여러번 터치를 합니다.



안드로이드 USB Debugging 적용 방법

개발자 옵션이 이제 보이는군요~



안드로이드 USB Debugging 적용 방법

USB 디버깅을 켜줍니다.


이제 USB 케이블을 연결하면 아래 처럼 디바이스가 나타날 겁니다.

안드로이드 USB Debugging 적용 방법

그리고 첫번째 연결시 USB 디버깅을 스마트폰에서 허용을 해주어야 합니다.




블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 Fix the build path then try building this project


Your project contains error(s), please fix them befor running your application.


Description Resource Path Location Type

The project was not built since its build path is incomplete.

Cannot find the class file for java.lang.Object.

Fix the build path then try building this project com.example.www Unknown Java Problem


위와 같은 에러 메시지가 나오면 이클립스 Android SDK Manage 에서 업데이트를 해줘보세요~

그래도 안된다면 프로젝트를 Delete 했다가 다시 Import 시켜서 해보세요~


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

안드로이드 Device does not have package com.google.android.gsf


05-30 04:47:27.749: E/AndroidRuntime(305):

 java.lang.RuntimeException:

 Unable to start activity ComponentInfo{com.example.www/com.example.www.MainActivity}:

 java.lang.UnsupportedOperationException:

 Device does not have package com.google.android.gsf

위와 같은 에러가 나는데 에뮬레이터라서 그런가봅니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,