Android 問題匯總


Android問題匯總

目錄

1.使用Android Studio新建項目后,啟動模擬器出現【No system image available】

img

解決:切換網絡,連接外網。看立馬就好了😙

image-20201012132909978

2. SDK、AVD、JDK、ADB、APK整理

AVD

Android Virtual Device,安卓虛擬設備.

image-20201106162409927

這就叫安卓虛擬機,AVD。

ADB

adb,android debug bridge安卓調試橋,可以讓您與設備進行通信。

參考

3.新建android空項目后configure build一直在轉圈

  • 嘗試解決方法1:換網絡

結果:報錯

ERROR: Android dependency 'androidx.loader:loader:1.0.0' is set to compileOnly/provided which is not supported

image-20201013105828259

吃個飯回來build一下又好了????

4.在根據P37頁在onCreate()方法中寫入button toast事件時出現代碼Button提示紅色,且說can't resolve symbol button的提示

解決:在該activity.java的頭部中添加以下代碼

import android.widget.*

image-20201013133539837

5.can't resolve symbol Intent

解決:把鼠標放在標紅的Intent上,按ALT+Enter即自動導入

import android.content.Intent;

也可手動寫入上述代碼

Intent intent = new Intent(MainActivity.this,SecondActivity.class);
startActivity(intent);

6.理解在XML文件中的xmlns

xmlns: xml namespace,xml命名空間。

命名空間的作用是解決命名沖突,不同程序設計師寫的代碼在整合時可能會遇到命名相同的情況,這樣就需要指定名字的空間域,存放在名字空間域的全局實體只在本空間域內有效。

該屬性的值類似於 URL,它定義了一個命名空間,瀏覽器會將此命名空間用於該屬性所在元素內的所有內容。

7.the ADB binary found at ... is obsolete and has seroiusperformance problems with the Android Emulato

image-20201014105017960

打開SDK managerimage-20201014105536296

選擇SDK tools,點擊右下角show package details.

image-20201014105556170

  • 網上的情況和解決方法

image-20201014105740659

  • 我的這里它沒有update available.顯示已經安裝了30.0.2和28.0.2(我忘了哪個版本了)

我不勾選低版本28.0.2,只勾選30.0.2,點擊應用,它會開始卸載28.0.2,不要害怕,卸載完了點擊finish ,點擊ok就可以了。

再次run,就不會顯示該問題了。

8.Emulator: ##KBD: Full queue, dropping event, current drop count

點擊run后手機模擬器只顯示之前的一個android項目,而且點擊任何按鈕都無響應,在android studio的Event log中顯示Emulator: ##KBD: Full queue, dropping event, current drop count信息。

解決方法:

關掉該模擬器,然后點擊AVD manager image-20201014131418887

會進入下圖界面,選擇Wipe Data,擦除數據。

image-20201014131434666

再次運行項目即可。

參考文檔

9.怎么查看自己的android studio版本?

解答:打開android studio-Help-About即可

image-20201015133355270

我的android studio版本是3.4.1

10.android studio3.4.1版本添加百分比布局依賴

解決:打開app/bulid.gradle

在dependencies中添加

implementation 'androidx.percentlayout:percentlayout:1.0.0'

百分比布局正確寫法

  1. 首先打開app/build.gradle文件,在dependencies中添加百分比布局依賴包implementation 'androidx.percentlayout:percentlayout:1.0.0'

(注:我的android studio版本是3.4.1)

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
    //添加該行
    implementation 'androidx.percentlayout:percentlayout:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

  1. 打開activity_main.xml文件,復制粘貼下面的代碼
