【美妍機房】android studio打包出現的問題

在VN maker後打包成package後,使用android studio打開並打包,無法差生apk,出現錯誤

錯誤1

C:\Users\ginyan\Desktop\1106test\1106test\platforms\android\CordovaLib\src\org\apache\cordova\PluginManager.java:342: error: cannot find symbol

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {

^

symbol: variable N

location: class VERSION_CODES

工程師解答:

Simply upgrade the compileSdkVersion and targetSdkVersion to 31 in your android/app/build.gradle file.

Updated-: make sure you set compileSdkVersion in your android/app/build.gradle file to 31

Old-: I encounter this error while using the Geolocator plugin in the flutter app. to Solve this error you have to open LocationMapper.java (you can find this path in your Debug console). and remove this part

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)

and also make sure your android compile version is 30 (For GeoLocator Build.gradle)

   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
      position.put("is_mocked", location.isMock());
   } 
  

Build.VERSION_CODES.R only exists in API 30, but you're compiling with API 29.

The compileSdkVersion should be set to 30 if you want to use Build.VERSION_CODES.R.


Update for cordova-android@10

As of cordova-android@10, compileSdkVersion has been removed android-targetSdkVersion is unified to set both the target & compile SDK versions, so that they always remain consistent.


Update for cordova-android@11

As of cordova-android@11, the ability to independently set the compile SDK and target SDK separately has returned.

Just like before, use android-targetSdkVersion preference to set the Target SDK. Use android-compileSdkVersion preference to set the Compile SDK.

Like before, the target SDK will default to a particular version that cordova-android has been tested with. Cordova-android@11 uses API 32 by default. The compile SDK will default to the configured Target SDK.

Generally speaking, the target and compile should match, but with cordova-android@11 (and 9), you can set the compile SDK higher while keeping the target SDK lower, which can be useful for things that requires the API codes for compatibility checks.

從 cordova-android@11 開始,已經恢復獨立設置編譯 SDK 和目標 SDK 。

和之前一樣,使用 android-target SdkVersion 首選項來設置 Target SDK。使用 android-compileSdkVersion 首選項設置編譯 SDK。

和以前一樣,目標 SDK 將默認為 cordova-android 已經測試過的特定版本。 Cordova-android@11 默認使用 API 32。編譯 SDK 將默認為配置的目標 SDK。

一般來說,目標和編譯應該匹配,但是使用cordova-android@11(和9),您可以將編譯SDK設置得更高,同時保持目標SDK更低,這對於需要API代碼進行兼容性檢查的事情很有用.


Find and change this line form 30 to 31.

最新文章

查看全部

problem4 如何添加廣告 I didn't have a chance to make mobile package from VNM, but it uses Cordova to build the game on both iOS and Android. There are some Cordova plugins that add AdMob to the app, for exa

bedroom-ppng.png

情節驚心動魄,情感深厚真摯,情慾熾烈狂熱的琴研單行本!僅限18歲以上讀者哦!以下為情慾濃烈的甜愛單行本

tea-cover.jpg
18+
cover-piao.jpg
18+
electricity_01.jpg
18+
1lightred3-pearl-cover.jpg
18+
kinbaku_01.jpg
18+
seven-cover.jpg
18+
1yellow2-cover-honey.jpg
18+
piano_01.jpg
18+
chip_01.jpg
18+
wine_01.jpg
18+
electricity_01.jpg
18+
you_01.jpg
18+
horsem.jpg
18+
frog_01.jpg
18+
cover3new.png
18+