Hello @shreyash
Is it possible to add the class UsesService to annotations.jar to make this line work?:
import com.google.appinventor.components.annotations.UsesServices;
Hello @shreyash
Is it possible to add the class UsesService to annotations.jar to make this line work?:
import com.google.appinventor.components.annotations.UsesServices;
Hi,
You can import that class by adding the original AndroidRuntime.jar
from the AI2 extension template as your extension's compile-time dependency. In Rush, to add any JAR as a compile-time dependency, just add it inside the deps
directory but don't include it in the rush.yml
file.
PS: You can get the AndroidRuntime.jar
from here: https://github.com/mit-cml/extension-deps/blob/master/AndroidRuntime.jar
#Off Topic
What is the meaning of this
From Latin: "Post Scriptum" - After written
#offtopic
P.S. is a footnote. It includes additional information.
It can be used with some more variations
Here @ABG has used some programming skills and applied nesting with "Post Script".
P.S., P.P.S., P.P.P.S...
Edit: Pls read this Post as #offtopic
My Rush build is failing again and again.
While i understand that in my profile i have space but how do I ignore the same. "C:\users\amrish shah".
How doi ignore space while building / compiling.
┌ Checking project files
│ info Checking metadata file (rush.yml)
│ info Checking AndroidManifest.xml file
└ done
┌ Compiling sources
│ info Picked 1 source file
│ erro invalid flag: Shah\AppData\Roaming\rush\workspaces\io.amrish.test\classes
│ Usage: javac
This is a known bug and will be fixed in a future release. Until then, try this workaround:
C:\Users\amrish shah\AppData\Roaming\rush
) to a place whose path has no whitespace, for e.g., C:\rush
.RUSH_DATA_DIR
and set it equal to the path of the new data directory.rush build
.@shreyash i am using your rush since long... but these days i am encountering an error while using proguard in rush
while i dont have any argument in my simple event
@SimpleEvent
public void OnInitialised(){
EventDispatcher.dispatchEvent(this,"OnInitialised");
}
Also when i remove proguard extension works fine
My proguard file code:-
# Add any ProGuard configurations specific to this
# extension here.
-keep public class in.akshatt.UnityAds.UnityAds {
public *;
}
-keeppackagenames gnu.kawa**, gnu.expr**
-optimizationpasses 4
-allowaccessmodification
-mergeinterfacesaggressively
-repackageclasses 'in/akshatt/UnityAds/repack'
-flattenpackagehierarchy
-dontpreverify
#by me :)
-keepattributes SourceFile,LineNumberTable
-keepattributes JavascriptInterface
-keep class android.webkit.JavascriptInterface {
*;
}
-keep class com.unity3d.ads.** {
*;
}
-keep class com.unity3d.services.** {
*;
}
-dontwarn com.google.**
-dontwarn com.unity3d.**
It doesn't look like it has anything to do with ProGuard. Is this extension being tested in the companion? If yes, make sure that you restart the companion connection every time you make changes in the extension. In some cases, you might even need to delete the companion's directory from your Android device.
Seems like the issue doesn't have to do with the intialization of the method itself, but rather from where you call the method. Could you please send that?
I tested it both in companion and real apk and results are same
.. but as i said...
by this reason i am suspecting proguard
com.unity3d.ads.UnityAds.initialize(context, gameID, testMode, new IUnityAdsInitializationListener() {
@Override
public void onInitializationComplete() {
OnInitialised();
}
@Override
public void onInitializationFailed(com.unity3d.ads.UnityAds.UnityAdsInitializationError unityAdsInitializationError, String s) {
switch (unityAdsInitializationError) {
case INTERNAL_ERROR:
OnInitialiseFailed("InternalError", s);
break;
case INVALID_ARGUMENT:
OnInitialiseFailed("InvalidArgument", s);
break;
case AD_BLOCKER_DETECTED:
OnInitialiseFailed("ADBlockerDetected", s);
break;
}
}
});
That's weird: your code doesn't provide any arguments, but the error says there are 2. It might have to do with ProGuard, then.
yes thats the main thing i think here @shreyash can help neither my event has any arguments nor the initialisation method
PM me a demo app containing your extension.
Can you try changing name of your extension to UnityAd only and not UnityAds it might be conflicting with the ads class.
does Rush support @Options annotation?
I am trying to make a extension with helper block using @Options annotation like:
@SimpleProperty
public void RepeatMode(@Options(RepeatMode.class) int mode) {
this.repeatMode = mode;
}
@SimpleProperty
public @Options(RepeatMode.class) int RepeatMode() {
return this.repeatMode;
}
but build failed:
Build initialized
┌ Checking project files
│ info Checking metadata file (rush.yml)
│ info Checking AndroidManifest.xml file
└ done
┌ Compiling sources
│ info Picked 2 source files
│ src\cn\kevinkun\Tween\RepeatMode.java:6: 错误: 找不到符号
│ import com.google.appinventor.components.common.OptionList;
│ ^
│ 符号: 类 OptionList
│ 位置: 程序包 com.google.appinventor.components.common
│ src\cn\kevinkun\Tween\RepeatMode.java:8: 错误: 找不到符号
│ public enum RepeatMode implements OptionList<Integer> {
│ ^
│ 符号: 类 OptionList
│ src\cn\kevinkun\Tween\Tween.java:3: 错误: 找不到符号
│ import com.google.appinventor.components.annotations.Options;
│ ^
│ 符号: 类 Options
│ 位置: 程序包 com.google.appinventor.components.annotations
│ src\cn\kevinkun\Tween\Tween.java:48: 错误: 找不到符号
│ public void RepeatMode(@Options(RepeatMode.class) int mode) {
│ ^
│ 符号: 类 Options
│ 位置: 类 Tween
│ src\cn\kevinkun\Tween\Tween.java:53: 错误: 找不到符号
│ public @Options(RepeatMode.class) int RepeatMode() {
│ ^
│ 符号: 类 Options
│ 位置: 类 Tween
│ 警告: 以下选项未被任何处理程序识别: '[output, org, root, version, extName]'
│ 5 个错误
└ failed
• Build failed [1s 43ms] []
the Chinese error message is 'Error: can not find symbol'.
or maybe @Options annotation is not supported by an extensions?