<?xml version="1.0" encoding="utf-8"?>
<androidx.percentlayout.widget.PercentFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/button1"
        android:layout_gravity="left|top"
        android:text="東"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_heightPercent="50%"
        app:layout_widthPercent="50%" />

    <Button
        android:id="@+id/button2"
        android:layout_gravity="right|top"
        android:text="西"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_heightPercent="50%"
        app:layout_widthPercent="50%" />

    <Button
        android:id="@+id/button3"
        android:layout_gravity="left|bottom"
        android:text=" 南"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_heightPercent="50%"
        app:layout_widthPercent="50%" />

    <Button
        android:id="@+id/button4"
        android:layout_gravity="right|bottom"
        android:text="北"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_heightPercent="50%"
        app:layout_widthPercent="50%" />

</androidx.percentlayout.widget.PercentFrameLayout>
  1. 展示效果
image-20201015142659717

11.使用adb工具無法切換成超級管理員

打開DOS窗口,輸入adb shell,命令行顯示$,表示當前為普遍管理員;命令行顯示# ,表示當前為超級管理員。

我這里顯示的是$

輸入su命令,顯示su:not found,切換管理員身份失敗

image-20201028154413529

原因:

我所使用的Android模擬器版本是處於7.0版本以上的(包括7.0),沒有root權限,必須下載一個Android模擬器版本處於7.0版本以下的,並運行它

解決:

打開AVD manager 下載android版本低於7.0的安卓模擬器。運行該安卓模擬器,在DOS窗口中輸入adb shell回車,顯示#,切換成超級管理員成功😙

image-20201028154808288

12.怎么找到SDK路徑?怎么找到SDK/platform-tools路徑

解決:

在導航欄中

image-20201028161831597

找到image-20201028161902679

打開這個圖標,即可以看到SDK的路徑

image-20201028161944545

把SDK路徑復制到文件夾中,進入SDK路徑,就可以看到platform-tools了

image-20201028162256002

13.Android Studio代碼區字體太小,調整代碼區字體大小

解決:

File - settings-Editor-font-Size 調整size即可。

image-20201028230823214

14.怎么刪除在android模擬器上安裝好的應用程序?

解決:

打開Android模擬器-設置(Settings)-Devices-Apps-找到你想刪除的應用-點擊該應用程序-選擇uninstall

image-20201029133115893

15.使用adb 檢查表是否添加數據成功 能正常進入數據庫,查到表名,但是輸入select * from Book;無返回結果

image-20201028234936417

解決:

這是因為我自己在建Book表時把其中一個列名寫錯了,而我在添加數據時列名寫的是正確的,導致不能往內正常添加數據

,顯示不出來,我后來把建表時的列名和添加數據時的列名全部核對更改統一了,就好了。

image-20201029134225236

16.配置LitePal

解決:

進入該鏈接,里面有非常非常詳細的指導。隨着時間的推移,它可能會版本更新,所以一定要去這個官網去配置LitePal.

2020/10/29

  1. 添加依賴。

在app/build.gradle dependencies中添加LitePal依賴

dependencies {
    implementation 'org.litepal.guolindev:core:3.2.2'
}
  1. 配置litepal.xml.

app/src/main-new-directory-assets-new-file-輸入litepal.xml,創建litepal.xml文件,編輯litepal.xml內容

<?xml version="1.0" encoding="utf-8"?>
<litepal>
    <!--
    	Define the database name of your application. 
    	By default each database name should be end with .db. 
    	If you didn't name your database end with .db, 
    	LitePal would plus the suffix automatically for you.
    	For example:    
    	<dbname value="demo" />
    -->
    <dbname value="demo" />

    <!--
    	Define the version of your database. Each time you want 
    	to upgrade your database, the version tag would helps.
    	Modify the models you defined in the mapping tag, and just 
    	make the version value plus one, the upgrade of database
    	will be processed automatically without concern.
			For example:    
    	<version value="1" />
    -->
    <version value="1" />

    <!--
    	Define your models in the list with mapping tag, LitePal will
    	create tables for each mapping class. The supported fields
    	defined in models will be mapped into columns.
    	For example:    
    	<list>
    		<mapping class="com.test.model.Reader" />
    		<mapping class="com.test.model.Magazine" />
    	</list>
    -->
    <list>
    </list>
    
    <!--
        Define where the .db file should be. "internal" means the .db file
        will be stored in the database folder of internal storage which no
        one can access. "external" means the .db file will be stored in the
        path to the directory on the primary external storage device where
        the application can place persistent files it owns which everyone
        can access. "internal" will act as default.
        For example:
        <storage value="external" />
    -->
    
</litepal>
  1. 配置LitePalApplicaiton

修改AndroidManifest.xml代碼

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.litepaltest">

    <application
                 
    <!--添加該句-->
        android:name="org.litepal.LitePalApplication"
    
        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">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

17.在使用LitePal創建數據庫時運行程序點擊按鈕直接顯示LitePalTest has stopped. 報E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.litepaltest, PID: 18609 org.litepal.exceptions.ParseConfigurationFileException: can not parse the litepal.xml, check if it's in correct format錯誤。

image-20201029164945648 image-20201029165016446

原因:

image-20201029165802354

說明我這個litepal.xml里面有格式不對

解決:

我在litepal.xml找了半天我也不知道我哪里是寫錯了,索性把鏈接2.Configure litepal.xml重新粘貼了過來,然后就好了。。。。。

我的litepal.xml源碼

<?xml version="1.0" encoding="utf-8"?>
<litepal>
    <!--
    	Define the database name of your application.
    	By default each database name should be end with .db.
    	If you didn't name your database end with .db,
    	LitePal would plus the suffix automatically for you.
    	For example:
    	<dbname value="demo" />
    -->
    <dbname value="BookStore" />

    <!--
    	Define the version of your database. Each time you want
    	to upgrade your database, the version tag would helps.
    	Modify the models you defined in the mapping tag, and just
    	make the version value plus one, the upgrade of database
    	will be processed automatically without concern.
			For example:
    	<version value="1" />
    -->
    <version value="1" />

    <!--
    	Define your models in the list with mapping tag, LitePal will
    	create tables for each mapping class. The supported fields
    	defined in models will be mapped into columns.
    	For example:
    	<list>
    		<mapping class="com.test.model.Reader" />
    		<mapping class="com.test.model.Magazine" />
    	</list>
    -->
    <list>
        <mapping class = "com.example.litepaltest.Book"></mapping>
    </list>

    <!--
        Define where the .db file should be. "internal" means the .db file
        will be stored in the database folder of internal storage which no
        one can access. "external" means the .db file will be stored in the
        path to the directory on the primary external storage device where
        the application can place persistent files it owns which everyone
        can access. "internal" will act as default.
        For example:
        <storage value="external" />
    -->

</litepal>

18.怎么使用adb進入數據庫看表?

解決:

打開dos窗口,輸入adb shell ,如果返回# ,則說明進入超級管理員模式,如果返回$,則說明進入普遍管理員模式,我們要進入超級管理員模式,如出現不能進入超級管理員模式,則應下載android版本低於7.0的模擬器重新運行一下。

輸入 cd /data/data/com.example.databasetest/databases/

輸入ls

輸入sqlite3 BookStore.db 進入BookStore.db 數據庫

輸入.table 查看有哪些表

輸入.schema查看怎么創建的表

19.打開模擬器,在Android studio底端顯示【waiting for target deviceto come online】一直在轉圈,而且點擊模擬器中應用程序的界面沒反應

解決:

參考博文

這個問題是由模擬器引起的,首先打開AVD managerimage-20201030152959682

第一步:先關掉你自己的模擬器
第二步:打開AVD manager,找到你自己的模擬器,里面有一個選項Cold Boot Now
點擊一下,模擬器打開並提示一行信息,直接dismiss掉就行了
第三步:重新運行app就可以了

20.在模擬器中給10086打電話能打通嗎?

解答:不能,hhhhhhhh

但是界面太逼真了

image-20201030153227215

我也拿了我自己號碼試,接不到啦,hhhhhh

21.對URI和URL的理解

參考博客

一、URI

<1>什么是URI

URI,通一資源標志符(Uniform Resource Identifier, URI),表示的是web上每一種可用的資源,如 HTML文檔、圖像、視頻片段、程序等都由一個URI進行標識的。

<2>URI的結構組成

URI通常由三部分組成:

①資源的命名機制;

②存放資源的主機名;

③資源自身的名稱。

(注意:這只是一般URI資源的命名方式,只要是可以唯一標識資源的都被稱為URI,上面三條合在一起是URI的充分不必要條件)

<3>URI舉例

我們可以這樣解釋它:

①這是一個可以通過https協議訪問的資源,

②位於主機 blog.csdn.net上,

③通過“/qq_32595453/article/details/79516787”可以對該資源進行唯一標識(注意,這個不一定是完整的路徑)

注意:以上三點只不過是對實例的解釋,以上三點並不是URI的必要條件,URI只是一種概念,怎樣實現無所謂,只要它唯一標識一個資源就可以了。

二、URL

URL是URI的一個子集。它是Uniform Resource Locator的縮寫,譯為“統一資源定位 符”。

通俗地說,URL是Internet上描述信息資源的字符串,主要用在各種WWW客戶程序和服務器程序上。

采用URL可以用一種統一的格式來描述各種信息資源,包括文件、服務器的地址和目錄等。URL是URI概念的一種實現方式。

URL的一般格式為(帶方括號[]的為可選項):

protocol : // hostname[:port] / path / [;parameters][?query]#fragment

URL的格式由三部分組成:

①第一部分是協議(或稱為服務方式)。

②第二部分是存有該資源的主機IP地址(有時也包括端口號)。

③第三部分是主機資源的具體地址,如目錄和文件名等。

第一部分和第二部分用“: //”符號隔開,

第二部分和第三部分用“/”符號隔開。

第一部分和第二部分是不可缺少的,第三部分有時可以省略。

三、URI和URL之間的區別

從上面的例子來看,你可能覺得URI和URL可能是相同的概念,其實並不是,URI和URL都定義了資源是什么,但URL還定義了該如何訪問資源。URL是一種具體的URI,它是URI的一個子集,它不僅唯一標識資源,而且還提供了定位該資源的信息。URI 是一種語義上的抽象概念,可以是絕對的,也可以是相對的,而URL則必須提供足夠的信息來定位,是絕對的。

21.使用git把遠程版本庫克隆到本地報“fatal: unable to access https://github.com/lululuxiaofei/coolweather.git/: Failed to connect to github.com port 443: Timed out”

解決:

連接公司外網。

我覺得這篇博文說的有道理。因為我直接連接了公司外網,所以一下就好了,就沒有看這篇文章了,但是我覺得原因應該是如該博客所說的。

我后來連接公司的外網也不太行,后來我重啟了git bash再輸就好了

22.再次創建和LitePal相關的項目時,在AndroidManifest.xml配置LitePalApplication寫入 android:name="org.litepal.LitePalApplication"時會標紅

解決:在Android Studio 會在頂部彈窗點擊Sync Now 就可以了。

23.運行酷歐天氣,顯示正在加載,然后加載失敗,無法顯示全國各省名稱

我在完成P508-P509頁14.4節所有內容點擊運行程序時,發現

嘗試解決方法1:

參考

在AndroidManifest.xml加android:usesCleartextTraffic=“true”,沒用

嘗試解決方法2:

把app/build.gradle的compileSdkVersion 和targetSdkVersion由30改成26 沒用

嘗試方法2一直android studio界面一直顯示2 processings running,然后我就強制終止了程序的運行,並且把compileSdkVersion 和targetSdkVersion都改成了30,然后重新運行程序,就好了。。。。。。

莫名其妙。。。。。。

但是我覺得這篇博客可能會有用

24.酷歐天氣正常顯示省份后,點擊某一省份,APP閃退,報CoolWeather keeps stopping

點擊Logcat,找到錯誤的原因

是我在queryCities()方法中把

cityList = LitePal.where("provinceid = ?", String.valueOf(selectedProvince.getId())).find(City.class);

寫錯了

寫成了

cityList = LitePal.where("province = ?", String.valueOf(selectedProvince.getId())).find(City.class);

后來改正過來就好了。。。。。

25.android.database.sqlite.SQLiteException: no such table: county (code 1): , while compiling: SELECT * FROM county WHERE cityid = ?

原因: 沒有這個表

1.沒有在litepal.xml中添加該表, 或添加的bean類沒有繼承datasport

2.沒有在litepal.xml中更改版本號.

26.運行酷歐天氣,獲取天氣信息失敗,報com.example.coolweather W/System.err: java.net.SocketTimeoutException: connect timed out 🤔

image-20201105111129800

天氣信息加載不出來

image-20201105111207797
//錯誤日志
2020-11-05 11:01:48.766 24814-24844/com.example.coolweather W/System.err:     at java.net.PlainSocketImpl.socketConnect(Native Method)
2020-11-05 11:01:48.767 24814-24844/com.example.coolweather W/System.err:     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:334)
2020-11-05 11:01:48.767 24814-24844/com.example.coolweather W/System.err:     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:196)
2020-11-05 11:01:48.767 24814-24844/com.example.coolweather W/System.err:     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
2020-11-05 11:01:48.767 24814-24844/com.example.coolweather W/System.err:     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:356)
.......

嘗試解決方法1:

參考博客1

設置timeout時間

HttpUrlConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(8000);

我不知道在哪里設置時間???

嘗試解決方法2:

參考博客2

原HttpUtil

public class HttpUtil {
    public static void sendOkHttpRequest(String address, okhttp3.Callback callback)
    {
        OkHttpClient client = new OkHttpClient();
        //傳入請求地址
        Request request = new Request.Builder().url(address).build();

        //注冊一個回調來處理服務器響應
        client.newCall(request).enqueue(callback);
    }
}

現在

public class HttpUtil {
    public static void sendOkHttpRequest(String address, okhttp3.Callback callback)
    {
        //OkHttpClient client = new OkHttpClient();
        //傳入請求地址
        Request request = new Request.Builder().url(address).build();

        OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(60000, TimeUnit.MILLISECONDS)
                .readTimeout(500, TimeUnit.MILLISECONDS)
                .build();

        //注冊一個回調來處理服務器響應
        client.newCall(request).enqueue(callback);
    }
}

結果:仍報相同錯誤

沒有解決!!!!!!!!!!!!!!

還得繼續弄

我好像也沒改啥,中間有些名字寫錯了,然后給改了改,然后就好了?????

27.JSON和Gson

  • JSON

JSON是javascript對象的一種形態,是一種輕量級的數據交換格式。一般用來在java ee后台服務和Android或者IOS,H5之間進行通信的一種數據傳遞的格式。

JSON基本格式:

{"name":"zhangsan","age":23,"list":[{"score":2},{"score":3},{"score":4}]}

  • Gson

是谷歌推出的一個用於生成和解析Json數據格式的工具。

在使用gson之前需要先導入依賴。

參考

28.怎么找到最新的依賴包dependencies

  1. File-project structure-Dependencies-app-+(Add dependencies)-Library dependency,如下圖
image-20201106152608802
  1. 示例搜索drawerlayout依賴包

    step1:輸入androidx.drawerlayout* 然后search

image-20201106152910553

step2

點擊🆗按鈕

就可以了

29.怎么修改app的圖標和名稱

修改app名稱

打開res/values/strings.xml

<!--strings.xml-->
<resources>
    <string name="app_name">app名稱</string>
</resources>

把【app名稱】改成你想要的名字就可以了

<!--strings.xml-->
<resources>
    <string name="app_name">微信</string>
</resources>

它是通過AndroidManifest.xml中的label鏈接到該app名稱的

<application
....
android:label="@string/app_name"
...
>
....
</application>

修改app圖標

由於手機主題的原因,有的時候這個手機的圖標全是圓形的,有的時候這個手機的圖標全是方形的,不同手機的分辨率也是不同的,所以我們需要考慮不同情況。

  • 打開AndroidManifest.xml,有android:icon和android:roundIcon。

    android:icon=@mipmap/ic_launcher

    @mipmap文件夾下放着方形的ic_launcher圖片,這里圖片名一定不能帶后綴

    不能寫成android:icon=@mipmap/ic_launcher.png

    android:roundIcon=@mipmap/ic_launcher_round鏈接圓形的icon圖片

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.coolweather">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:name="org.litepal.LitePalApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"//鏈接的是方的icon
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"//鏈接的是圓的icon
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true">
       ....
    </application>

</manifest>

image-20201106155019112

  • 在project目錄下我們會看到很多的mipmap子目錄,我們把不同大小的圖標文件放到對應的mipmap目錄下。

mipmap僅僅是用來放啟動器圖標,其他繪制圖片還是要放到drawbale中去的

android會根據手機的屏幕分辨率自動選擇對應的mipmap目錄下的圖標文件,這樣可以避免圖標失真。所以我們最好在每個mipmap目錄下都放置適合的位圖。

在App中,無論你將圖片放在drawable還是mipmap目錄,系統只會加載對應density中的圖片,例如xxhdpi的設備,只會加載drawable-xxhdpi或者mipmap-xxhdpi中的資源。
而在Launcher中,如果使用mipmap,那么Launcher會自動加載更加合適的密度的資源。

或者說,mipmap會自動選擇更加合適的圖片僅在launcher中有效。

img

關於drawable和mipmap的好文

30.P317使用HTTP協議訪問網絡時報“java.net.SocketTimeoutException: connect timed out”錯誤

解決:連接VPN,切換網絡

31.我在運行展示網頁的app時網頁界面顯示報錯net::ERR_NAME_NOT_RESOLVED

image-20201113092254402

日志image-20201113092544537

問題描述:我在做P313的項目時,以前可以顯示百度頁面的,今天早上過來運行程序,就顯示了這個界面

解決:看日志,顯示disconnect managed GoogleApiClient.肯定是連不上谷歌。模擬器瀏覽器是谷歌瀏覽器,所以連接VPN,切換網絡。🆗

32. No version of NDK matched the requested version 20.0.5594570

問題描述:我在打開E-ConceptV2運行時它提示我intall NDK。我安裝完NDK,它又提示說 No version of NDK matched the requested version 20.0.5594570

解決:打開SDK Manager-SDK tools,選中右下角的show details

image-20201118091403286

選擇NDK 20.0.5594570版本安裝即可。

33.make project、clean project、rebuild project、build APK、generate signed apk

  • make project

編譯project下所有Module,一般是自上次編譯后project下有更新的文件,不生成apk

  • Make Selected Modules

編譯指定的Module,一般是自上次編譯后Module下有更新的文件,不生成apk。

  • Clean project

刪除之前編譯后的編譯文件,並重新編譯整個Project,比較花費時間,不生成apk。

  • rebuild project

先執行Clean操作,刪除之前編譯的編譯文件和可執行文件,然后重新編譯新的編譯文件,不生成apk,這里效果其實跟Clean Project是一致的

  • build APK

前面4個選項都是編譯,沒有生成apk文件,如果想生成apk,需要點擊build apk.

  • Generate Signed APK

生成有簽名的apk。

34.Android Studio Build亂碼

參考

1.雙擊shift,輸入Edit Custom VM Options,點擊第一個

2.在打開的文件中輸入-Dfile.encoding=UTF-8

3.重啟Android Studio


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM